From 04dd889c3fae5687be818bc26df69a31d7efb3ce Mon Sep 17 00:00:00 2001 From: DM0000 <98051919+DM0000@users.noreply.github.com> Date: Sat, 2 Nov 2024 03:00:52 -0700 Subject: [PATCH 1/2] to hit to check if mode is mek --- megamek/src/megamek/common/LandAirMek.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/LandAirMek.java b/megamek/src/megamek/common/LandAirMek.java index 023117c2fc9..b6a410b297f 100644 --- a/megamek/src/megamek/common/LandAirMek.java +++ b/megamek/src/megamek/common/LandAirMek.java @@ -1500,7 +1500,7 @@ public int getWeaponArc(int wn) { */ @Override public HitData rollHitLocation(int table, int side) { - if (getConversionMode() != CONV_MODE_FIGHTER) { + if (getConversionMode() == CONV_MODE_MEK) { return super.rollHitLocation(table, side); } From 3a7d53cf9d59d2547e08575d4fb591329bd39975 Mon Sep 17 00:00:00 2001 From: DM0000 <98051919+DM0000@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:42:32 -0700 Subject: [PATCH 2/2] added the other overloaded rollHitLocation to LAM class to ensure correct one is activated --- megamek/src/megamek/common/LandAirMek.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/LandAirMek.java b/megamek/src/megamek/common/LandAirMek.java index b6a410b297f..6ebd89ae6ef 100644 --- a/megamek/src/megamek/common/LandAirMek.java +++ b/megamek/src/megamek/common/LandAirMek.java @@ -20,6 +20,7 @@ import java.util.Map; import java.util.Vector; +import megamek.common.enums.AimingMode; import megamek.common.enums.MPBoosters; import megamek.common.equipment.AmmoMounted; import megamek.common.equipment.BombMounted; @@ -1498,12 +1499,23 @@ public int getWeaponArc(int wn) { /** * Hit location table for fighter mode */ + @Override + public HitData rollHitLocation(int table, int side, int aimedLocation, AimingMode aimingMode, + int cover) { + if (getConversionMode() != CONV_MODE_FIGHTER) { + return super.rollHitLocation( table, side, aimedLocation, aimingMode, + cover); + } + return rollHitLocation(table, side); + } + @Override public HitData rollHitLocation(int table, int side) { - if (getConversionMode() == CONV_MODE_MEK) { + if (getConversionMode() != CONV_MODE_FIGHTER) { return super.rollHitLocation(table, side); } + int roll = Compute.d6(2); // first check for above/below