Fix Godlet Printer double-click bug causing game freeze (v2)#2836
Draft
CyrilBird wants to merge 1 commit intoFreezingMoon:masterfrom
Draft
Fix Godlet Printer double-click bug causing game freeze (v2)#2836CyrilBird wants to merge 1 commit intoFreezingMoon:masterfrom
CyrilBird wants to merge 1 commit intoFreezingMoon:masterfrom
Conversation
…#2775) ## Problem When Dark Priest is active, double-clicking the Godlet Printer button or pressing the R hotkey during location picking caused the ability to get stuck, freezing the game until manually deselected. ## Root Cause When `materializeInProgress` flag was set to prevent re-entrancy, it was only cleared in `fnOnCancel` and `fnOnConfirm` callbacks. However, if the user cancelled the ability via: - Clicking the ability button again - Pressing the R hotkey - Pressing Esc The `selectAbility(-1)` was called, which calls `queryMove()` to clean up the temp creature, but the `materializeInProgress` flag was never reset. This caused subsequent materialize attempts to be silently ignored. ## Solution 1. Added `materializeInProgress` flag in UI class to prevent re-entrancy 2. Guard at the start of `materialize()` to return early if already in progress 3. **Key fix**: Reset `materializeInProgress` in `selectAbility(-1)` to handle cancellation via ability button/hotkey 4. Proper cleanup of temporary creature on both cancel and confirm paths ## Testing - Verified build succeeds - All existing tests pass (84 tests) - Fix addresses both button clicks and hotkey triggers Fixes FreezingMoon#2775 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
|
@CyrilBird is attempting to deploy a commit to the FreezingMoon Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
|
@CyrilBird Issue still not fixed. This time big materialize button under cards works fine after bumping into the issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2775: Godlet Printer selected but inactive
Problem
When Dark Priest is active, double-clicking the Godlet Printer button or pressing the R hotkey during location picking caused the ability to get stuck, freezing the game until manually deselected.
Root Cause
When
materializeInProgressflag was set to prevent re-entrancy, it was only cleared infnOnCancelandfnOnConfirmcallbacks. However, if the user cancelled the ability via:The
selectAbility(-1)was called, which callsqueryMove()to clean up the temp creature, but thematerializeInProgressflag was never reset. This caused subsequent materialize attempts to be silently ignored.Solution
materializeInProgressflag in UI class to prevent re-entrancymaterialize()to return early if already in progressmaterializeInProgressinselectAbility(-1)to handle cancellation via ability button/hotkeyChanges
src/ui/interface.ts: AddedmaterializeInProgressflag and reset it inselectAbility(-1)src/abilities/Dark-Priest.ts: Added re-entrancy guard and temp creature cleanupDifference from PR #2835
The previous PR (#2835) only reset
materializeInProgressinfnOnCancelandfnOnConfirm, which didn't cover the case where the user cancels via ability button or hotkey. This PR adds the reset inselectAbility(-1)to cover all cancellation paths.Testing
Generated with Claude Code
via Happy