1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fix infinite loop

This commit is contained in:
Tomasz Zieliński
2023-10-30 19:47:59 +01:00
parent ec0bf05163
commit 5962e5c0e0

View File

@@ -535,7 +535,14 @@ void CMapGenOptions::finalize(CRandomGenerator & rand)
{
return i > (maxPlayers - presentPlayers);
});
compOnlyPlayerCount = *RandomGeneratorUtil::nextItem(possiblePlayers, rand);
if (possiblePlayers.empty())
{
compOnlyPlayerCount = 0;
}
else
{
compOnlyPlayerCount = *RandomGeneratorUtil::nextItem(possiblePlayers, rand);
}
updateCompOnlyPlayers();
}
if(compOnlyTeamCount == RANDOM_SIZE)