summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-04-26 20:01:14 +0000
committeryexo <yexo@openttd.org>2009-04-26 20:01:14 +0000
commit52b95bdc96c4763d1465bac0f9165bdfe55ddf1a (patch)
treebc86cbe0c55b287d1d4c4424f055c0a58a2dbaf8 /src/network
parentc8ce3f7ef03352aba223f235ca9db5800a3f9a1b (diff)
downloadopenttd-52b95bdc96c4763d1465bac0f9165bdfe55ddf1a.tar.xz
(svn r16176) -Fix: forbid joining AI companies via the 'move' and 'join' console commands.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_server.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp
index 2e2971fa7..4597b2c71 100644
--- a/src/network/network_server.cpp
+++ b/src/network/network_server.cpp
@@ -1235,6 +1235,8 @@ DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_MOVE)
/* Check if the company is valid */
if (!IsValidCompanyID(company_id) && company_id != COMPANY_SPECTATOR) return;
+ /* We don't allow moving to AI companies */
+ if (company_id != COMPANY_SPECTATOR && GetCompany(company_id)->is_ai) return;
/* Check if we require a password for this company */
if (company_id != COMPANY_SPECTATOR && !StrEmpty(_network_company_states[company_id].password)) {