forked from mirror/OpenTTD
(svn r2271) CMD_SET_PLAYER_FACE, CMD_SET_PLAYER_COLOR, CMD_INCREASE_LOAN, CMD_DECREASE_LOAN only make sense for the current player, so don't explicitly pass a player number
This commit is contained in:
8
player.h
8
player.h
@@ -192,12 +192,18 @@ int64 CalculateCompanyValue(Player *p);
|
||||
void InvalidatePlayerWindows(Player *p);
|
||||
void AiDoGameLoop(Player *p);
|
||||
void UpdatePlayerMoney32(Player *p);
|
||||
#define DEREF_PLAYER(i) (&_players[i])
|
||||
#define FOR_ALL_PLAYERS(p) for(p=_players; p != endof(_players); p++)
|
||||
|
||||
#define MAX_PLAYERS 8
|
||||
VARDEF Player _players[MAX_PLAYERS];
|
||||
|
||||
#define DEREF_PLAYER(i) (GetPlayer(i))
|
||||
static inline Player* GetPlayer(uint i)
|
||||
{
|
||||
assert(i < lengthof(_players));
|
||||
return &_players[i];
|
||||
}
|
||||
|
||||
#define IS_HUMAN_PLAYER(p) (!DEREF_PLAYER((byte)(p))->is_ai)
|
||||
#define IS_INTERACTIVE_PLAYER(p) (((byte)p) == _local_player)
|
||||
|
||||
|
Reference in New Issue
Block a user