1
0
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:
Ivan Savenko
2023-08-27 01:35:38 +03:00
parent 3b06abd0d7
commit ce20d913e0
25 changed files with 55 additions and 49 deletions

View File

@@ -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;