HDB: Shift Action initialization to AI()

This commit is contained in:
Nipun Garg 2019-06-22 07:13:30 +05:30 committed by Eugene Sandulenko
parent 154fc3c7f3
commit 653960f58a
2 changed files with 8 additions and 3 deletions

View File

@ -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;

View File

@ -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;