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:
parent
40ab89e179
commit
72b2e1b8fe
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user