From 317b175f1824e4150f1a0cee399b4b20097c369f Mon Sep 17 00:00:00 2001 From: psikomonkie <189469115+psikomonkie@users.noreply.github.com> Date: Fri, 20 Dec 2024 12:43:51 -0500 Subject: [PATCH] Issue 6273: GUI fix to prevent flak from making aimed shots on immobile targets --- megamek/src/megamek/common/actions/WeaponAttackAction.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/actions/WeaponAttackAction.java b/megamek/src/megamek/common/actions/WeaponAttackAction.java index f8e40d3d808..94a32d00e34 100644 --- a/megamek/src/megamek/common/actions/WeaponAttackAction.java +++ b/megamek/src/megamek/common/actions/WeaponAttackAction.java @@ -4427,7 +4427,11 @@ else if ((atype != null) if ((null != te) && !te.isAirborne() && !te.isSpaceborne() && (te instanceof Dropship)) { immobileMod = new ToHitData(-4, Messages.getString("WeaponAttackAction.ImmobileDs")); } else { - immobileMod = Compute.getImmobileMod(target, aimingAt, aimingMode); + if(Compute.allowAimedShotWith(weapon, aimingMode)) { + immobileMod = Compute.getImmobileMod(target, aimingAt, aimingMode); + } else { + immobileMod = Compute.getImmobileMod(target, aimingAt, AimingMode.NONE); + } } if (immobileMod != null) {