summaryrefslogtreecommitdiff
path: root/src/company_cmd.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/company_cmd.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/company_cmd.cpp')
-rw-r--r--src/company_cmd.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 58ff40a97..777a00bc7 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -83,12 +83,6 @@ void SetLocalCompany(CompanyID new_company)
MarkWholeScreenDirty();
}
-bool IsHumanCompany(CompanyID company)
-{
- return !Company::Get(company)->is_ai;
-}
-
-
uint16 GetDrawStringCompanyColour(CompanyID company)
{
/* Get the colour for DrawString-subroutines which matches the colour
@@ -276,7 +270,7 @@ set_name:;
MarkWholeScreenDirty();
- if (!IsHumanCompany(c->index)) {
+ if (c->is_ai) {
CompanyNewsInformation *cni = MallocT<CompanyNewsInformation>(1);
cni->FillData(c);
SetDParam(0, STR_NEWS_COMPANY_LAUNCH_TITLE);
@@ -725,7 +719,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
/* Remove the company */
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;