summaryrefslogtreecommitdiff
path: root/src/economy.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-10 22:05:01 +0000
committersmatz <smatz@openttd.org>2009-06-10 22:05:01 +0000
commitbea3fe2b8b2352d471149a4c914f93c58aa11b83 (patch)
tree69bd9a4b24333a7da3f2f3d11af4aafff5c92583 /src/economy.cpp
parentbc7e9514d247581e085b80a71dabbd6e635e5ded (diff)
downloadopenttd-bea3fe2b8b2352d471149a4c914f93c58aa11b83.tar.xz
(svn r16559) -Codechange: introduce Company::IsValidAiID() and Company::IsValidHumanID(), don't use IsHumanCompany() where possible
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index dd925a380..194cc97d8 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -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);