mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-05 00:49:09 +02:00
Fix Subterranean Gates incorrectly placed outside the map
(cherry picked from commit acf455a1c3b02c0f8d5085c23fe2230779b7560b)
This commit is contained in:
@ -334,7 +334,17 @@ void ConnectionsPlacer::selfSideIndirectConnection(const rmg::ZoneConnection & c
|
|||||||
if(dist < minDist || otherDist < minDist)
|
if(dist < minDist || otherDist < minDist)
|
||||||
return -1.f;
|
return -1.f;
|
||||||
|
|
||||||
|
//This could fail is accessibleArea is below the map
|
||||||
rmg::Area toPlace(rmgGate1.getArea() + rmgGate1.getAccessibleArea());
|
rmg::Area toPlace(rmgGate1.getArea() + rmgGate1.getAccessibleArea());
|
||||||
|
auto inTheMap = toPlace.getTilesVector();
|
||||||
|
toPlace.clear();
|
||||||
|
for (const int3& tile : inTheMap)
|
||||||
|
{
|
||||||
|
if (map.isOnMap(tile))
|
||||||
|
{
|
||||||
|
toPlace.add(tile);
|
||||||
|
}
|
||||||
|
}
|
||||||
toPlace.translate(-zShift);
|
toPlace.translate(-zShift);
|
||||||
|
|
||||||
path2 = managerOther.placeAndConnectObject(toPlace, rmgGate2, minDist, guarded2, true, ObjectManager::OptimizeType::NONE);
|
path2 = managerOther.placeAndConnectObject(toPlace, rmgGate2, minDist, guarded2, true, ObjectManager::OptimizeType::NONE);
|
||||||
|
Reference in New Issue
Block a user