فهرست منبع

Add clearance under town to ensure passability.

DjWarmonger 8 سال پیش
والد
کامیت
a0596ebecf
1فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 8 4
      lib/rmg/CRmgTemplateZone.cpp

+ 8 - 4
lib/rmg/CRmgTemplateZone.cpp

@@ -1322,11 +1322,15 @@ void CRmgTemplateZone::initTownType (CMapGenerator* gen)
 
 	auto cutPathAroundTown = [gen, this](const CGTownInstance * town)
 	{
-		//cut contour around town entrance
-		for (auto pos: getAccessibleOffsets(gen, town))
+		//clear tiles under town to ensure passability
+		for (auto blockedTile : town->getBlockedPos())
 		{
-			gen->setOccupied(pos, ETileType::FREE);
-		};
+			gen->foreach_neighbour(blockedTile, [gen, town](const int3& pos)
+			{
+				if (pos.y > town->pos.y)
+					gen->setOccupied(pos, ETileType::FREE);
+			});
+		}
 	};
 
 	auto addNewTowns = [&totalTowns, gen, this, &cutPathAroundTown](int count, bool hasFort, PlayerColor player)