mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-03 14:52:11 +02:00
Possible fix to https://github.com/vcmi/vcmi/issues/3334
This commit is contained in:
parent
24f74875ef
commit
bd5361a108
@ -302,6 +302,8 @@ void ConnectionsPlacer::selfSideIndirectConnection(const rmg::ZoneConnection & c
|
||||
if(zone.isUnderground() != otherZone->isUnderground())
|
||||
{
|
||||
int3 zShift(0, 0, zone.getPos().z - otherZone->getPos().z);
|
||||
|
||||
std::scoped_lock doubleLock(zone.areaMutex, otherZone->areaMutex);
|
||||
auto commonArea = zone.areaPossible() * (otherZone->areaPossible() + zShift);
|
||||
if(!commonArea.empty())
|
||||
{
|
||||
@ -322,7 +324,6 @@ void ConnectionsPlacer::selfSideIndirectConnection(const rmg::ZoneConnection & c
|
||||
bool guarded2 = managerOther.addGuard(rmgGate2, connection.getGuardStrength(), true);
|
||||
int minDist = 3;
|
||||
|
||||
std::scoped_lock doubleLock(zone.areaMutex, otherZone->areaMutex);
|
||||
rmg::Path path2(otherZone->area());
|
||||
rmg::Path path1 = manager.placeAndConnectObject(commonArea, rmgGate1, [this, minDist, &path2, &rmgGate1, &zShift, guarded2, &managerOther, &rmgGate2 ](const int3 & tile)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user