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 133 forks source link

Version 0.43.5: Removing weapons or equipment does not return tonnage #120

Closed LiamsGhost closed 6 years ago

LiamsGhost commented 6 years ago

As it says above, removing any equipment allocated in the equipment tab doesn't return tonnage to the mech. This has been tried on two seperate designs using the introductory and mixed(clan) tech base.

mkerensky commented 6 years ago

What happens if you delete the equipment? That returns the tonnage for me when I'm customizing dropships. You can delete straight from the locations when the equipment is allocated, otherwise you have to find it on the add equipment screen and delete it.

neoancient commented 6 years ago

Support for large craft weapon bays necessitated using getTotalWeaponList() in some places instead of just the getWeaponList() (which for large craft returns the bays only). When a weapon is removed from the unit it was not being removed from the list that is used to calculate the current weight. Large craft had special handling added to make sure it was removed from the list of bay weapons, which is why it was working for dropships but not other units.