1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Rolled back some incorrect values.

This commit is contained in:
DjWarmonger 2014-05-23 09:22:22 +02:00
parent 67793a2db4
commit eae7e5c51f
2 changed files with 6 additions and 6 deletions

View File

@ -194,7 +194,7 @@ void CMapGenOptions::finalize(CRandomGenerator & rand)
auto possiblePlayers = mapTemplate->getPlayers().getNumbers();
possiblePlayers.erase(possiblePlayers.begin(), possiblePlayers.lower_bound(countHumanPlayers()));
assert(!possiblePlayers.empty());
playerCount = rand.nextInt(possiblePlayers.size());
playerCount = *RandomGeneratorUtil::nextItem(possiblePlayers, rand);
updatePlayers();
}
if(teamCount == RANDOM_SIZE)
@ -204,7 +204,7 @@ void CMapGenOptions::finalize(CRandomGenerator & rand)
if(compOnlyPlayerCount == RANDOM_SIZE)
{
auto possiblePlayers = mapTemplate->getCpuPlayers().getNumbers();
compOnlyPlayerCount = rand.nextInt(possiblePlayers.size());
compOnlyPlayerCount = *RandomGeneratorUtil::nextItem(possiblePlayers, rand);
updateCompOnlyPlayers();
}
if(compOnlyTeamCount == RANDOM_SIZE)
@ -220,11 +220,11 @@ void CMapGenOptions::finalize(CRandomGenerator & rand)
if(waterContent == EWaterContent::RANDOM)
{
waterContent = static_cast<EWaterContent::EWaterContent>(rand.nextInt(EWaterContent::TOTAL_COUNT));
waterContent = static_cast<EWaterContent::EWaterContent>(rand.nextInt(EWaterContent::LAST_ITEM));
}
if(monsterStrength == EMonsterStrength::RANDOM)
{
monsterStrength = static_cast<EMonsterStrength::EMonsterStrength>(rand.nextInt(EMonsterStrength::TOTAL_COUNT));
monsterStrength = static_cast<EMonsterStrength::EMonsterStrength>(rand.nextInt(EMonsterStrength::LAST_ITEM));
}
}

View File

@ -24,7 +24,7 @@ namespace EWaterContent
NONE,
NORMAL,
ISLANDS,
TOTAL_COUNT
LAST_ITEM = ISLANDS
};
}
@ -36,7 +36,7 @@ namespace EMonsterStrength
WEAK,
NORMAL,
STRONG,
TOTAL_COUNT
LAST_ITEM = STRONG
};
}