diff options
author | Darkvater <darkvater@openttd.org> | 2005-09-14 18:03:38 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2005-09-14 18:03:38 +0000 |
commit | 2131f68ae2c65799f2ce82ee84c7022264efa469 (patch) | |
tree | 1c4620d5f83933db927ef94bd8a085442eaca0c1 /command.c | |
parent | 1bf06d7da4043d007d8a174b2187153bc818bf83 (diff) | |
download | openttd-2131f68ae2c65799f2ce82ee84c7022264efa469.tar.xz |
(svn r2951) - Fix: [ 1259345 ] Changing engine in netgame opens train window for everyone
- Add IsLocalPlayer() which substitutes _local_player == _current_player
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -460,7 +460,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, _docommand_recursive = 1; // cost estimation only? - if (_shift_pressed && _current_player == _local_player && !(cmd & (CMD_NETWORK_COMMAND | CMD_SHOW_NO_ERROR))) { + if (_shift_pressed && IsLocalPlayer() && !(cmd & (CMD_NETWORK_COMMAND | CMD_SHOW_NO_ERROR))) { // estimate the cost. res = proc(x, y, flags, p1, p2); if (CmdFailed(res)) { @@ -525,7 +525,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, SubtractMoneyFromPlayer(res2); - if (_current_player == _local_player && _game_mode != GM_EDITOR) { + if (IsLocalPlayer() && _game_mode != GM_EDITOR) { if (res2 != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2); if (_additional_cash_required) { @@ -543,7 +543,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, show_error: // show error message if the command fails? - if (_current_player == _local_player && _error_message_2 != 0) + if (IsLocalPlayer() && _error_message_2 != 0) ShowErrorMessage(_error_message, _error_message_2, x,y); callb_err: |