(svn r6771) -Codechange: Replace two macros with functions. IS_HUMAN_PLAYER and

IS_INTERACTIVE_PLAYER
This commit is contained in:
Darkvater
2006-10-14 15:15:56 +00:00
parent 0da1dc314b
commit 68c0320be6
12 changed files with 39 additions and 32 deletions

View File

@@ -248,6 +248,16 @@ static inline bool HasRailtypeAvail(const Player *p, RailType Railtype)
return HASBIT(p->avail_railtypes, Railtype);
}
static inline bool IsHumanPlayer(PlayerID pi)
{
return !GetPlayer(pi)->is_ai;
}
static inline bool IsInteractivePlayer(PlayerID pi)
{
return pi == _local_player;
}
/* Validate functions for rail building */
static inline bool ValParamRailtype(uint32 rail) { return HASBIT(GetPlayer(_current_player)->avail_railtypes, rail);}
@@ -265,9 +275,6 @@ static inline RailType GetBestRailtype(const Player* p)
return RAILTYPE_RAIL;
}
#define IS_HUMAN_PLAYER(p) (!GetPlayer(p)->is_ai)
#define IS_INTERACTIVE_PLAYER(p) ((p) == _local_player)
typedef struct HighScore {
char company[100];
StringID title; // NO_SAVE, has troubles with changing string-numbers.