aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hdb/ai-funcs.cpp17
-rw-r--r--engines/hdb/ai.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp
index 9faafe1bf6..f81a65fc92 100644
--- a/engines/hdb/ai-funcs.cpp
+++ b/engines/hdb/ai-funcs.cpp
@@ -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);
}
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 632a9559b3..334725c217 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -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();