diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hdb/ai-funcs.cpp | 34 | ||||
-rw-r--r-- | engines/hdb/ai.h | 2 |
2 files changed, 36 insertions, 0 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index b35efdfc47..4f6bf35a2b 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -529,6 +529,40 @@ AIEntity *AI::findEntity(int x, int y) { return NULL; } +AIEntity *AI::findEntityIgnore(int x, int y, AIEntity *ignore) { + for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) { + if ((*it)->tileX == x && (*it)->tileY == y && (*it) != ignore) { + return *it; + } + } + + for (Common::Array<AIEntity *>::iterator it = _floats->begin(); it != _floats->end(); it++) { + if ((*it)->tileX == x && (*it)->tileY == y && (*it) != ignore) { + return *it; + } + } + + warning("STUB: findEntityIgnore: Check for Laser"); + return NULL; +} + +AIEntity *AI::findEntityType(AIType type, int x, int y) { + for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) { + if ((*it)->tileX == x && (*it)->tileY == y && (*it)->type == type) { + return *it; + } + } + + for (Common::Array<AIEntity *>::iterator it = _floats->begin(); it != _floats->end(); it++) { + if ((*it)->tileX == x && (*it)->tileY == y && (*it)->type == type) { + return *it; + } + } + + warning("STUB: findEntityType: Check for Laser"); + return NULL; +} + void AI::removeEntity(AIEntity *e) { _ents->erase(&e); } diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 96f0e6ded2..e228ebd499 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -629,6 +629,8 @@ public: void stopEntity(AIEntity *e); AIEntity *locateEntity(const char *luaName); AIEntity *findEntity(int x, int y); + AIEntity *findEntityIgnore(int x, int y, AIEntity *ignore); + AIEntity *findEntityType(AIType type, int x, int y); void removeEntity(AIEntity *e); void setEntityGoal(AIEntity *e, int x, int y); void initAllEnts(); |