mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-23 13:10:54 +07:00
Resolved #12295 - crash on modded game with no capital city indicator
This commit is contained in:
parent
e0f3c0acd4
commit
0d19bf55e5
@ -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] ?:
|
||||
|
Loading…
Reference in New Issue
Block a user