aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/ai-funcs.cpp
diff options
context:
space:
mode:
authorNipun Garg2019-06-27 06:14:38 +0530
committerEugene Sandulenko2019-09-03 17:17:01 +0200
commit4905233ef0b5394d67767b39fbafb3f963515fa2 (patch)
treebd0dcbed8267b428426b88b1f7f81530e9b09f56 /engines/hdb/ai-funcs.cpp
parent4153d92b5adc0935b22f138ff5e4fc79f76e9863 (diff)
downloadscummvm-rg350-4905233ef0b5394d67767b39fbafb3f963515fa2.tar.gz
scummvm-rg350-4905233ef0b5394d67767b39fbafb3f963515fa2.tar.bz2
scummvm-rg350-4905233ef0b5394d67767b39fbafb3f963515fa2.zip
HDB: Add floatEntity()
Diffstat (limited to 'engines/hdb/ai-funcs.cpp')
-rw-r--r--engines/hdb/ai-funcs.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp
index c65c2672d0..28642c4c26 100644
--- a/engines/hdb/ai-funcs.cpp
+++ b/engines/hdb/ai-funcs.cpp
@@ -1541,6 +1541,18 @@ bool AI::checkPlayerCollision(int x, int y, int border) {
return (x > (_player->x - 32 + border) && x < (_player->x - 32 - border) && y >(_player->y - 32 + border) && y < (_player->y - 32 - border));
}
+void AI::floatEntity(AIEntity *e, AIState state) {
+ for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) {
+ if (e == *it) {
+ _floats->push_back(*it);
+ _ents->erase(it);
+ break;
+ }
+ }
+ e->state = state;
+ e->level = 1;
+}
+
bool AI::checkFloating(int x, int y) {
for (Common::Array<AIEntity *>::iterator it = _floats->begin(); it != _floats->end(); it++) {
if ((*it)->tileX == x && (*it)->tileY == y)