Tomasz Zieliński 9 months ago
parent
commit
685403c588
2 changed files with 3 additions and 2 deletions
  1. 1 1
      lib/rmg/Functions.cpp
  2. 2 1
      lib/rmg/modificators/ObjectManager.cpp

+ 1 - 1
lib/rmg/Functions.cpp

@@ -24,7 +24,7 @@
 
 
 VCMI_LIB_NAMESPACE_BEGIN
 VCMI_LIB_NAMESPACE_BEGIN
 
 
-void replaceWithCurvedPath(rmg::Path & path, const Zone & zone, const int3 & src, bool onlyStraight)
+void replaceWithCurvedPath(rmg::Path & path, const Zone & zone, const int3 & src, bool onlyStraight /* = true */)
 {
 {
 	auto costFunction = rmg::Path::createCurvedCostFunction(zone.area()->getBorder());
 	auto costFunction = rmg::Path::createCurvedCostFunction(zone.area()->getBorder());
 	auto pathArea = zone.areaForRoads();
 	auto pathArea = zone.areaForRoads();

+ 2 - 1
lib/rmg/modificators/ObjectManager.cpp

@@ -634,7 +634,7 @@ void ObjectManager::placeObject(rmg::Object & object, bool guarded, bool updateD
 		for (auto id : adjacentZones)
 		for (auto id : adjacentZones)
 		{
 		{
 			auto otherZone = map.getZones().at(id);
 			auto otherZone = map.getZones().at(id);
-			if ((otherZone->getType() == ETemplateZoneType::WATER) == (zone.getType()	== ETemplateZoneType::WATER))
+			if ((otherZone->getType() == ETemplateZoneType::WATER) == (zone.getType() == ETemplateZoneType::WATER))
 			{
 			{
 				// Do not update other zone if only one is water
 				// Do not update other zone if only one is water
 				auto manager = otherZone->getModificator<ObjectManager>();
 				auto manager = otherZone->getModificator<ObjectManager>();
@@ -675,6 +675,7 @@ void ObjectManager::placeObject(rmg::Object & object, bool guarded, bool updateD
 
 
 			if (object.isGuarded())
 			if (object.isGuarded())
 			{
 			{
+				// Do not route roads through guarded objects
 				rp->areaVisitable().add(instance->getVisitablePosition());
 				rp->areaVisitable().add(instance->getVisitablePosition());
 			}
 			}
 		}
 		}