1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00

More tolerance for Subterranean Gates placement

This commit is contained in:
Tomasz Zieliński 2023-10-31 16:04:21 +01:00
parent 29a78c14a2
commit 29f023eaa5

View File

@ -334,16 +334,12 @@ void ConnectionsPlacer::selfSideIndirectConnection(const rmg::ZoneConnection & c
return -1.f;
//This could fail is accessibleArea is below the map
rmg::Area toPlace(rmgGate1.getArea() + rmgGate1.getAccessibleArea());
auto inTheMap = toPlace.getTilesVector();
toPlace.clear();
for (const int3& tile : inTheMap)
rmg::Area toPlace(rmgGate1.getArea());
toPlace.unite(toPlace.getBorderOutside()); // Add a bit of extra space around
toPlace.erase_if([this](const int3 & tile)
{
if (map.isOnMap(tile))
{
toPlace.add(tile);
}
}
return !map.isOnMap(tile);
});
toPlace.translate(-zShift);
path2 = managerOther.placeAndConnectObject(toPlace, rmgGate2, minDist, guarded2, true, ObjectManager::OptimizeType::NONE);