Skip to content

Fix Dazzle mode persisting when option is disabled (Fixes MekHQ #8700)#7959

Open
HammerGS wants to merge 1 commit intomainfrom
fix/8700-dazzle-mode-sticky
Open

Fix Dazzle mode persisting when option is disabled (Fixes MekHQ #8700)#7959
HammerGS wants to merge 1 commit intomainfrom
fix/8700-dazzle-mode-sticky

Conversation

@HammerGS
Copy link
Member

@HammerGS HammerGS commented Feb 5, 2026

Root Cause

LaserWeapon.adaptToGameOptions() added the "Dazzle" mode when the gothic_dazzle_mode option was enabled, but never removed it when disabled. This caused lasers to retain Dazzle mode even after unchecking the option.

Changes

  1. LaserWeapon.adaptToGameOptions() - Add else block to remove "Dazzle" and "Pulse Dazzle" modes when option is disabled

Files Changed

  • megamek/src/megamek/common/weapons/lasers/LaserWeapon.java - Add mode removal logic

Tested

  • Enable Dazzle option, start game, verify lasers have Dazzle mode
  • Disable Dazzle option, start new game, verify lasers no longer have Dazzle mode

Fixes MegaMek/mekhq#8700

Fixes MekHQ #8700

Root cause: LaserWeapon.adaptToGameOptions() added the "Dazzle" mode when
the gothic_dazzle_mode option was enabled, but never removed it when
disabled. This caused lasers to retain Dazzle mode even after unchecking
the option.

Fix: Add else block to remove "Dazzle" and "Pulse Dazzle" modes when the
option is disabled, following the same pattern used by other weapon modes
in Weapon.adaptToGameOptions().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@HammerGS HammerGS requested a review from a team as a code owner February 5, 2026 04:28
Copilot AI review requested due to automatic review settings February 5, 2026 04:28
@HammerGS HammerGS added AI Generated Fix AI-generated fix. Requires human testing and review before merging. AI ready for Review Indicates that is has been in game tested and is ready for review as it can be labels Feb 5, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where laser weapons retained Dazzle mode even after disabling the Gothic Dazzle Mode option. The root cause was that LaserWeapon.adaptToGameOptions() only added the modes when enabled but never removed them when disabled.

Changes:

  • Added else block to remove "Dazzle" and "Pulse Dazzle" modes when the Gothic Dazzle Mode option is disabled
  • Updated copyright year to 2026

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Fix AI-generated fix. Requires human testing and review before merging. AI ready for Review Indicates that is has been in game tested and is ready for review as it can be

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dazzle Option sticking on despite unchecking the box in both MHQ and MM

1 participant