From dd283248c2f5424521eaaa69f8a84e952b913652 Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Thu, 1 Jul 2021 21:18:49 +0200 Subject: [PATCH] Fixed bug where all units could move after attacking (#4325) --- core/src/com/unciv/logic/battle/Battle.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index 7df69a4217..2245834537 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -248,6 +248,7 @@ object Battle { private fun reduceAttackerMovementPointsAndAttacks(attacker: ICombatant, defender: ICombatant) { if (attacker is MapUnitCombatant) { val unit = attacker.unit + unit.attacksThisTurn += 1 if (unit.hasUnique("Can move after attacking") || unit.maxAttacksPerTurn() > unit.attacksThisTurn) { // if it was a melee attack and we won, then the unit ALREADY got movement points deducted, // for the movement to the enemy's tile! @@ -255,7 +256,6 @@ object Battle { if (!attacker.unit.baseUnit.movesLikeAirUnits() && !(attacker.getUnitType().isMelee() && defender.isDefeated())) unit.useMovementPoints(1f) } else unit.currentMovement = 0f - unit.attacksThisTurn += 1 if (unit.isFortified() || unit.isSleeping()) attacker.unit.action = null // but not, for instance, if it's Set Up - then it should definitely keep the action! } else if (attacker is CityCombatant) {