Replay backward step decrements cursor before undo is applied — cursor/state mismatch and rapid-click divergence #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File
solitaire_engine/src/replay_playback.rslines 328–329Description
The cursor is decremented immediately, but
handle_undoonly applies the undo the following frame. For one frame the overlay showscursor = N-1while the cards are still in position N — the move log, scrub fill, and "MOVE N/M" counter all show the wrong state, producing a visible flicker.Worse: if the player clicks the backwards button multiple times in a single frame, multiple cursor decrements accumulate before any undo fires, permanently diverging the cursor from the actual game history.
Fix
Either decrement the cursor only after confirming the undo was applied (via
StateChangedEvent), or debounce to allow at most one backward step per frame.