mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-17 15:33:23 +00:00
HDB: Add findEntity()
This commit is contained in:
parent
43f6a0a475
commit
ab0402622e
@ -512,6 +512,23 @@ AIEntity *AI::locateEntity(const char *luaName) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
AIEntity *AI::findEntity(int x, int y) {
|
||||
for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) {
|
||||
if ((*it)->tileX == x && (*it)->tileY == y) {
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
|
||||
for (Common::Array<AIEntity *>::iterator it = _floats->begin(); it != _floats->end(); it++) {
|
||||
if ((*it)->tileX == x && (*it)->tileY == y) {
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
|
||||
warning("STUB: findEntity: Check for Laser");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void AI::removeEntity(AIEntity *e) {
|
||||
_ents->erase(&e);
|
||||
}
|
||||
|
@ -615,6 +615,7 @@ public:
|
||||
bool cacheEntGfx(AIEntity *e, bool init);
|
||||
void stopEntity(AIEntity *e);
|
||||
AIEntity *locateEntity(const char *luaName);
|
||||
AIEntity *findEntity(int x, int y);
|
||||
void removeEntity(AIEntity *e);
|
||||
void setEntityGoal(AIEntity *e, int x, int y);
|
||||
void initAllEnts();
|
||||
|
Loading…
x
Reference in New Issue
Block a user