diff --git a/lib/rmg/modificators/TreasurePlacer.cpp b/lib/rmg/modificators/TreasurePlacer.cpp index 6ffed6e4c..6d77c88a8 100644 --- a/lib/rmg/modificators/TreasurePlacer.cpp +++ b/lib/rmg/modificators/TreasurePlacer.cpp @@ -763,17 +763,13 @@ void TreasurePlacer::createTreasures(ObjectManager& manager) //this is squared distance for optimization purposes const float minDistance = std::max((125.f / totalDensity), 1.0f); - for (size_t i = 0; i < count;) + for (size_t i = 0; i < count; i++) { auto treasurePileInfos = prepareTreasurePile(t); if (treasurePileInfos.empty()) { continue; } - else - { - i++; - } int value = std::accumulate(treasurePileInfos.begin(), treasurePileInfos.end(), 0, [](int v, const ObjectInfo* oi) {return v + oi->value; });