summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-10 20:59:41 +0000
committerrubidium <rubidium@openttd.org>2007-07-10 20:59:41 +0000
commit3ba01bec844e80e77f9f8450c1ffe414e121202a (patch)
tree2bdf5be574e91e6183f4d75b3b91d0503f43d2cb /src/command.cpp
parent5ef18e693c7a14a59bd57bbee061b0a956415851 (diff)
downloadopenttd-3ba01bec844e80e77f9f8450c1ffe414e121202a.tar.xz
(svn r10501) -Fix [FS#1015]: error dialog was sometimes shown on all clients when a command failed instead of only the client that actually did the command.
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 9c0a714ee..8216bd840 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -429,7 +429,7 @@ Money GetAvailableMoneyForCommand()
/* toplevel network safe docommand function for the current player. must not be called recursively.
* the callback is called when the command succeeded or failed. */
-bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd)
+bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback, uint32 cmd, bool my_cmd)
{
CommandCost res, res2;
CommandProc *proc;
@@ -455,7 +455,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
/** Spectator has no rights except for the (dedicated) server which
* is/can be a spectator but as the server it can do anything */
if (_current_player == PLAYER_SPECTATOR && !_network_server) {
- ShowErrorMessage(_error_message, error_part1, x, y);
+ if (my_cmd) ShowErrorMessage(_error_message, error_part1, x, y);
_cmd_text = NULL;
return false;
}
@@ -572,7 +572,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
if (res2.GetCost() != 0) ShowCostOrIncomeAnimation(x, y, GetSlopeZ(x, y), res2.GetCost());
if (_additional_cash_required != 0) {
SetDParam(0, _additional_cash_required);
- ShowErrorMessage(STR_0003_NOT_ENOUGH_CASH_REQUIRES, error_part1, x, y);
+ if (my_cmd) ShowErrorMessage(STR_0003_NOT_ENOUGH_CASH_REQUIRES, error_part1, x, y);
if (res2.GetCost() == 0) goto callb_err;
}
}
@@ -585,7 +585,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, CommandCallback *callback,
show_error:
/* show error message if the command fails? */
- if (IsLocalPlayer() && error_part1 != 0) {
+ if (IsLocalPlayer() && error_part1 != 0 && my_cmd) {
ShowErrorMessage(_error_message, error_part1, x, y);
}