1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

vcmi: fix map format for teams number

This commit is contained in:
Konstantin 2023-03-01 17:05:13 +03:00 committed by Konstantin P
parent d31a3362af
commit bcf8ca1268

View File

@ -595,9 +595,9 @@ void CMapFormatJson::readTeams(JsonDeserializer & handler)
logGlobal->error("Invalid teams field type");
mapHeader->howManyTeams = 0;
for(int i = 0; i < PlayerColor::PLAYER_LIMIT_I; i++)
if(mapHeader->players[i].canComputerPlay || mapHeader->players[i].canHumanPlay)
mapHeader->players[i].team = TeamID(mapHeader->howManyTeams++);
for(auto & player : mapHeader->players)
if(player.canAnyonePlay())
player.team = TeamID(mapHeader->howManyTeams++);
}
else
{