MegaMek / megameklab

MegaMekLab is a BattleTech unit modification program. It allows creating and modifying all unit types available in MegaMek from Support Vehicles up to WarShips. It also allows printing record sheets for single or multiple units.
http://www.megamek.org
86 stars 129 forks source link

[0.50.0 and on] Support Vehicles Become Invalid When Saved, BAR Level Edition #1631

Open WeaverThree opened 2 hours ago

WeaverThree commented 2 hours ago

Prerequisites and Pre-Issue Checklist

Severity *

High (Major Disruption): A major feature is broken or incorrect, but a workaround exists.

Brief Description *

When you save a support vehicle, its armor BAR and tech ratings change such that the armor weight is larger and causes the vehicle to be overweight, and the armor is too dense to be used without the armored chassis mod. Details below.

Tested in 0.50.0 and a recent nightly.

It's likely this is related to #1596. It's possible this is related to #1489. This might be what's causing the Sherpa variants to be invalid, or other support vehicles.

Steps to Reproduce

  1. Start MML and hit "New Support Vehicle"
  2. First Page: Set Tonnage to 50, Cruise MP to 5, Fuel Mass to 5. Give the unit a Chassis and Model for the filename.
  3. Armor page: Select BAR 7 Armor, maximize armor, auto-allocate armor. The armor tech level will be D by default.
  4. Transport page: Click 'Use Remaining Tonnage for Cargo'
  5. Press Validate Unit - validation passed
  6. Save the file. Load the saved file. Say you don't want to save the file again.

The warning dialog will appear saying: 2024-10-04_103051

  1. Hit OK and note that the armor tonnage on the first page has jumped up.
  2. Go to the Armor Page again. Note that the armor type has changed to BAR 2, tech rating B, and the tonnage has increased.
  3. You can now only select BAR 2 or BAR 3 armor.
  4. Select 4 tons of rating B BAR 3 armor and hit Auto-Allocate
  5. The unit is now under tonnage so go to the transport page and add another ton of cargo space.
  6. Save and load the file again. It works this time, without being invalid.

These are the relevant blk files:

Broken Step By Step.zip

Operating System *

Linux

Java Version *

17.0.12

MegaMek Suite Version *

v0.50.0

Custom MegaMekLab Version

v0.50.01-SNAPSHOT 2024-10-02

Attach Files

megameklab.MegaMekLab.initializeLogging(MegaMekLab.java:81) - Starting MegaMekLab v0.50.1-SNAPSHOT Build Date: 2024-10-03T03:24:04.067850647 Today: 2024-10-04 Origin Project: MegaMekLab Java Vendor: Eclipse Adoptium Java Version: 17.0.12 Platform: Linux 6.11.1-203.fsync.fc40.x86_64 (amd64) System Locale: en_US Total memory available to MegaMekLab: 1 GB MM Code Revision: a53044ee0763666eba74cdeaf511e150d291b1f0 MML Code Revision: ec3384545ca567ddab36a47e886315bf1b77ab49 MHQ Code Revision: 7eb17ed577293cf4fe52daeba4b0e9bf3223f902

Nothing of note appears in the log files.

Final Checklist