src/players.cpp
changeset 10951 4db23258381f
parent 10792 95b6eb9fcc9e
child 10967 fb9a80b89ea4
equal deleted inserted replaced
10950:36bf5bd16ebd 10951:4db23258381f
  1268 		Player *p = GetPlayer((PlayerID)index);
  1268 		Player *p = GetPlayer((PlayerID)index);
  1269 		SaveLoad_PLYR(p);
  1269 		SaveLoad_PLYR(p);
  1270 		_player_colors[index] = p->player_color;
  1270 		_player_colors[index] = p->player_color;
  1271 
  1271 
  1272 		/* This is needed so an AI is attached to a loaded AI */
  1272 		/* This is needed so an AI is attached to a loaded AI */
  1273 		if (p->is_ai && (!_networking || _network_server) && _ai.enabled)
  1273 		if (p->is_ai && (!_networking || _network_server) && _ai.enabled) {
       
  1274 			/* Clear the memory of the new AI, otherwise we might be doing wrong things. */
       
  1275 			memset(&_players_ainew[index], 0, sizeof(PlayerAiNew));
  1274 			AI_StartNewAI(p->index);
  1276 			AI_StartNewAI(p->index);
       
  1277 		}
  1275 	}
  1278 	}
  1276 }
  1279 }
  1277 
  1280 
  1278 extern const ChunkHandler _player_chunk_handlers[] = {
  1281 extern const ChunkHandler _player_chunk_handlers[] = {
  1279 	{ 'PLYR', Save_PLYR, Load_PLYR, CH_ARRAY | CH_LAST},
  1282 	{ 'PLYR', Save_PLYR, Load_PLYR, CH_ARRAY | CH_LAST},