src/players.cpp
branchnoai
changeset 10358 73d8177db39e
parent 10355 ee4b5f7a5bf2
child 10455 22c441f5adf9
equal deleted inserted replaced
10355:ee4b5f7a5bf2 10358:73d8177db39e
   335 
   335 
   336 		if (!IsHumanPlayer(p->index)) {
   336 		if (!IsHumanPlayer(p->index)) {
   337 			SetDParam(0, t->index);
   337 			SetDParam(0, t->index);
   338 			AddNewsItem((StringID)(p->index | NB_BNEWCOMPANY), NM_CALLBACK, NF_TILE, NT_COMPANY_INFO, DNC_BANKRUPCY, p->last_build_coordinate, 0);
   338 			AddNewsItem((StringID)(p->index | NB_BNEWCOMPANY), NM_CALLBACK, NF_TILE, NT_COMPANY_INFO, DNC_BANKRUPCY, p->last_build_coordinate, 0);
   339 		}
   339 		}
       
   340 		for (PlayerID i = PLAYER_FIRST; i < MAX_PLAYERS; i++) {
       
   341 			if (i != p->index) AI_Event(i, new AIEventCompanyNew(p->index));
       
   342 		}
   340 		return;
   343 		return;
   341 	}
   344 	}
   342 bad_town_name:;
   345 bad_town_name:;
   343 
   346 
   344 	if (p->president_name_1 == SPECSTR_PRESIDENT_NAME) {
   347 	if (p->president_name_1 == SPECSTR_PRESIDENT_NAME) {
   911 		/* Remove the company */
   914 		/* Remove the company */
   912 		ChangeOwnershipOfPlayerItems(p->index, PLAYER_SPECTATOR);
   915 		ChangeOwnershipOfPlayerItems(p->index, PLAYER_SPECTATOR);
   913 		p->is_active = false;
   916 		p->is_active = false;
   914 		if (!IsHumanPlayer(p->index)) AI_PlayerDied(p->index);
   917 		if (!IsHumanPlayer(p->index)) AI_PlayerDied(p->index);
   915 
   918 
       
   919 		for (PlayerID i = PLAYER_FIRST; i < MAX_PLAYERS; i++) {
       
   920 			AI_Event(i, new AIEventCompanyBankrupt(p->index));
       
   921 		}
       
   922 
   916 		RemoveAllEngineReplacementForPlayer(p);
   923 		RemoveAllEngineReplacementForPlayer(p);
   917 		RemoveAllGroupsForPlayer(p->index);
   924 		RemoveAllGroupsForPlayer(p->index);
   918 
   925 
   919 	} break;
   926 	} break;
   920 
   927