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
84 stars 127 forks source link

MegaMekLab Clan Case Bug #1105

Open bravebravesirbrian opened 2 years ago

bravebravesirbrian commented 2 years ago

Environment

This issue applies to the MekHQ version of MekLab. I am operating a Windows PC. I'm running Java Version 8 Update 333.

Description

So, you know how Clan CASE takes up no space and weighs nothing? In MegaMekLab, it is automatically applied to ammo and gauss rifles when you place them on your Mek. I noticed, however, that when I applied a gauss rifle to my Mek's right arm, and then I moved the gauss rifle to another location, the CASE in the right arm remained, and another CASE was added in the new location. As I kept moving it around, more CASE kept being added that I couldn't remove. These CASEs would stay even if I removed the gauss rifle entirely. And all the while, my Mek's cost was increasing. The only thing I could do to get rid of the extra CASE was to reset my Mek entirely.

Files

I don't know how to add a megameklab.log file, and the game didn't have any error messages. Here is the file of the unit, though. I removed all of its gauss rifles and LRM 20 ammo. Nothing is visible on the Equipment Tab, but on the TRO under the Preview tab, you can clearly see four cases where the gauss rifles and LRM 20 ammo used to be. T. Rex Prime.zip

HammerGS commented 2 years ago

Tested and confirm it's happening in the TRO View, but the unit files don't reflect it.

bravebravesirbrian commented 2 years ago

@HammerGS The unit files don't reflect it? But I saw the cost keep rising each time a gauss rifle or ammo was moved. It would rise by 50,000 C-Bills (the cost of one CASE) each time. Is that not connected to the unit files?

HammerGS commented 2 years ago

All those values are calculated via code. What is written into the file is final, so if you reload a file when it's complete the CASE is added based on the Tech Base.

As you can see in this partial screen shot of a unit file. image

bravebravesirbrian commented 2 years ago

@HammerGS I just did a test and you're correct.

When I reload a file, the extra CASEs disappear from the TRO and the cost goes down.

I'm glad I know that now. Thank you for your help.

HammerGS commented 2 years ago

We still need to fix the GUI issue but thanks for the bug report. :)

PhoenixHeart512 commented 2 years ago

This is particularly severe for ASF's I've noticed, doing any customizations on a clan ASF that involves ammo is a nightmare of overflowing CASE entries lol

HuntingTarg commented 1 year ago

Glad I checked for existing issues. Based on what I observed using MegaMekLab, this issue seems to involve iterative replication where the Clan CASE visual object is not removed from the fuselage but is replicated to the 'unallocated' table on removal, and when is added back in, two entries are added instead of one. Just throwing in my documentation here after attempting to create a Clan design from scratch, then use the existing file to create a variant. Also, when I try to remove and reallocate ammo, the same replicative behavior occurs, with the ammo's slot being replaced by CASE, and CASE being again auto-added for the ammo when it is reallocated. Confirm that this is a GUI issue, and that the extra CASE entries are not being included in the save file.

Files

MML_ClanCASE_AllocationErrorScreenshot_01 MML_ClanCASE_AllocationErrorScreenshot_02 MML_ClanCASE_AllocationErrorScreenshot_03 MML_ClanCASE_AllocationErrorScreenshot_04 MML_ClanCASE_AllocationErrorScreenshot_05 megameklab.log

Thunderbird Strike Fighter TBD-SF1.zip