Browse Source

Cleared up formatting

Ivan Savenko 2 năm trước cách đây
mục cha
commit
707de75ac0
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      lib/rmg/ConnectionsPlacer.cpp

+ 5 - 2
lib/rmg/ConnectionsPlacer.cpp

@@ -85,8 +85,11 @@ void ConnectionsPlacer::selfSideDirectConnection(const rmg::ZoneConnection & con
 	
 	//1. Try to make direct connection
 	//Do if it's not prohibited by terrain settings
-	bool directProhibited = vstd::contains(VLC->terrainTypeHandler->getById(zone.getTerrainType())->prohibitTransitions, otherZone->getTerrainType())
-						 || vstd::contains(VLC->terrainTypeHandler->getById(otherZone->getTerrainType())->prohibitTransitions, zone.getTerrainType());
+	const auto * ourTerrain   = VLC->terrainTypeHandler->getById(zone.getTerrainType());
+	const auto * otherTerrain = VLC->terrainTypeHandler->getById(otherZone->getTerrainType());
+
+	bool directProhibited = vstd::contains(ourTerrain->prohibitTransitions, otherZone->getTerrainType())
+						 || vstd::contains(otherTerrain->prohibitTransitions, zone.getTerrainType());
 	auto directConnectionIterator = dNeighbourZones.find(otherZoneId);
 	if(!directProhibited && directConnectionIterator != dNeighbourZones.end())
 	{