mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-27 22:49:25 +02:00
Fix infinite loop
This commit is contained in:
@@ -535,7 +535,14 @@ void CMapGenOptions::finalize(CRandomGenerator & rand)
|
|||||||
{
|
{
|
||||||
return i > (maxPlayers - presentPlayers);
|
return i > (maxPlayers - presentPlayers);
|
||||||
});
|
});
|
||||||
|
if (possiblePlayers.empty())
|
||||||
|
{
|
||||||
|
compOnlyPlayerCount = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
compOnlyPlayerCount = *RandomGeneratorUtil::nextItem(possiblePlayers, rand);
|
compOnlyPlayerCount = *RandomGeneratorUtil::nextItem(possiblePlayers, rand);
|
||||||
|
}
|
||||||
updateCompOnlyPlayers();
|
updateCompOnlyPlayers();
|
||||||
}
|
}
|
||||||
if(compOnlyTeamCount == RANDOM_SIZE)
|
if(compOnlyTeamCount == RANDOM_SIZE)
|
||||||
|
|||||||
Reference in New Issue
Block a user