From 76b589c9018b4a19cb636d404285594dbe3b3698 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Fri, 21 Jun 2019 19:45:36 +0530 Subject: HDB: Add checkFloating() --- engines/hdb/ai-funcs.cpp | 8 ++++++++ engines/hdb/ai.h | 2 ++ 2 files changed, 10 insertions(+) (limited to 'engines/hdb') diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index 9bbcf9d329..1c25198e37 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -1015,6 +1015,14 @@ void AI::drawEnts(int x, int y, int w, int h) { } } +bool AI::checkFloating(int x, int y) { + for (Common::Array::iterator it = _floats->begin(); it != _floats->end(); it++) { + if ((*it)->tileX == x && (*it)->tileY == y) + return true; + } + return false; +} + // Check to see if we can get this entity bool AI::getTableEnt(AIType type) { switch (type) { diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index c29f1c8ad8..b6b9b4a612 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -565,6 +565,8 @@ public: void animLuaEntity(const char *initName, AIState st); void drawEnts(int x, int y, int w, int h); + bool checkFloating(int x, int y); + bool getTableEnt(AIType type); bool walkThroughEnt(AIType type); void getItemSound(AIType type); -- cgit v1.2.3