Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Infantry armor working on build and save but failing on load #1721

Closed
4 tasks done
SuperStucco opened this issue Feb 8, 2025 · 2 comments · Fixed by MegaMek/megamek#6531
Closed
4 tasks done

Comments

@SuperStucco
Copy link

Brief Description *

I can build infantry with Environment Suit, Marine and Environmental Suit, Hostile armor kits, but when loading they throw an error. For example, the attached ZIP has one example of each.

Infantry armor failure.zip

The log indicates the NPE for reasons of Cannot invoke "megamek.common.EquipmentType.getInternalName()" because "type" is null

megameklab.log

3. Steps to Reproduce

No response

Attach Files

No response

Severity *

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

MegaMeklab Suite Version *

50.04 snapshot

Operating System *

Win 10

Java Version *

Eclipse Adoptium 17.0.11

Final Verification

  • I confirm this is a single, unique issue that hasn't been reported before
  • I have included all necessary information and files to help reproduce this issue
  • I have asked on MegaMek Discord about this issue
  • I have confirmed this issue is being opened on the correct repository: MegaMek, MegaMekLab, or MekHQ
@SJuliez
Copy link
Member

SJuliez commented Feb 9, 2025

The error in both files is that it gives a number of secondary weapons but not what type of weapon. Removing the entry in the files repairs them. I was unable to produce such a saved file with MML (meaning, outside of hand editing). It does not seem to have anything to do with the armor kit. I was able to create infantry with armor kits, save and load.

Do you know the steps to reproduce this error?

@SuperStucco
Copy link
Author

These are based on legacy files saved from 49.19 or earlier. At the time, you could end up with a defined number of secondary weapons without having a secondary weapon set.

Looks like the save process in my 50.04 snapshot is automatically resetting the support weapon count to 0 before the file is saved, at least when starting as such. When the legacy files like the ones provided are loaded it was kicking out the error. Given the large number of legacy files I and others have, maybe that reset (no actual secondary weapon, change count to zero) could be added when the file is opened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants