summaryrefslogtreecommitdiff
path: root/player.h
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2006-10-14 22:31:18 +0000
committerDarkvater <Darkvater@openttd.org>2006-10-14 22:31:18 +0000
commit4c9d9a87f18191ae9ae4368176c96b89dd172c8f (patch)
tree52f21281bd10b45ef340a15357a04bf130b9b554 /player.h
parent2380bb56cd4a25eef126153bb6b5ccde8222fc5c (diff)
downloadopenttd-4c9d9a87f18191ae9ae4368176c96b89dd172c8f.tar.xz
(svn r6776) -Codechange: Use IsValidPlayer() function to determine of a PlayerID is an
actual playable player (< MAX_PLAYERS) or not.
Diffstat (limited to 'player.h')
-rw-r--r--player.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/player.h b/player.h
index 229d996c9..0b17c3d4b 100644
--- a/player.h
+++ b/player.h
@@ -245,6 +245,11 @@ static inline bool IsLocalPlayer(void)
return _local_player == _current_player;
}
+static inline bool IsValidPlayer(PlayerID pi)
+{
+ return pi < MAX_PLAYERS;
+}
+
void DeletePlayerWindows(PlayerID pi);
byte GetPlayerRailtypes(PlayerID p);