Resolved #1003 - Logistics promotion didn't work on air units

This commit is contained in:
Yair Morgenstern 2019-08-18 22:45:03 +03:00
parent 5f4f6eb206
commit 814ecde1e3

View File

@ -136,7 +136,10 @@ class Battle(val gameInfo:GameInfo) {
val unit = attacker.unit val unit = attacker.unit
if (unit.hasUnique("Can move after attacking") if (unit.hasUnique("Can move after attacking")
|| (unit.hasUnique("1 additional attack per turn") && unit.attacksThisTurn==0)){ || (unit.hasUnique("1 additional attack per turn") && unit.attacksThisTurn==0)){
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! // 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!
// and if it's an air unit, it only has 1 movement anyway, so...
if(!attacker.getUnitType().isAirUnit() && !(attacker.getUnitType().isMelee() && defender.isDefeated()))
unit.useMovementPoints(1f) unit.useMovementPoints(1f)
} }
else unit.currentMovement = 0f else unit.currentMovement = 0f