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

- fixed bug when generating random map and adding player info data

This commit is contained in:
beegee1 2014-05-29 17:34:46 +02:00
parent 40ab89e179
commit 72b2e1b8fe

View File

@ -133,7 +133,8 @@ void CMapGenerator::addPlayerInfo()
{
player.canHumanPlay = true;
}
auto itTeam = std::next(teamNumbers[j].begin(), rand.nextInt (teamNumbers[j].size()));
auto itTeam = RandomGeneratorUtil::nextItem(teamNumbers[j], rand);
player.team = TeamID(*itTeam);
teamNumbers[j].erase(itTeam);
map->players[pSettings.getColor().getNum()] = player;
@ -215,4 +216,4 @@ void CMapGenerator::addHeaderInfo()
std::map<TRmgTemplateZoneId, CRmgTemplateZone*> CMapGenerator::getZones() const
{
return zones;
}
}