Units that can move after attacking (horseman, knight) no longer get deducted movement points for BOTH the movement to the enemy tile AND the attack

This commit is contained in:
Yair Morgenstern 2018-06-11 18:32:37 +03:00
parent 02c74ad8ba
commit 9aa41d3d13

View file

@ -170,8 +170,10 @@ class Battle(val gameInfo:GameInfo=UnCivGame.Current.gameInfo) {
}
if(attacker is MapUnitCombatant) {
if (attacker.unit.hasUnique("Can move after attacking"))
if (attacker.unit.hasUnique("Can move after attacking")){
if(!attacker.getUnitType().isMelee() || !defender.isDefeated()) // if it was a melee attack and we won, then the unit ALREADY got movement points deducted, for the movement to the enemie's tile!
attacker.unit.currentMovement = max(0f, attacker.unit.currentMovement - 1)
}
else attacker.unit.currentMovement = 0f
attacker.unit.attacksThisTurn+=1
attacker.unit.action=null // for instance, if it was fortified