فهرست منبع

Clear unused tiles to make more space for roads.

DjWarmonger 10 سال پیش
والد
کامیت
55c1a7eade
2فایلهای تغییر یافته به همراه9 افزوده شده و 0 حذف شده
  1. 1 0
      lib/rmg/CMapGenerator.cpp
  2. 8 0
      lib/rmg/CRmgTemplateZone.cpp

+ 1 - 0
lib/rmg/CMapGenerator.cpp

@@ -557,6 +557,7 @@ void CMapGenerator::createConnections()
 							zoneA->placeAndGuardObject(this, gate1, tile, connection.getGuardStrength());
 							auto gate2 = new CGSubterraneanGate(*gate1);
 							zoneB->placeAndGuardObject(this, gate2, otherTile, connection.getGuardStrength());
+							//TODO: connect gates with middle of zone / free paths. At this point free paths do not exist yet.
 
 							stop = true; //we are done, go to next connection
 						}

+ 8 - 0
lib/rmg/CRmgTemplateZone.cpp

@@ -1662,6 +1662,14 @@ void CRmgTemplateZone::createObstacles2(CMapGenerator* gen)
 			}
 		}
 	}
+	//cleanup - remove unused possible tiles to make space for roads
+	for (auto tile : tileinfo)
+	{
+		if (gen->isPossible(tile))
+		{
+			gen->setOccupied (tile, ETileType::FREE);
+		}
+	}
 }
 
 void CRmgTemplateZone::connectRoads(CMapGenerator* gen)