aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
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
parent4153d92b5adc0935b22f138ff5e4fc79f76e9863 (diff)
downloadscummvm-rg350-4905233ef0b5394d67767b39fbafb3f963515fa2.tar.gz
scummvm-rg350-4905233ef0b5394d67767b39fbafb3f963515fa2.tar.bz2
scummvm-rg350-4905233ef0b5394d67767b39fbafb3f963515fa2.zip
HDB: Add floatEntity()
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai-funcs.cpp12
-rw-r--r--engines/hdb/ai.h1
2 files changed, 13 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)
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index ec8c200244..3aa7bde5a2 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -709,6 +709,7 @@ public:
void addToPathList(int x, int y, int type, AIDir dir);
ArrowPath *findArrowPath(int x, int y);
+ void floatEntity(AIEntity *e, AIState state);
bool checkFloating(int x, int y);
bool getTableEnt(AIType type);