diff --git a/lib/rmg/RmgObject.cpp b/lib/rmg/RmgObject.cpp index 36d3e117d..b344b268b 100644 --- a/lib/rmg/RmgObject.cpp +++ b/lib/rmg/RmgObject.cpp @@ -189,7 +189,7 @@ Object::Object(CGObjectInstance & object): } Object::Object(const Object & object): - guarded(object.guarded), + guarded(false), value(object.value) { for(const auto & i : object.dInstances) @@ -392,7 +392,11 @@ const Area & Object::getBorderAbove() const if(dBorderAboveCache.empty()) { for(const auto & instance : dInstances) + { + if (instance.isRemovable() || instance.object().appearance->isVisitableFromTop()) + continue; dBorderAboveCache.unite(instance.getBorderAbove()); + } } return dBorderAboveCache; } diff --git a/lib/rmg/modificators/RoadPlacer.cpp b/lib/rmg/modificators/RoadPlacer.cpp index 26bf98dfb..68468f799 100644 --- a/lib/rmg/modificators/RoadPlacer.cpp +++ b/lib/rmg/modificators/RoadPlacer.cpp @@ -137,17 +137,12 @@ bool RoadPlacer::createRoad(const int3 & dst) void RoadPlacer::drawRoads(bool secondary) { + //Do not draw roads on underground rock or water + roads.erase_if([this](const int3& pos) -> bool { - //Clean space under roads even if they won't be eventually generated - Zone::Lock lock(zone.areaMutex); - - //Do not draw roads on underground rock or water - roads.erase_if([this](const int3& pos) -> bool - { - const auto* terrain = map.getTile(pos).terType; - return !terrain->isPassable() || !terrain->isLand(); - }); - } + const auto* terrain = map.getTile(pos).terType; + return !terrain->isPassable() || !terrain->isLand(); + }); if(!generator.getMapGenOptions().isRoadEnabled()) {