mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	- fixed bug when generating random map and adding player info data
This commit is contained in:
		| @@ -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; | ||||
| } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user