From 2d3b8ee866c7732d8b2caf941c3386937f0c2bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zieli=C5=84ski?= Date: Tue, 12 Dec 2023 12:50:27 +0100 Subject: [PATCH] Increased amount of generated treasure piles without increasing density --- lib/rmg/modificators/TreasurePlacer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rmg/modificators/TreasurePlacer.cpp b/lib/rmg/modificators/TreasurePlacer.cpp index 8adbcb1ac..cd2099db7 100644 --- a/lib/rmg/modificators/TreasurePlacer.cpp +++ b/lib/rmg/modificators/TreasurePlacer.cpp @@ -808,16 +808,17 @@ void TreasurePlacer::createTreasures(ObjectManager& manager) totalDensity += t->density; - size_t count = size * t->density / 500; + const int DENSITY_CONSTANT = 400; + size_t count = (size * t->density) / DENSITY_CONSTANT; //Assure space for lesser treasures, if there are any left + const int averageValue = (t->min + t->max) / 2; if (t != (treasureInfo.end() - 1)) { - const int averageValue = (t->min + t->max) / 2; if (averageValue > 10000) { //Will surely be guarded => larger piles => less space inbetween - vstd::amin(count, size * (10.f / 500) / (std::sqrt((float)averageValue / 10000))); + vstd::amin(count, size * (10.f / DENSITY_CONSTANT) / (std::sqrt((float)averageValue / 10000))); } }