mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fix checking PlayerColor's for validness
This commit is contained in:
@@ -203,7 +203,7 @@ PlayerInfo & LobbyInfo::getPlayerInfo(int color)
|
||||
|
||||
TeamID LobbyInfo::getPlayerTeamId(const PlayerColor & color)
|
||||
{
|
||||
if(color < PlayerColor::PLAYER_LIMIT)
|
||||
if(color.isValidPlayer())
|
||||
return getPlayerInfo(color.getNum()).team;
|
||||
else
|
||||
return TeamID::NO_TEAM;
|
||||
|
||||
Reference in New Issue
Block a user