1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Protect lakes accessed from both zones with lock

This commit is contained in:
Tomasz Zieliński 2024-06-17 19:00:37 +02:00
parent f2d870e651
commit 6d9f83a376

View File

@ -219,6 +219,7 @@ bool WaterProxy::waterKeepConnection(const rmg::ZoneConnection & connection, boo
const auto & zoneA = connection.getZoneA();
const auto & zoneB = connection.getZoneB();
RecursiveLock lock(externalAccessMutex);
for(auto & lake : lakes)
{
if(lake.neighbourZones.count(zoneA) && lake.neighbourZones.count(zoneB))