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

NPE when clicking on a mech #5483

Closed
BlueThing00 opened this issue May 17, 2024 · 3 comments · Fixed by #5485
Closed

NPE when clicking on a mech #5483

BlueThing00 opened this issue May 17, 2024 · 3 comments · Fixed by #5485
Assignees
Labels

Comments

@BlueThing00
Copy link

BlueThing00 commented May 17, 2024

Environment

MegaMek 49.19.1
Windows 10
Java Version: 11.0.16

Description

I was fighting a Stratcon battle sent from MekHQ. I started it this morning. I completed the movement phase I was partway through; when I clicked on one of my mechs (I think the Grasshopper) during the shooting phase I got a NPE.

From the log:

15:02:01,091 ERROR [megamek.client.Client] {AWT-EventQueue-0}
megamek.client.Client.handlePacket(Client.java:1712) - Failed to parse Packet command TURN
java.lang.NullPointerException
at megamek.common.IdealHex.get(IdealHex.java:112)
at megamek.common.Coords.radian(Coords.java:236)
at megamek.common.Coords.degree(Coords.java:261)
at megamek.common.Compute.isInArc(Compute.java:4054)
at megamek.common.Compute.isInArc(Compute.java:4020)
at megamek.common.actions.SearchlightAttackAction.isPossible(SearchlightAttackAction.java:68)
at megamek.client.ui.swing.FiringDisplay.updateSearchlight(FiringDisplay.java:2344)
at megamek.client.ui.swing.FiringDisplay.updateTarget(FiringDisplay.java:2011)
at megamek.client.ui.swing.FiringDisplay.target(FiringDisplay.java:1904)
at megamek.client.ui.swing.FiringDisplay.selectEntity(FiringDisplay.java:812)
at megamek.client.ui.swing.FiringDisplay.beginMyTurn(FiringDisplay.java:870)
at megamek.client.ui.swing.FiringDisplay.gameTurnChange(FiringDisplay.java:2216)
at megamek.common.event.GameTurnChangeEvent.fireEvent(GameTurnChangeEvent.java:46)
at megamek.common.Game.processGameEvent(Game.java:3001)
at megamek.common.Game.setTurnIndex(Game.java:650)
at megamek.client.Client.changeTurnIndex(Client.java:516)
at megamek.client.Client.handlePacket(Client.java:1528)
at megamek.client.Client$1.lambda$packetReceived$0(Client.java:177)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Files

Logs:
megamek.log
mekhq.log

Battle save:
autosave.sav.gz

Unit files:
Meks.zip

Campaign save:
Bluethings30260529.cpnx.gz

I didn't upload portrait files or custom paint. Let me know if those are needed.

@HammerGS
Copy link
Member

15:02:01,091 ERROR [megamek.client.Client] {AWT-EventQueue-0}
megamek.client.Client.handlePacket(Client.java:1712) - Failed to parse Packet command TURN
java.lang.NullPointerException
at megamek.common.IdealHex.get(IdealHex.java:112)
at megamek.common.Coords.radian(Coords.java:236)
at megamek.common.Coords.degree(Coords.java:261)
at megamek.common.Compute.isInArc(Compute.java:4054)
at megamek.common.Compute.isInArc(Compute.java:4020)
at megamek.common.actions.SearchlightAttackAction.isPossible(SearchlightAttackAction.java:68)
at megamek.client.ui.swing.FiringDisplay.updateSearchlight(FiringDisplay.java:2344)
at megamek.client.ui.swing.FiringDisplay.updateTarget(FiringDisplay.java:2011)
at megamek.client.ui.swing.FiringDisplay.target(FiringDisplay.java:1904)
at megamek.client.ui.swing.FiringDisplay.selectEntity(FiringDisplay.java:812)
at megamek.client.ui.swing.FiringDisplay.beginMyTurn(FiringDisplay.java:870)
at megamek.client.ui.swing.FiringDisplay.gameTurnChange(FiringDisplay.java:2216)
at megamek.common.event.GameTurnChangeEvent.fireEvent(GameTurnChangeEvent.java:46)
at megamek.common.Game.processGameEvent(Game.java:3001)
at megamek.common.Game.setTurnIndex(Game.java:650)
at megamek.client.Client.changeTurnIndex(Client.java:516)
at megamek.client.Client.handlePacket(Client.java:1528)
at megamek.client.Client$1.lambda$packetReceived$0(Client.java:177)

@HammerGS HammerGS added the Bug label May 17, 2024
@BlueThing00
Copy link
Author

I just reproduced this by starting the battle from the saved game, moving units, and clicking on the Grasshopper in the shooting phase.

@Sleet01 Sleet01 self-assigned this May 17, 2024
@Sleet01
Copy link
Collaborator

Sleet01 commented May 17, 2024

I'll take it, just on the off-chance that the SearchlightAttackAction connection is not a coincidence...

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

Successfully merging a pull request may close this issue.

3 participants