1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Sonarcloud fixes

This commit is contained in:
Tomasz Zieliński 2024-03-20 13:51:16 +01:00
parent 68cdcb893e
commit 02fc410a98
2 changed files with 3 additions and 7 deletions

View File

@ -239,7 +239,6 @@ void Zone::fractalize()
//Squared
float minDistance = 9 * 9;
//float freeDistance = pos.z ? (10 * 10) : 6 * 6;
float freeDistance = pos.z ? (10 * 10) : (9 * 9);
float spanFactor = (pos.z ? 0.3f : 0.45f); //Narrower passages in the Underground
float marginFactor = 1.0f;

View File

@ -875,9 +875,7 @@ void TreasurePlacer::createTreasures(ObjectManager& manager)
const int DENSITY_CONSTANT = 400;
size_t count = (size * t->density) / DENSITY_CONSTANT;
const int averageValue = (t->min + t->max) / 2;
const float minDistance = std::max<float>(std::sqrt((float)t->min / 10 / totalDensity), 1.0f);
const float minDistance = std::max<float>(std::sqrt(t->min / 10.0f / totalDensity), 1.0f);
size_t emergencyLoopFinish = 0;
while(treasures.size() < count && emergencyLoopFinish < count)
@ -961,8 +959,7 @@ void TreasurePlacer::createTreasures(ObjectManager& manager)
if (path.valid())
{
/*
//debug purposes
#ifdef TREASURE_PLACER_LOG
treasureArea.unite(rmgObject.getArea());
if (guarded)
{
@ -971,7 +968,7 @@ void TreasurePlacer::createTreasures(ObjectManager& manager)
auto areaToBlock = rmgObject.getAccessibleArea(true) - guardedArea;
treasureBlockArea.unite(areaToBlock);
}
*/
#endif
zone.connectPath(path);
manager.placeObject(rmgObject, guarded, true);
}