Auto-complete deactivates mid-sequence when is_auto_completable is transiently false #15

Closed
opened 2026-05-19 18:43:04 +00:00 by funman300 · 0 comments
Owner

File

solitaire_engine/src/auto_complete_plugin.rs lines 72–77

Description

The deactivation branch sets state.active = false whenever is_auto_completable is false — including mid-sequence:

} else if !game.0.is_auto_completable {
    state.active = false;
}

If the game engine transiently clears is_auto_completable while a move is in-flight (the comment at line 121 acknowledges next_auto_complete_move() can return None on a race), the auto-complete sequence hard-stops and never restarts, even though the game is not won and the sequence is not done. There is no "was already active" guard in the deactivation branch.

Fix

Only deactivate when the game is won or a new game starts, not on every frame where is_auto_completable is transiently false.

## File `solitaire_engine/src/auto_complete_plugin.rs` lines 72–77 ## Description The deactivation branch sets `state.active = false` whenever `is_auto_completable` is false — including mid-sequence: ```rust } else if !game.0.is_auto_completable { state.active = false; } ``` If the game engine transiently clears `is_auto_completable` while a move is in-flight (the comment at line 121 acknowledges `next_auto_complete_move()` can return `None` on a race), the auto-complete sequence hard-stops and never restarts, even though the game is not won and the sequence is not done. There is no "was already active" guard in the deactivation branch. ## Fix Only deactivate when the game is won or a new game starts, not on every frame where `is_auto_completable` is transiently false.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: funman300/Ferrous-Solitaire#15