From 11685a6ba140d9f695daa476a215917884b1ea51 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Thu, 20 Jun 2019 19:12:56 +0530 Subject: HDB: Add animLuaEntity() --- engines/hdb/ai-funcs.cpp | 10 ++++++++++ engines/hdb/ai.h | 3 +++ 2 files changed, 13 insertions(+) (limited to 'engines') diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index b07399ffa1..b6cafe1ec2 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -589,6 +589,16 @@ void AI::initAllEnts() { warning("STUB: initAllEnts: LaserScan required"); } +void AI::animLuaEntity(const char *initName, AIState st) { + for (Common::Array::iterator it = _ents->begin(); it != _ents->end(); it++) { + if (Common::matchString((*it)->entityName, initName)) { + (*it)->state = st; + (*it)->animFrame = 0; + (*it)->animDelay = (*it)->animCycle; + } + } +} + // 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 cb24cac02e..171979940d 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -462,6 +462,9 @@ public: void removeEntity(AIEntity *e); void setEntityGoal(AIEntity *e, int x, int y); void initAllEnts(); + + void animLuaEntity(const char *initName, AIState st); + bool getTableEnt(AIType type); bool walkThroughEnt(AIType type); void getItemSound(AIType type); -- cgit v1.2.3