diff options
author | yexo <yexo@openttd.org> | 2009-04-26 20:01:14 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-04-26 20:01:14 +0000 |
commit | 52b95bdc96c4763d1465bac0f9165bdfe55ddf1a (patch) | |
tree | bc86cbe0c55b287d1d4c4424f055c0a58a2dbaf8 /src/console_cmds.cpp | |
parent | c8ce3f7ef03352aba223f235ca9db5800a3f9a1b (diff) | |
download | openttd-52b95bdc96c4763d1465bac0f9165bdfe55ddf1a.tar.xz |
(svn r16176) -Fix: forbid joining AI companies via the 'move' and 'join' console commands.
Diffstat (limited to 'src/console_cmds.cpp')
-rw-r--r-- | src/console_cmds.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index ac418c583..ced66db8b 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -636,6 +636,11 @@ DEF_CONSOLE_CMD(ConJoinCompany) return true; } + if (company_id != COMPANY_SPECTATOR && GetCompany(company_id)->is_ai) { + IConsoleError("Cannot join AI company."); + return true; + } + /* Check if the company requires a password */ if (NetworkCompanyIsPassworded(company_id) && argc < 3) { IConsolePrintF(CC_ERROR, "Company %d requires a password to join.", company_id + 1); @@ -674,6 +679,11 @@ DEF_CONSOLE_CMD(ConMoveClient) return true; } + if (company_id != COMPANY_SPECTATOR && GetCompany(company_id)->is_ai) { + IConsoleError("You cannot move clients to AI companies."); + return true; + } + if (ci->client_id == CLIENT_ID_SERVER && _network_dedicated) { IConsoleError("Silly boy, you cannot move the server!"); return true; |