changeset 10997:0692d0966f52 draft

(svn r15337) -Fix: don't allow a spectating server to build stuff.
author rubidium <rubidium@openttd.org>
date Wed, 04 Feb 2009 16:57:40 +0000
parents ce54bfd52120
children a1d256bf72e0
files src/command.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -523,6 +523,9 @@
 	/* 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;