[critical] Space/D keys fire DrawRequestEvent during replay playback #8
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/input_plugin.rslines 241–244Description
handle_keyboard_coreemitsDrawRequestEventonSpace(and the D-key draw path) with no guard for active replay playback.handle_pause_keyboardinreplay_overlay.rshandles the sameSpacekey to toggle pause — both systems run in the sameUpdateschedule with no ordering between them.Pressing
Spaceduring a replay simultaneously toggles the pause state and fires aDrawRequestEventintohandle_draw, which mutatesGameStateResource. This breaks replay determinism — the recorded move sequence diverges from what the engine is executing.Fix
Add
if replay_state.is_some_and(|s| s.is_active()) { return; }at the top ofhandle_keyboard_core, or gate the draw path on replay not being active.