mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Fix race condition when placing object at teh shore
This commit is contained in:
@@ -579,11 +579,15 @@ void ObjectManager::placeObject(rmg::Object & object, bool guarded, bool updateD
|
|||||||
|
|
||||||
for (auto id : adjacentZones)
|
for (auto id : adjacentZones)
|
||||||
{
|
{
|
||||||
auto manager = map.getZones().at(id)->getModificator<ObjectManager>();
|
auto otherZone = map.getZones().at(id);
|
||||||
if (manager)
|
if ((otherZone->getType() == ETemplateZoneType::WATER) == (zone.getType() == ETemplateZoneType::WATER))
|
||||||
{
|
{
|
||||||
// TODO: Update distances for perimeter of guarded object, not just treasures
|
// Do not update other zone if only one is water
|
||||||
manager->updateDistances(object);
|
auto manager = otherZone->getModificator<ObjectManager>();
|
||||||
|
if (manager)
|
||||||
|
{
|
||||||
|
manager->updateDistances(object);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user