mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r15337) -Fix: don't allow a spectating server to build stuff.
This commit is contained in:
parent
7da743a0dc
commit
b6e6be58da
@ -523,6 +523,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
|
|||||||
/* Do not even think about executing out-of-bounds tile-commands */
|
/* Do not even think about executing out-of-bounds tile-commands */
|
||||||
if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return false;
|
if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return false;
|
||||||
|
|
||||||
|
/* If the server is a spectator, it may only do server commands! */
|
||||||
|
if (_current_company == COMPANY_SPECTATOR && (cmd_flags & CMD_SERVER) == 0) return false;
|
||||||
|
|
||||||
bool notest = (cmd_flags & CMD_NO_TEST) != 0;
|
bool notest = (cmd_flags & CMD_NO_TEST) != 0;
|
||||||
|
|
||||||
_docommand_recursive = 1;
|
_docommand_recursive = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user