Resolved #12295 - crash on modded game with no capital city indicator

This commit is contained in:
yairm210 2024-10-16 00:32:51 +03:00
parent e0f3c0acd4
commit 0d19bf55e5

View File

@ -178,6 +178,8 @@ class RoadBetweenCitiesAutomation(val civInfo: Civilization, cachedForTurn: Int,
* @return a pair containing a list of tiles that resemble the road to build and the city that the road will connect to
*/
private fun getRoadToConnectCityToCapital(unit: MapUnit, city: City): Pair<City, List<Tile>>? {
if (tilesOfConnectedCities.isEmpty()) return null // In mods with no capital city indicator, there are no connected cities
val isCandidateTilePredicate: (Tile) -> Boolean = { it.isLand && unit.movement.canPassThrough(it) }
val toConnectTile = city.getCenterTile()
val bfs: BFS = bfsCache[toConnectTile.position] ?: