Browse Source

Don't scale distance of large treasures beyond 30K value

Tomasz Zieliński 1 year ago
parent
commit
0c0a1bd777
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/rmg/modificators/TreasurePlacer.cpp

+ 1 - 1
lib/rmg/modificators/TreasurePlacer.cpp

@@ -875,7 +875,7 @@ void TreasurePlacer::createTreasures(ObjectManager& manager)
 		const int DENSITY_CONSTANT = 400;
 		size_t count = (size * t->density) / DENSITY_CONSTANT;
 
-		const float minDistance = std::max<float>(std::sqrt(t->min / 10.0f / totalDensity), 1.0f);
+		const float minDistance = std::max<float>(std::sqrt(std::min<ui32>(t->min, 30000) / 10.0f / totalDensity), 1.0f);
 
 		size_t emergencyLoopFinish = 0;
 		while(treasures.size() < count && emergencyLoopFinish < count)