mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Don't scale distance of large treasures beyond 30K value
This commit is contained in:
parent
433765714f
commit
0c0a1bd777
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user