(svn r2951) - Fix: [ 1259345 ] Changing engine in netgame opens train window for everyone

- Add IsLocalPlayer() which substitutes _local_player == _current_player
This commit is contained in:
Darkvater
2005-09-14 18:03:38 +00:00
parent 1bf06d7da4
commit 2131f68ae2
12 changed files with 26 additions and 28 deletions

View File

@@ -201,7 +201,8 @@ void AiDoGameLoop(Player *p);
void UpdatePlayerMoney32(Player *p);
#define FOR_ALL_PLAYERS(p) for(p=_players; p != endof(_players); p++)
extern PlayerID _current_player;
VARDEF PlayerID _local_player;
VARDEF PlayerID _current_player;
#define MAX_PLAYERS 8
VARDEF Player _players[MAX_PLAYERS];
@@ -210,8 +211,13 @@ VARDEF byte _player_colors[MAX_PLAYERS];
static inline Player* GetPlayer(uint i)
{
assert(i < lengthof(_players));
return &_players[i];
assert(i < lengthof(_players));
return &_players[i];
}
static inline bool IsLocalPlayer(void)
{
return _local_player == _current_player;
}
/** Returns the number of rail types the player can build