Changeset - r9514:eaf2d3ed74fd
[Not reviewed]
master
0 1 0
rubidium - 16 years ago 2008-06-13 05:50:24
rubidium@openttd.org
(svn r13505) -Fix: clear the memory for the new AI during the loading of a savegame so it does not try to execute commands generated in a different savegame, which could be resulting in the AI trying to give orders to stations that do not exist.
1 file changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/players.cpp
Show inline comments
 
@@ -1270,8 +1270,11 @@ static void Load_PLYR()
 
		_player_colors[index] = p->player_color;
 

	
 
		/* This is needed so an AI is attached to a loaded AI */
 
		if (p->is_ai && (!_networking || _network_server) && _ai.enabled)
 
		if (p->is_ai && (!_networking || _network_server) && _ai.enabled) {
 
			/* Clear the memory of the new AI, otherwise we might be doing wrong things. */
 
			memset(&_players_ainew[index], 0, sizeof(PlayerAiNew));
 
			AI_StartNewAI(p->index);
 
		}
 
	}
 
}
 

	
0 comments (0 inline, 0 general)