summaryrefslogtreecommitdiff
path: root/players.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-09-14 18:03:38 +0000
committerDarkvater <darkvater@openttd.org>2005-09-14 18:03:38 +0000
commit2131f68ae2c65799f2ce82ee84c7022264efa469 (patch)
tree1c4620d5f83933db927ef94bd8a085442eaca0c1 /players.c
parent1bf06d7da4043d007d8a174b2187153bc818bf83 (diff)
downloadopenttd-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 'players.c')
-rw-r--r--players.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/players.c b/players.c
index 770dc8650..f19ad1ebe 100644
--- a/players.c
+++ b/players.c
@@ -25,8 +25,6 @@
#include "variables.h"
#include "ai/ai.h"
-PlayerID _current_player;
-
static const SpriteID cheeks_table[4] = {
0x325, 0x326,
0x390, 0x3B0,
@@ -295,8 +293,7 @@ bool CheckTileOwnership(TileIndex tile)
_error_message = STR_013B_OWNED_BY;
// no need to get the name of the owner unless we're the local player (saves some time)
- if (_current_player == _local_player)
- GetNameOfOwner(owner, tile);
+ if (IsLocalPlayer()) GetNameOfOwner(owner, tile);
return false;
}
@@ -690,7 +687,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
p->engine_renew = (bool)GB(p2, 0, 1);
- if (_current_player == _local_player) {
+ if (IsLocalPlayer()) {
_patches.autorenew = p->engine_renew;
InvalidateWindow(WC_GAME_OPTIONS, 0);
}
@@ -702,7 +699,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
p->engine_renew_months = (int16)p2;
- if (_current_player == _local_player) {
+ if (IsLocalPlayer()) {
_patches.autorenew_months = p->engine_renew_months;
InvalidateWindow(WC_GAME_OPTIONS, 0);
}
@@ -714,7 +711,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
p->engine_renew_money = (uint32)p2;
- if (_current_player == _local_player) {
+ if (IsLocalPlayer()) {
_patches.autorenew_money = p->engine_renew_money;
InvalidateWindow(WC_GAME_OPTIONS, 0);
}
@@ -753,7 +750,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
p->engine_renew_months = (int16)GB(p1, 16, 16);
p->engine_renew_money = (uint32)p2;
- if (_current_player == _local_player) {
+ if (IsLocalPlayer()) {
_patches.autorenew = p->engine_renew;
_patches.autorenew_months = p->engine_renew_months;
_patches.autorenew_money = p->engine_renew_money;