Embarking penalty logic fix (#6181)

* Fox naval unit Landind penalty is for attacking on to land

* Only Land unit should have Boarding penalty

* Unbreak logic

Co-authored-by: itanasi <spellman23@gmail.com>
This commit is contained in:
itanasi 2022-02-18 04:15:35 -08:00 committed by GitHub
parent 82236fe2c8
commit 4e338ae4f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,7 +136,7 @@ object BattleDamage {
modifiers["Landing"] = -50
// Land Melee Unit attacking to Water
if (!attacker.unit.isEmbarked() && attacker.isMelee() && defender.getTile().isWater
if (attacker.unit.type.isLandUnit() && !attacker.unit.isEmbarked() && attacker.isMelee() && defender.getTile().isWater
&& !attacker.unit.hasUnique(UniqueType.AttackAcrossCoast))
modifiers["Boarding"] = -50
// Naval Unit Melee attacking to Land (not City) unit