diff options
author | smatz <smatz@openttd.org> | 2009-06-23 12:11:35 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-06-23 12:11:35 +0000 |
commit | 22cf8d8480b1a7e1627590ba2c48ab5019764910 (patch) | |
tree | 3e214ab81c40d56ef452fa5af33712e0be087fba /src/console_cmds.cpp | |
parent | 192b9bda7b7405e2f71b1847430b744a67b923ef (diff) | |
download | openttd-22cf8d8480b1a7e1627590ba2c48ab5019764910.tar.xz |
(svn r16634) -Codechange: use Company::IsHumanID() instead of IsHumanCompany()
Diffstat (limited to 'src/console_cmds.cpp')
-rw-r--r-- | src/console_cmds.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 787d0c647..7922248d0 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -666,7 +666,7 @@ DEF_CONSOLE_CMD(ConJoinCompany) return true; } - if (company_id != COMPANY_SPECTATOR && Company::Get(company_id)->is_ai) { + if (company_id != COMPANY_SPECTATOR && !Company::IsHumanID(company_id)) { IConsoleError("Cannot join AI company."); return true; } @@ -709,7 +709,7 @@ DEF_CONSOLE_CMD(ConMoveClient) return true; } - if (company_id != COMPANY_SPECTATOR && Company::Get(company_id)->is_ai) { + if (company_id != COMPANY_SPECTATOR && !Company::IsHumanID(company_id)) { IConsoleError("You cannot move clients to AI companies."); return true; } @@ -741,15 +741,14 @@ DEF_CONSOLE_CMD(ConResetCompany) if (argc != 2) return false; CompanyID index = (CompanyID)(atoi(argv[1]) - 1); - const Company *c = Company::GetIfValid(index); /* Check valid range */ - if (c == NULL) { + if (!Company::IsValidID(index)) { IConsolePrintF(CC_ERROR, "Company does not exist. Company-id must be between 1 and %d.", MAX_COMPANIES); return true; } - if (c->is_ai) { + if (!Company::IsHumanID(index)) { IConsoleError("Company is owned by an AI."); return true; } @@ -1064,7 +1063,7 @@ DEF_CONSOLE_CMD(ConReloadAI) return true; } - if (IsHumanCompany(company_id)) { + if (Company::IsHumanID(company_id)) { IConsoleWarning("Company is not controlled by an AI."); return true; } @@ -1101,7 +1100,7 @@ DEF_CONSOLE_CMD(ConStopAI) return true; } - if (IsHumanCompany(company_id)) { + if (Company::IsHumanID(company_id)) { IConsoleWarning("Company is not controlled by an AI."); return true; } |