diff --git a/lib/rmg/CMapGenerator.cpp b/lib/rmg/CMapGenerator.cpp index 017aad6d9..0ea3c582f 100644 --- a/lib/rmg/CMapGenerator.cpp +++ b/lib/rmg/CMapGenerator.cpp @@ -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 CMapGenerator::getZones() const { return zones; -} \ No newline at end of file +}