1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Final fixes and tweaks

This commit is contained in:
Tomasz Zieliński 2024-05-01 13:58:24 +02:00
parent 186b6629c7
commit 4d13c3b94f
2 changed files with 10 additions and 11 deletions

View File

@ -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;
}

View File

@ -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())
{