summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorKUDr <KUDr@openttd.org>2007-01-18 23:45:58 +0000
committerKUDr <KUDr@openttd.org>2007-01-18 23:45:58 +0000
commitb42940f1dbd8879be1df7b841ff9b05072df77db (patch)
tree3302c84de49a0fa42593d0968df7e44ce8f27d75 /src/player.h
parentdcadc6c74330fa6b5dbe791cc5d63e7ea1753c9b (diff)
downloadopenttd-b42940f1dbd8879be1df7b841ff9b05072df77db.tar.xz
(svn r8272) -Fix (r8038): signed/unsigned change - PlayerID is now enum (signed) and was byte so test for PlayerID validity needed to be updated (Darkvater)
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/player.h b/src/player.h
index e3329c0d1..1f91f58de 100644
--- a/src/player.h
+++ b/src/player.h
@@ -230,7 +230,7 @@ static inline byte ActivePlayerCount(void)
static inline Player* GetPlayer(PlayerID i)
{
- assert(i < (PlayerID)lengthof(_players));
+ assert(IS_INSIDE_1D(i, PLAYER_FIRST, lengthof(_players)));
return &_players[i];
}
@@ -241,7 +241,7 @@ static inline bool IsLocalPlayer(void)
static inline bool IsValidPlayer(PlayerID pi)
{
- return pi < MAX_PLAYERS;
+ return IS_INSIDE_1D(pi, PLAYER_FIRST, MAX_PLAYERS);
}
byte GetPlayerRailtypes(PlayerID p);