1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 12:39:11 +00:00

(svn r16176) -Fix: forbid joining AI companies via the 'move' and 'join' console commands.

This commit is contained in:
yexo
2009-04-26 20:01:14 +00:00
parent c8ce3f7ef0
commit 52b95bdc96
2 changed files with 12 additions and 0 deletions

View File

@@ -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)) {