MegaMek / mekhq

MekHQ is a java helper program for the MegaMek game that allows users to load a list of entities from an XML file, perform repairs and customizations, and then save the new entities to another XML file that can be loaded into MegaMek.
http://megamek.org
131 stars 168 forks source link

[0.43.7-RC1] Unused bombs are not recovered for VTOLs after battle #620

Closed RexPearce closed 6 years ago

RexPearce commented 6 years ago

To reproduce: 1) Load the attached campaign which has a battle queued up 2) Note that "MegaMek Options->Advanced Combat->TacOps VTOL Special Attacks" is enabled 3) Note in the hanger that the VTOL has 5 bombs loaded (and the fighter has 4) 4) Launch the mission, deploy all units, then end it after the first turn with "/victory" (without using any bombs) 5) After the mission, in the hanger note that fighter still has its bombs, but the VTOL does not.

A related bug: After the mission, in the hanger view, the VTOL's bombs are actually shown as integrated weapons on unit. However, saving the game and reloading it restores the unit back normal, but still without the unused bombs.

My Campaign30250202-vtol-bombs.zip

NickAragua commented 6 years ago

This was a two-pronged issue: 1) MekHQ wasn't actually saving the bomb selection for the VTOL in the saved game. 2) There was an issue preventing the bombs from displaying properly on the "unit summary" when clicking "view unit".

NickAragua commented 6 years ago

It just occurred to me that there might still be an issue when resolving a battle directly from Megamek as opposed to "Resolve Manually" by supplying a MUL file. I'll take a look sometime tonight.

RexPearce commented 6 years ago

A minor related bug: looks like the bomb text is truncated in the Hanger view. i.e. it says "HE Bomb (4" instead of "HE Bombs (4)".

NickAragua commented 6 years ago

Bombs should properly clear for VTOLs and LAMs as well as aeros through all possible scenario resolution paths. Fixed the parens as well. One minor issue is that, in the initial screen where you review units, the VTOLs will still show up as having "light damage", and the View Unit screen will show the list of individual bombs, as opposed to the HE Bomb (5) text. However, in the interest of minimizing changes prior to stable, I'm going to leave that for now.