From 2d3daa8c3bc0e00f0059b03ee6d3d9b35afbcc5f Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Fri, 31 Jul 2020 11:40:02 +0300 Subject: [PATCH] Scouts ignore river movement penalties --- core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt index 78e90b11c0..a7254c022b 100644 --- a/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt +++ b/core/src/com/unciv/logic/map/UnitMovementAlgorithms.kt @@ -24,17 +24,16 @@ class UnitMovementAlgorithms(val unit:MapUnit) { return 1 / 10f + extraCost val areConnectedByRoad = from.hasConnection(civInfo) && to.hasConnection(civInfo) - if(from.isConnectedByRiver(to) && - (!areConnectedByRoad || !civInfo.tech.roadsConnectAcrossRivers)){ - return 100f // Rivers take the entire turn to cross - } + val areConnectedByRiver = from.isConnectedByRiver(to) - if (areConnectedByRoad) + if (areConnectedByRoad && (!areConnectedByRiver || civInfo.tech.roadsConnectAcrossRivers)) { return if (unit.civInfo.tech.movementSpeedOnRoadsImproved) 1 / 3f + extraCost else 1 / 2f + extraCost } if (unit.ignoresTerrainCost) return 1f + extraCost + if (areConnectedByRiver) return 100f // Rivers take the entire turn to cross + if (unit.doubleMovementInForestAndJungle && (to.terrainFeature == Constants.forest || to.terrainFeature == Constants.jungle)) return 1f + extraCost // usually forest and jungle take 2 movements, so here it is 1 if (civInfo.nation.greatAndeanRoad && to.baseTerrain == Constants.hill)