aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNipun Garg2019-06-20 19:12:56 +0530
committerEugene Sandulenko2019-09-03 17:16:52 +0200
commit11685a6ba140d9f695daa476a215917884b1ea51 (patch)
tree863367551a55a036784920bcad386e11b2491b39
parent3fc0cb74b123bb6b854534fdc48a0ae4d9440710 (diff)
downloadscummvm-rg350-11685a6ba140d9f695daa476a215917884b1ea51.tar.gz
scummvm-rg350-11685a6ba140d9f695daa476a215917884b1ea51.tar.bz2
scummvm-rg350-11685a6ba140d9f695daa476a215917884b1ea51.zip
HDB: Add animLuaEntity()
-rw-r--r--engines/hdb/ai-funcs.cpp10
-rw-r--r--engines/hdb/ai.h3
2 files changed, 13 insertions, 0 deletions
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<AIEntity *>::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);