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

[dev] Exception resolving battle with damaged/destroyed dropship in opfor #2258

Closed
NickAragua opened this issue Dec 4, 2020 · 2 comments · Fixed by #2257
Closed

[dev] Exception resolving battle with damaged/destroyed dropship in opfor #2258

NickAragua opened this issue Dec 4, 2020 · 2 comments · Fixed by #2257

Comments

@NickAragua
Copy link
Member

NickAragua commented Dec 4, 2020

When resolving a battle that involves a dropship with a blown-out bay, we get the following exception.

java.lang.NullPointerException
at mekhq.campaign.parts.BayDoor.remove(BayDoor.java:104)
at mekhq.campaign.parts.TransportBayPart.updateConditionFromEntity(TransportBayPart.java:110)
at mekhq.campaign.unit.Unit.runDiagnostic(Unit.java:536)
at mekhq.campaign.unit.TestUnit.(TestUnit.java:42)
at mekhq.campaign.ResolveScenarioTracker.generateNewTestUnit(ResolveScenarioTracker.java:162)
at mekhq.campaign.ResolveScenarioTracker.processGame(ResolveScenarioTracker.java:386)
at mekhq.MekHQ.gameVictory(MekHQ.java:577)
at megamek.common.event.GameVictoryEvent.fireEvent(GameVictoryEvent.java:70)
at megamek.common.Game.processGameEvent(Game.java:3161)
at megamek.client.Client.handlePacket(Client.java:1545)
at megamek.client.Client$1$2.run(Client.java:193)

Clicking the 'ok' button multiple times when using 'resolve manually' with a MUL resulting from the scenario for some reason eventually lets the scenario resolution proceed.

Example campaign. Use the attached MUL file to resolve "Dropship Assault".
1st Octopus Overlords.zip

@sixlettervariables
Copy link
Contributor

sixlettervariables commented Dec 4, 2020

The order of these two lines is incorrect in BayDoor:

            parentPart.removeChildPart(this); // sets parentPart to null.
            parentPart.addChildPart(missing);

Also messed up in Cubicle::remove.

@sixlettervariables
Copy link
Contributor

I'll fix that as part of my current PR to fix the stack overflow.

sixlettervariables added a commit that referenced this issue Dec 4, 2020
…epart-stackoverflow

Issues #2255 #2258: Fix Warehouse::removePart StackOverflowException with child parts and NRE with BayDoor/Cubicle parts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants