aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb
diff options
context:
space:
mode:
authorNipun Garg2019-07-06 00:56:45 +0530
committerEugene Sandulenko2019-09-03 17:17:12 +0200
commitab06602332b3a10029127656dbc23471c3237f3e (patch)
tree97c95a105cf14c9b456846c00c9a72d101f90680 /engines/hdb
parent68431702c87cfba224b3736447b6de07c20b37e1 (diff)
downloadscummvm-rg350-ab06602332b3a10029127656dbc23471c3237f3e.tar.gz
scummvm-rg350-ab06602332b3a10029127656dbc23471c3237f3e.tar.bz2
scummvm-rg350-ab06602332b3a10029127656dbc23471c3237f3e.zip
HDB: Add clearDiverters()
Diffstat (limited to 'engines/hdb')
-rw-r--r--engines/hdb/ai-funcs.cpp10
-rw-r--r--engines/hdb/ai.h1
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);