command.c
changeset 2425 99e1e8430a28
parent 2304 f3309898aeb0
child 2645 964bd8fe3ce2
--- a/command.c	Wed Sep 14 17:21:30 2005 +0000
+++ b/command.c	Wed Sep 14 18:03:38 2005 +0000
@@ -460,7 +460,7 @@
 	_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 @@
 
 	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 @@
 
 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: