src/player.h
changeset 5729 8f03461d5706
parent 5587 167d9a91ef02
child 5750 5824ab1f36e2
equal deleted inserted replaced
5728:a2169711cf23 5729:8f03461d5706
   228 	return count;
   228 	return count;
   229 }
   229 }
   230 
   230 
   231 static inline Player* GetPlayer(PlayerID i)
   231 static inline Player* GetPlayer(PlayerID i)
   232 {
   232 {
   233 	assert(i < (PlayerID)lengthof(_players));
   233 	assert(IS_INSIDE_1D(i, PLAYER_FIRST, lengthof(_players)));
   234 	return &_players[i];
   234 	return &_players[i];
   235 }
   235 }
   236 
   236 
   237 static inline bool IsLocalPlayer(void)
   237 static inline bool IsLocalPlayer(void)
   238 {
   238 {
   239 	return _local_player == _current_player;
   239 	return _local_player == _current_player;
   240 }
   240 }
   241 
   241 
   242 static inline bool IsValidPlayer(PlayerID pi)
   242 static inline bool IsValidPlayer(PlayerID pi)
   243 {
   243 {
   244 	return pi < MAX_PLAYERS;
   244 	return IS_INSIDE_1D(pi, PLAYER_FIRST, MAX_PLAYERS);
   245 }
   245 }
   246 
   246 
   247 byte GetPlayerRailtypes(PlayerID p);
   247 byte GetPlayerRailtypes(PlayerID p);
   248 
   248 
   249 /** Finds out if a Player has a certain railtype available */
   249 /** Finds out if a Player has a certain railtype available */