bug(engine): auto-complete does not block player drag/tap input #71
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?
Summary
When auto-complete is running (
AutoCompleteState::active == true), the player can still start a drag or fire a tap-move. Both the auto-completeMoveRequestEventand the player-initiated one are processed in the same frame, which can corrupt the game state mid-sequence.Location
solitaire_engine/src/input_plugin.rs:start_drag(~line 571) — noAutoCompleteStatechecktouch_start_drag(~line 858) — noAutoCompleteStatecheckhandle_double_tap(~line 1500) — noAutoCompleteStatecheckSteps to reproduce
Fix
Add an early return in
start_drag,touch_start_drag, andhandle_double_tap:Severity
Medium — race condition during a common end-game animation.
Fix (commit
f444378)Added an
AutoCompleteStateearly-return guard to three input entry points so no player-initiated move can race with the auto-complete sequence:start_drag(mouse drag start)touch_start_drag(touch drag start)handle_double_tap(tap-to-move / tap-to-select)All three use
Option<Res<...>>so they degrade gracefully underMinimalPlugins(noAutoCompletePluginregistered). Whenactiveistrue, input is simply ignored — drag state is never dirtied and noMoveRequestEventis emitted — leaving the auto-complete sequence as the sole source of moves until the game is won.