@@ -1267,14 +1267,17 @@ static void Load_PLYR()
while ((index = SlIterateArray()) != -1) {
Player *p = GetPlayer((PlayerID)index);
SaveLoad_PLYR(p);
_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);
}
extern const ChunkHandler _player_chunk_handlers[] = {
{ 'PLYR', Save_PLYR, Load_PLYR, CH_ARRAY | CH_LAST},
};