mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r16436) -Codechange: always execute 'spectator'/'server' commands as spectator. This to reduce the difference between dedicated and non-dedicated servers and normal clients.
This commit is contained in:
parent
fd9bbdc54a
commit
5b92584c40
|
@ -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 */
|
/* 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;
|
||||||
|
|
||||||
|
/* 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!
|
/* 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
|
* 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. */
|
* this guards the server from executing functions for an invalid company. */
|
||||||
|
|
Loading…
Reference in New Issue