(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:
tron
2005-05-06 06:56:30 +00:00
parent 203a84dd0b
commit d17476b058
5 changed files with 21 additions and 24 deletions

View File

@@ -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)