Browse Source

Protect lakes accessed from both zones with lock

Tomasz Zieliński 1 year ago
parent
commit
6d9f83a376
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/rmg/modificators/WaterProxy.cpp

+ 1 - 0
lib/rmg/modificators/WaterProxy.cpp

@@ -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))