MegaMek / megamek

MegaMek is a networked Java clone of BattleTech, a turn-based sci-fi boardgame for 2+ players. Fight using giant robots, tanks, and/or infantry on a hex-based map.
http://www.megamek.org
GNU General Public License v2.0
297 stars 287 forks source link

49.19 - ADAs applying AA Targeting Quirk twice #5375

Closed RaozSpaz closed 6 months ago

RaozSpaz commented 6 months ago

Environment

49.19 Windows Java 11

Description

The issue was presented by a player in the Aerospace Academy discord from version 49.18. However I was immediately able to replicate the issue in 49.19 with a standard Longbow. image

And just for confirmation I did also run the test against a standard VTOL unit [not just ASF] and it also has the duplication. image

One other final test was just to confirm that the bug was happening with all weapons and not just ADAs image

Files

This can be replicated in any MegaMek with any unit using AA Targeting Quirk.

Sleet01 commented 6 months ago

@RaozSpaz 3rd picture is ADA again; was there a non-ADA example you meant to post there?

RaozSpaz commented 6 months ago

@RaozSpaz 3rd picture is ADA again; was there a non-ADA example you meant to post there?

Thats on me. I forgot my first weapon is the longest range weapon I have, which in this case was the AIV.

image

This blunder has revealed though that it may just be ADAs.

Sleet01 commented 6 months ago

This blunder has revealed though that it may just be ADAs.

This is for the best, actually, as it has helped narrow down the exact problem. Artillery attacks get their to-hit mods calculated separately from all other attacks because there are so many special rules, but ADA need to apply most of the usual mods because they are actually FLAK direct fire attacks (and because the rules say so). So I set up the code to jump ADA mod calcs back to the main path, but did so in such a way that mods are applied twice for ADA only; knowing that made the issue and fix crystal clear!

RaozSpaz commented 6 months ago

Woo! When screw ups fix problems XD

Fixed the name to be more accurate to the situation