diff --git a/core/src/com/unciv/logic/map/mapunit/MapUnitCache.kt b/core/src/com/unciv/logic/map/mapunit/MapUnitCache.kt index 410fa8a718..45afdb3961 100644 --- a/core/src/com/unciv/logic/map/mapunit/MapUnitCache.kt +++ b/core/src/com/unciv/logic/map/mapunit/MapUnitCache.kt @@ -53,22 +53,17 @@ class MapUnitCache(private val mapUnit: MapUnit) { val doubleMovementInTerrain = HashMap() var canEnterIceTiles = false - var cannotEnterOceanTiles = false - var canEnterForeignTerrain: Boolean = false - + var canEnterCityStates: Boolean = false var costToDisembark: Float? = null - var costToEmbark: Float? = null - var paradropRange = 0 var hasUniqueToBuildImprovements = false // not canBuildImprovements to avoid confusion var hasUniqueToCreateWaterImprovements = false var hasStrengthBonusInRadiusUnique = false - var hasCitadelPlacementUnique = false fun updateUniques() { @@ -119,6 +114,8 @@ class MapUnitCache(private val mapUnit: MapUnit) { canEnterForeignTerrain = mapUnit.hasUnique(UniqueType.CanEnterForeignTiles) || mapUnit.hasUnique(UniqueType.CanEnterForeignTilesButLosesReligiousStrength) + canEnterCityStates = mapUnit.hasUnique(UniqueType.CanTradeWithCityStateForGoldAndInfluence) + hasStrengthBonusInRadiusUnique = mapUnit.hasUnique(UniqueType.StrengthBonusInRadius) hasCitadelPlacementUnique = mapUnit.getMatchingUniques(UniqueType.ConstructImprovementInstantly) .mapNotNull { mapUnit.civ.gameInfo.ruleset.tileImprovements[it.params[0]] } 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 db0df82afa..cb789f95ff 100644 --- a/core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt +++ b/core/src/com/unciv/logic/map/mapunit/movement/UnitMovement.kt @@ -780,7 +780,7 @@ class UnitMovement(val unit: MapUnit) { if (!unitSpecificAllowOcean && unit.cache.cannotEnterOceanTiles) return false } - if (unit.hasUnique(UniqueType.CanTradeWithCityStateForGoldAndInfluence) && tile.getOwner()?.isCityState() == true) + if (unit.cache.canEnterCityStates && tile.getOwner()?.isCityState() == true) return true if (!unit.cache.canEnterForeignTerrain && !tile.canCivPassThrough(unit.civ)) return false