aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/ai-funcs.cpp
diff options
context:
space:
mode:
authorNipun Garg2019-06-25 00:29:15 +0530
committerEugene Sandulenko2019-09-03 17:16:59 +0200
commit4be327e39470ffc35611e5746895540a8820a899 (patch)
treeb4ef70443adfba5133781c84b368c6003e1e44dd /engines/hdb/ai-funcs.cpp
parenta28eb3e60e377a87d75b0760f07215eb7ea45848 (diff)
downloadscummvm-rg350-4be327e39470ffc35611e5746895540a8820a899.tar.gz
scummvm-rg350-4be327e39470ffc35611e5746895540a8820a899.tar.bz2
scummvm-rg350-4be327e39470ffc35611e5746895540a8820a899.zip
HDB: Add findEntityIgnore() and findEntityType()
Diffstat (limited to 'engines/hdb/ai-funcs.cpp')
-rw-r--r--engines/hdb/ai-funcs.cpp34
1 files changed, 34 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);
}