Explorar o código

Distribute objects among zones in random order

Tomasz Zieliński hai 1 ano
pai
achega
c316087950
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      lib/rmg/modificators/ObjectDistributor.cpp

+ 2 - 2
lib/rmg/modificators/ObjectDistributor.cpp

@@ -42,8 +42,6 @@ void ObjectDistributor::init()
 
 void ObjectDistributor::distributeLimitedObjects()
 {
-	//FIXME: Must be called after TerrainPainter::process()
-
 	ObjectInfo oi;
 	auto zones = map.getZones();
 
@@ -77,6 +75,8 @@ void ObjectDistributor::distributeLimitedObjects()
 
 					auto rmgInfo = handler->getRMGInfo();
 
+					// FIXME: Random order of distribution
+					RandomGeneratorUtil::randomShuffle(matchingZones, zone.getRand());
 					for (auto& zone : matchingZones)
 					{
 						oi.generateObject = [primaryID, secondaryID]() -> CGObjectInstance *