summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-26 21:24:11 +0000
committerrubidium <rubidium@openttd.org>2009-05-26 21:24:11 +0000
commit5b92584c402b70a04b8250c14f71fa01e271dafb (patch)
treee485eb083d370400785161ec9e62022895452066
parentfd9bbdc54ae68312bc387e71f294d0608a2d62ae (diff)
downloadopenttd-5b92584c402b70a04b8250c14f71fa01e271dafb.tar.xz
(svn r16436) -Codechange: always execute 'spectator'/'server' commands as spectator. This to reduce the difference between dedicated and non-dedicated servers and normal clients.
-rw-r--r--src/command.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 1915c5561..abc87daba 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -520,6 +520,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;
+ /* Always execute server and spectator commands as spectator */
+ if (cmd_flags & (CMD_SPECTATOR | CMD_SERVER)) _current_company = COMPANY_SPECTATOR;
+
/* If the company isn't valid it may only do server command or start a new company!
* The server will ditch any server commands a client sends to it, so effectively
* this guards the server from executing functions for an invalid company. */