mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-25 23:29:47 +07:00
Resolved #12295 - crash on modded game with no capital city indicator
This commit is contained in:
@ -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
|
* @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>>? {
|
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 isCandidateTilePredicate: (Tile) -> Boolean = { it.isLand && unit.movement.canPassThrough(it) }
|
||||||
val toConnectTile = city.getCenterTile()
|
val toConnectTile = city.getCenterTile()
|
||||||
val bfs: BFS = bfsCache[toConnectTile.position] ?:
|
val bfs: BFS = bfsCache[toConnectTile.position] ?:
|
||||||
|
Reference in New Issue
Block a user