Ver código fonte

Throw an exception if empty zone is generated

nordsoft 3 anos atrás
pai
commit
5d1b5b6c9c
1 arquivos alterados com 5 adições e 0 exclusões
  1. 5 0
      lib/rmg/CZonePlacer.cpp

+ 5 - 0
lib/rmg/CZonePlacer.cpp

@@ -529,7 +529,12 @@ void CZonePlacer::assignZones(CRandomGenerator * rand)
 	}
 
 	for (auto zone : zones)
+	{
+		if(zone.second->area().empty())
+			throw rmgException("Empty zone is generated, probably RMG template is inappropriate for map size");
+		
 		moveZoneToCenterOfMass(zone.second);
+	}
 
 	//assign actual tiles to each zone using nonlinear norm for fine edges