diff options
-rw-r--r-- | engines/hdb/ai-funcs.cpp | 10 | ||||
-rw-r--r-- | engines/hdb/ai.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index ef32d51795..ed5183fb27 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -2033,6 +2033,16 @@ 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::clearDiverters() { + AIEntity *e; + + for (uint i = 0; i < _ents->size(); i++) { + e = _ents->operator[](i); + if (e->type == AI_DIVERTER) + e->value1 = e->value2 = 0; + } +} + void AI::floatEntity(AIEntity *e, AIState state) { for (Common::Array<AIEntity *>::iterator it = _ents->begin(); it != _ents->end(); it++) { if (e == *it) { diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 59306389a0..098b4d3ab0 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -836,6 +836,7 @@ public: AIEntity *playerCollision(int topBorder, int bottomBorder, int leftBorder, int rightBorder); bool checkPlayerTileCollision(int x, int y); bool checkPlayerCollision(int x, int y, int border); + void clearDiverters(); // List functions void addToActionList(int actionIndex, int x, int y, char *funcLuaInit, char *funcLuaUse); |