mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-25 12:14:46 +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()
|
void WaterAdopter::init()
|
||||||
{
|
{
|
||||||
//make dependencies
|
//make dependencies
|
||||||
DEPENDENCY_ALL(WaterAdopter);
|
|
||||||
DEPENDENCY(TownPlacer);
|
DEPENDENCY(TownPlacer);
|
||||||
POSTFUNCTION(ConnectionsPlacer);
|
POSTFUNCTION(ConnectionsPlacer);
|
||||||
POSTFUNCTION(TreasurePlacer);
|
POSTFUNCTION(TreasurePlacer);
|
||||||
@ -224,7 +223,10 @@ void WaterAdopter::createWater(EWaterContent::EWaterContent waterContent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Zone::Lock waterLock(map.getZones()[waterZoneId]->areaMutex);
|
||||||
map.getZones()[waterZoneId]->area().unite(waterArea);
|
map.getZones()[waterZoneId]->area().unite(waterArea);
|
||||||
|
}
|
||||||
Zone::Lock lock(zone.areaMutex);
|
Zone::Lock lock(zone.areaMutex);
|
||||||
zone.area().subtract(waterArea);
|
zone.area().subtract(waterArea);
|
||||||
zone.areaPossible().subtract(waterArea);
|
zone.areaPossible().subtract(waterArea);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user