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
134 stars 173 forks source link

freezes when starting refit from Meklab #4072

Open hicleric opened 6 months ago

hicleric commented 6 months ago

Fill out the fields below with as much pertinent information as possible to help the developers solve the issue. Search for your issue inside open and closed issues first before reporting so as not to make duplicates. (Delete the above lines)

Environment

What version of MekHQ does your issue apply to? .49.19 What operating system are you using? Windows, Mac, or Linux? Windows What java version are you using? 11.0.12

Description

MekHQ occasionally crashes when starting a customized refit from the Meklab, after choosing the tech and naming the outfit. The new outfit is created, but MekHQ never leaves the lab and stops receiving input (it does not start burning CPU, however). On reloading the save the game works normally, noting that the new outfit appears in the refit list. I've seen this happen on several occasions without noting any common factors between them except that it's for a custom refit. It might have something to do with part availability or being in a mission: I see the following error message in the MekHQ log timestamped to the crash: "ERROR [mekhq.campaign.Campaign] {AWT-EventQueue-0} mekhq.campaign.Campaign.getTargetFor(Campaign.java:4900) - Attempting to get the target number for a part with zero time left."

There are no errors in the Meklab log file. mekhq.log My Campaign30510601.cpnx.gz

IllianiCBT commented 6 months ago

From the log:


mekhq.campaign.Campaign.getTargetFor(Campaign.java:4900) - Attempting to get the target number for a part with zero time left.```
Sleet01 commented 3 months ago

@hicleric Please attach your custom units folder so we can reproduce the issue with your campaign file, thanks!

poiu18894012 commented 1 month ago

So I'm not sure if I should start a new issue, or add on to this issue since I have the same/similar thing.

Environment

What version of MekHQ does your issue apply to? .50.0 What operating system are you using? Windows, Mac, or Linux? Windows What java version are you using? 17.0.12+8-LTS-286

Description Campaign freezes when refitting mechs. Happens on fresh installs on multiple computers. What I've noticed is that it's caused by the mechtech refit skill. If the modifier goes to the negative, then it will freeze the campaign. Ex: Tech/Mechanic level 10 with engineer will freeze, however Tech/Mechanic level 10 without engineer will not freeze.

I've replicated this across 4 different windows installation, all using the same version of java installed. I have not managed to replicate this issue without the Tech/Mechanic having a negative refit roll.

Hope this helps!

Workaround: Do not give your level 10 engineer any bonuses or the engineer skill. It will freeze your game on refit.

Sleet01 commented 1 month ago

@poiu18894012 That's a very helpful repro report. I'll try to check that out this week.