diff options
author | Nipun Garg | 2019-06-22 07:13:30 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:55 +0200 |
commit | 653960f58aa623d6155cda6a03632a718f47a2c5 (patch) | |
tree | 38e3c064feb4ef972fe5495763351102070b5f6c | |
parent | 154fc3c7f3241f75c2d601e097c692f1b084fa3c (diff) | |
download | scummvm-rg350-653960f58aa623d6155cda6a03632a718f47a2c5.tar.gz scummvm-rg350-653960f58aa623d6155cda6a03632a718f47a2c5.tar.bz2 scummvm-rg350-653960f58aa623d6155cda6a03632a718f47a2c5.zip |
HDB: Shift Action initialization to AI()
-rw-r--r-- | engines/hdb/ai-init.cpp | 8 | ||||
-rw-r--r-- | engines/hdb/ai-lists.cpp | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index 18196b8d4a..05e939f821 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -671,9 +671,15 @@ AI::AI() { _floats = new Common::Array<AIEntity *>; _animTargets = new Common::Array<AnimTarget *>; - for (int i = 0; i < kMaxLevel2Ents;i++) { + for (int i = 0; i < kMaxLevel2Ents; i++) { _entsLevel2[i] = new AIEntLevel2; } + for (int i = 0; i < kMaxActions; i++) { + _actions[i] = new ActionInfo; + } + for (int i = 0; i < kMaxAutoActions; i++) { + _autoActions[i] = new AutoAction; + } // REMOVE: Remove for final. Used here due to lack of a MENU _numGems = _numGooCups = _numMonkeystones = _numInventory = 0; diff --git a/engines/hdb/ai-lists.cpp b/engines/hdb/ai-lists.cpp index 5bb8c0cf0c..1ef2e41edd 100644 --- a/engines/hdb/ai-lists.cpp +++ b/engines/hdb/ai-lists.cpp @@ -139,8 +139,7 @@ void AI::addToAutoList(int x, int y, const char *luaFuncInit, const char *luaFun const char *get; for (int i = 0;i < kMaxAutoActions;i++) { - if (!_autoActions[i]) { - _autoActions[i] = new AutoAction; + if (!_autoActions[i]->x) { _autoActions[i]->x = x; _autoActions[i]->y = y; _autoActions[i]->activated = false; |