(svn r16559) -Codechange: introduce Company::IsValidAiID() and Company::IsValidHumanID(), don't use IsHumanCompany() where possible
This commit is contained in:
@@ -487,7 +487,7 @@ static void CompanyCheckBankrupt(Company *c)
|
||||
case 3: {
|
||||
/* XXX - In multiplayer, should we ask other companies if it wants to take
|
||||
over when it is a human company? -- TrueLight */
|
||||
if (IsHumanCompany(c->index)) {
|
||||
if (!c->is_ai) {
|
||||
SetDParam(0, STR_NEWS_COMPANY_IN_TROUBLE_TITLE);
|
||||
SetDParam(1, STR_NEWS_COMPANY_IN_TROUBLE_DESCRIPTION);
|
||||
SetDParamStr(2, cni->company_name);
|
||||
@@ -532,7 +532,7 @@ static void CompanyCheckBankrupt(Company *c)
|
||||
ChangeNetworkOwner(c->index, COMPANY_SPECTATOR);
|
||||
ChangeOwnershipOfCompanyItems(c->index, INVALID_OWNER);
|
||||
|
||||
if (!IsHumanCompany(c->index)) AI::Stop(c->index);
|
||||
if (c->is_ai) AI::Stop(c->index);
|
||||
|
||||
CompanyID c_index = c->index;
|
||||
delete c;
|
||||
@@ -1528,7 +1528,7 @@ static void DoAcquireCompany(Company *c)
|
||||
}
|
||||
_current_company = old_company;
|
||||
|
||||
if (!IsHumanCompany(c->index)) AI::Stop(c->index);
|
||||
if (c->is_ai) AI::Stop(c->index);
|
||||
|
||||
DeleteCompanyWindows(ci);
|
||||
InvalidateWindowClassesData(WC_TRAINS_LIST, 0);
|
||||
|
Reference in New Issue
Block a user