mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Merge pull request #3131 from vcmi/improve_subterranean_gates
More tolerance for Subterranean Gates placement
This commit is contained in:
commit
ad9acd4b5e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user