mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Proper fix for the issue
This commit is contained in:
@ -419,11 +419,13 @@ bool ObjectManager::createMonoliths()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Once it can be created, replace with curved path
|
// Object must be placed first so that curved path won't go through occupied tiles
|
||||||
|
placeObject(rmgObject, guarded, true, objInfo.createRoad);
|
||||||
|
|
||||||
|
// Once it can be created, replace with curved path.
|
||||||
replaceWithCurvedPath(path, zone, rmgObject.getVisitablePosition());
|
replaceWithCurvedPath(path, zone, rmgObject.getVisitablePosition());
|
||||||
|
|
||||||
zone.connectPath(path);
|
zone.connectPath(path);
|
||||||
placeObject(rmgObject, guarded, true, objInfo.createRoad);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vstd::erase_if(requiredObjects, [](const auto & objInfo)
|
vstd::erase_if(requiredObjects, [](const auto & objInfo)
|
||||||
@ -452,6 +454,8 @@ bool ObjectManager::createRequiredObjects()
|
|||||||
logGlobal->error("Failed to fill zone %d due to lack of space", zone.getId());
|
logGlobal->error("Failed to fill zone %d due to lack of space", zone.getId());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
placeObject(rmgObject, guarded, true, objInfo.createRoad);
|
||||||
if (objInfo.createRoad)
|
if (objInfo.createRoad)
|
||||||
{
|
{
|
||||||
// Once valid path can be created, replace with curved path
|
// Once valid path can be created, replace with curved path
|
||||||
@ -459,7 +463,6 @@ bool ObjectManager::createRequiredObjects()
|
|||||||
}
|
}
|
||||||
|
|
||||||
zone.connectPath(path);
|
zone.connectPath(path);
|
||||||
placeObject(rmgObject, guarded, true, objInfo.createRoad);
|
|
||||||
|
|
||||||
for(const auto & nearby : nearbyObjects)
|
for(const auto & nearby : nearbyObjects)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user