From ffe05e989b04f0d11e034e84a47cbbfe8d1597c6 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Wed, 3 Jul 2019 22:41:07 +0530 Subject: [PATCH] HDB: Add checkForTouchplate() --- engines/hdb/ai-funcs.cpp | 7 +++++++ engines/hdb/ai.h | 1 + 2 files changed, 8 insertions(+) diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index f16c1f05b6d..bc1e9924ced 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -661,6 +661,13 @@ void AI::setLuaAnimFrame(const char *initName, AIState st, int frame) { } } +int AI::checkForTouchplate(int x, int y) { + int tileIndex = g_hdb->_map->getMapBGTileIndex(x, y); + if (tileIndex == _touchplateOff || tileIndex == _templeTouchpOff) + return tileIndex; + return 0; +} + void AI::removeEntity(AIEntity *e) { _ents->erase(&e); } diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 14495b3c8bd..22032f2f338 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -787,6 +787,7 @@ public: void removeLuaEntity(const char *initName); void animLuaEntity(const char *initName, AIState st); void setLuaAnimFrame(const char *initName, AIState st, int frame); + int checkForTouchplate(int x, int y); void removeEntity(AIEntity *e); void setEntityGoal(AIEntity *e, int x, int y); void initAllEnts();