diff --git a/core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt b/core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt index 26808a0f43..fc5cb73b00 100644 --- a/core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt +++ b/core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt @@ -69,7 +69,8 @@ class UnitMovement(val unit: MapUnit) { } } - if (!distanceToTiles.containsKey(neighbor) || distanceToTiles[neighbor]!!.totalDistance > totalDistanceToTile) { // this is the new best path + val currentBestPath = distanceToTiles[neighbor] + if (currentBestPath == null || currentBestPath.totalDistance > totalDistanceToTile) { // this is the new best path val usableMovement = if (includeOtherEscortUnit && unit.isEscorting()) minOf(unitMovement, unit.getOtherEscortUnit()!!.currentMovement) else unitMovement