mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-09 07:13:54 +02:00
Fixed deadlock in WaterAdopter
This commit is contained in:
parent
73d9f5bd0a
commit
72f8facc82
@ -35,7 +35,6 @@ void WaterAdopter::process()
|
||||
void WaterAdopter::init()
|
||||
{
|
||||
//make dependencies
|
||||
DEPENDENCY_ALL(WaterAdopter);
|
||||
DEPENDENCY(TownPlacer);
|
||||
POSTFUNCTION(ConnectionsPlacer);
|
||||
POSTFUNCTION(TreasurePlacer);
|
||||
@ -224,7 +223,10 @@ void WaterAdopter::createWater(EWaterContent::EWaterContent waterContent)
|
||||
}
|
||||
}
|
||||
|
||||
map.getZones()[waterZoneId]->area().unite(waterArea);
|
||||
{
|
||||
Zone::Lock waterLock(map.getZones()[waterZoneId]->areaMutex);
|
||||
map.getZones()[waterZoneId]->area().unite(waterArea);
|
||||
}
|
||||
Zone::Lock lock(zone.areaMutex);
|
||||
zone.area().subtract(waterArea);
|
||||
zone.areaPossible().subtract(waterArea);
|
||||
|
Loading…
x
Reference in New Issue
Block a user