(svn r15337) -Fix: don't allow a spectating server to build stuff.

This commit is contained in:
rubidium 2009-02-04 16:57:40 +00:00
parent 7da743a0dc
commit b6e6be58da

View File

@ -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;