Browse Source

Do not route road through the Corpse

Tomasz Zieliński 1 year ago
parent
commit
f17d8babc5
2 changed files with 7 additions and 3 deletions
  1. 6 2
      lib/rmg/modificators/ObjectManager.cpp
  2. 1 1
      lib/rmg/modificators/RoadPlacer.cpp

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

@@ -546,8 +546,12 @@ void ObjectManager::placeObject(rmg::Object & object, bool guarded, bool updateD
 		objects.push_back(&instance->object());
 		if(auto * m = zone.getModificator<RoadPlacer>())
 		{
-			//FIXME: Objects that can be removed, can be trespassed. Does not include Corpse
-			if(instance->object().appearance->isVisitableFromTop())
+			if (instance->object().blockVisit && !instance->object().removable)
+			{
+				//Cannot be trespassed (Corpse)
+				continue;
+			}
+			else if(instance->object().appearance->isVisitableFromTop())
 				m->areaForRoads().add(instance->getVisitablePosition());
 			else
 			{

+ 1 - 1
lib/rmg/modificators/RoadPlacer.cpp

@@ -85,7 +85,7 @@ bool RoadPlacer::createRoad(const int3 & dst)
 			{
 				if(areaIsolated().contains(dst) || areaIsolated().contains(src))
 				{
-					return 1e30;
+					return 1e12;
 				}
 			}
 			else