mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-06 22:37:22 +00:00
(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)
This commit is contained in:
parent
b36298e8a1
commit
6230f9b922
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user