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

[0.50.02-SNAPSHOT] NPE When attempting to adjust damage value with "Tacops Energy Weapons" optional rule via Change Firing Mode button #6247

Open
7 tasks done
PhoenixHeart512 opened this issue Dec 6, 2024 · 1 comment · May be fixed by #6251
Assignees
Labels

Comments

@PhoenixHeart512
Copy link

Prerequisites and Pre-Issue Checklist

  • I'm reporting the issue to the correct repository:

  • MegaMek

  • MegaMekLab

  • MekHQ

  • I've tested the issue against at least the latest MILESTONE version

  • I've asked on the MegaMek Discord about the error

  • I've reviewed the BattleTech rules and MegaMek documentation, and I've confirmed that something isn't working as intended.

  • I've searched the Github tracker and haven't found the issue listed

Severity *

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

Brief Description *

When using the Tacops Energy Weapons optional rule, you change the damage/heat value of an energy weapon with the "Mode" button along the bottom (or with a keyboard hotkey), same button that is used to change UAC/RAC shot count.

On the latest nightly I get an NPE when it tries to divide by zero when attempting to lower the damage value of an energy weapon.

The RAC on my team is still able to successfully change the shot count, so this appears to only affect the energy weapons rule.

Log attached is mekHQ.log because the scenario was started from mekHQ, so that's where Megamek is doing its logging.

Steps to Reproduce

Attempt to change the damage value of an energy weapon with the "mode" button when the Tacops Energy Weapons optional rule is enabled.

Operating System *

Windows 10

Java Version *

Java Version: 17.0.6

MegaMek Suite Version *

Free Text (type manually)

Custom MegaMek Version

megamek.MegaMek.initializeLogging(MegaMek.java:146) - Starting MegaMek v0.50.02-SNAPSHOT Build Date: 2024-12-05T03:35:15.305805536 Today: 2024-12-06 Origin Project: MegaMekLab Java Vendor: Eclipse Adoptium Java Version: 17.0.6 Platform: Windows 10 10.0 (amd64) System Locale: en_US Total memory available to MegaMek: 4 GB MM Code Revision: 65a4651 MML Code Revision: 97444ab86cff224d0ac82377932d42eb472b447b MHQ Code Revision: 3d3fc7ce4a9f2b44347d4faf0efabad71ad900e4

Attach Files

TacopsEnergyWeapons.zip

Final Checklist

  • I've checked to make sure that this issue has not already been filed
  • I'm reporting only one issue in this ticket for clarity and focus
@HammerGS HammerGS added the Bug label Dec 6, 2024
@HammerGS
Copy link
Member

HammerGS commented Dec 6, 2024

mekhq.MekHQ.lambda$main$1(MekHQ.java:293) - Uncaught java.lang.ArithmeticException detected. Please open up an issue containing all logs, the game save file, and customs at https://github.com/MegaMek/megamek/issues . If Sentry is enabled, the error has also been logged.
java.lang.ArithmeticException: / by zero
	at megamek.common.Mounted.switchMode(Mounted.java:296)
	at megamek.client.ui.swing.FiringDisplay.changeMode(FiringDisplay.java:599)
	at megamek.client.ui.swing.FiringDisplay.lambda$registerKeyCommands$10(FiringDisplay.java:330)
	at megamek.client.ui.swing.util.MegaMekController$1.performAction(MegaMekController.java:204)
	at megamek.client.ui.swing.util.MegaMekController.dispatchKeyEvent(MegaMekController.java:132)

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