diff options
| -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;  | 
