From 2220786d0c29b027b74a789bebbecbdc554d1a44 Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Tue, 29 Jul 2014 19:05:35 +0200 Subject: [PATCH] Finally placing objects sparsely. --- lib/rmg/CRmgTemplateZone.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rmg/CRmgTemplateZone.cpp b/lib/rmg/CRmgTemplateZone.cpp index 42da6f1a1..1108bf561 100644 --- a/lib/rmg/CRmgTemplateZone.cpp +++ b/lib/rmg/CRmgTemplateZone.cpp @@ -1082,7 +1082,8 @@ bool CRmgTemplateZone::createRequiredObjects(CMapGenerator* gen) void CRmgTemplateZone::createTreasures(CMapGenerator* gen) { - const double minDistance = std::max(20.f / sqrt(totalDensity), 2); + //this is squared distance for optimization purposes + const double minDistance = std::max(200.f / totalDensity, 4); //distance lower than 2 causes objects to overlap and crash do {