1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Finally placing objects sparsely.

This commit is contained in:
DjWarmonger 2014-07-29 19:05:35 +02:00
parent 930fa21d38
commit 2220786d0c

View File

@ -1082,7 +1082,8 @@ bool CRmgTemplateZone::createRequiredObjects(CMapGenerator* gen)
void CRmgTemplateZone::createTreasures(CMapGenerator* gen)
{
const double minDistance = std::max<float>(20.f / sqrt(totalDensity), 2);
//this is squared distance for optimization purposes
const double minDistance = std::max<float>(200.f / totalDensity, 4);
//distance lower than 2 causes objects to overlap and crash
do {