src/players.cpp
changeset 10951 4db23258381f
parent 10792 95b6eb9fcc9e
child 10967 fb9a80b89ea4
--- a/src/players.cpp	Fri Jun 13 01:57:48 2008 +0000
+++ b/src/players.cpp	Fri Jun 13 05:50:24 2008 +0000
@@ -1270,8 +1270,11 @@
 		_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);
+		}
 	}
 }