src/players.cpp
branch0.6
changeset 11127 5e9620220703
parent 10366 960aae8c20e2
--- a/src/players.cpp	Sun Jun 01 16:45:32 2008 +0000
+++ b/src/players.cpp	Wed Jul 09 18:59:39 2008 +0000
@@ -1243,8 +1243,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);
+		}
 	}
 }