Procházet zdrojové kódy

More random paths within zones.

DjWarmonger před 11 roky
rodič
revize
f7882135e6
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5 1
      lib/rmg/CRmgTemplateZone.cpp

+ 5 - 1
lib/rmg/CRmgTemplateZone.cpp

@@ -429,7 +429,11 @@ void CRmgTemplateZone::fractalize(CMapGenerator* gen)
 
 	while (possibleTiles.size())
 	{
-		for (auto tileToMakePath : possibleTiles)
+		//link tiles in random order
+		std::vector<int3> tilesToMakePath(possibleTiles.begin(), possibleTiles.end());
+		RandomGeneratorUtil::randomShuffle(tilesToMakePath, gen->rand);
+
+		for (auto tileToMakePath : tilesToMakePath)
 		{
 			//find closest free tile
 			float currentDistance = 1e10;