mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-05 15:05:40 +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())
|
if(zone.isUnderground() != otherZone->isUnderground())
|
||||||
{
|
{
|
||||||
int3 zShift(0, 0, zone.getPos().z - otherZone->getPos().z);
|
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);
|
auto commonArea = zone.areaPossible() * (otherZone->areaPossible() + zShift);
|
||||||
if(!commonArea.empty())
|
if(!commonArea.empty())
|
||||||
{
|
{
|
||||||
@ -322,7 +324,6 @@ void ConnectionsPlacer::selfSideIndirectConnection(const rmg::ZoneConnection & c
|
|||||||
bool guarded2 = managerOther.addGuard(rmgGate2, connection.getGuardStrength(), true);
|
bool guarded2 = managerOther.addGuard(rmgGate2, connection.getGuardStrength(), true);
|
||||||
int minDist = 3;
|
int minDist = 3;
|
||||||
|
|
||||||
std::scoped_lock doubleLock(zone.areaMutex, otherZone->areaMutex);
|
|
||||||
rmg::Path path2(otherZone->area());
|
rmg::Path path2(otherZone->area());
|
||||||
rmg::Path path1 = manager.placeAndConnectObject(commonArea, rmgGate1, [this, minDist, &path2, &rmgGate1, &zShift, guarded2, &managerOther, &rmgGate2 ](const int3 & tile)
|
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