summaryrefslogtreecommitdiff
path: root/player.h
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-10-14 15:15:56 +0000
committerDarkvater <Darkvater@openttd.org>2006-10-14 15:15:56 +0000
commit68c0320be653cf4d966cb0e15532264db304f438 (patch)
tree2149ebda4f454f9dd52f174d0062275bb83fd28f /player.h
parent0da1dc314b2fc38a54c0c77e80a268233314ee7b (diff)
downloadopenttd-68c0320be653cf4d966cb0e15532264db304f438.tar.xz
(svn r6771) -Codechange: Replace two macros with functions. IS_HUMAN_PLAYER and
IS_INTERACTIVE_PLAYER
Diffstat (limited to 'player.h')
-rw-r--r--player.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/player.h b/player.h
index 384afe4c4..444971604 100644
--- a/player.h
+++ b/player.h
@@ -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.