summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-02-04 16:57:40 +0000
committerrubidium <rubidium@openttd.org>2009-02-04 16:57:40 +0000
commitb6e6be58da699065621085715445f2d6502cf27a (patch)
tree8d496172c0314b3053ddb8b378873620545af85f
parent7da743a0dc8d9e5098da2464d405a0ed93803c17 (diff)
downloadopenttd-b6e6be58da699065621085715445f2d6502cf27a.tar.xz
(svn r15337) -Fix: don't allow a spectating server to build stuff.
-rw-r--r--src/command.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 723f7f7dc..cea9162ad 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -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 */
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;
_docommand_recursive = 1;