summaryrefslogtreecommitdiff
path: root/command.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-05-17 18:22:59 +0000
committerDarkvater <Darkvater@openttd.org>2005-05-17 18:22:59 +0000
commit59c9fee33fbd56c16140e668463a9a7f88fd338d (patch)
tree9cbf8e97114b80319c5284dc86f0db95d2174b1a /command.c
parent5fc05c681a398a65430d2d191f0fcf3dee9383ea (diff)
downloadopenttd-59c9fee33fbd56c16140e668463a9a7f88fd338d.tar.xz
(svn r2339) - Fix: on a dedicated server, after the joining of a player, the player was set to player 0 instead of remaining OWNER_SPECTATOR. Fix this, and allow the dedicated server to execute commands (so 'patch <value>') now works and not only when a client is connected.
Diffstat (limited to 'command.c')
-rw-r--r--command.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/command.c b/command.c
index 24f6817e1..44cb446d1 100644
--- a/command.c
+++ b/command.c
@@ -413,8 +413,9 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
_error_message_2 = cmd >> 16;
_additional_cash_required = 0;
- // spectator has no rights.
- if (_current_player == OWNER_SPECTATOR) {
+ /** Spectator has no rights except for the dedicated server which
+ * is a spectator but is the server, so can do anything */
+ if (_current_player == OWNER_SPECTATOR && !_network_dedicated) {
ShowErrorMessage(_error_message, _error_message_2, x, y);
_cmd_text = NULL;
return false;