From fc5988adb28e47fa794a03f147354dcc6c70bb81 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Fri, 27 Feb 2026 03:36:10 +0100 Subject: [PATCH] fix crash when resetting the state after clearing the graph --- src/state.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state.cpp b/src/state.cpp index 0aaf776..2a9c773 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -81,13 +81,13 @@ auto StateManager::ResetState() -> void { } visited_states[current_state]++; total_moves = 0; - if (edited) { + if (edited || !states.contains(current_state)) { // We also need to clear the graph in case the state has been edited // because the graph could contain states that are impossible to reach // now. ClearGraph(); - edited = false; } + edited = false; } auto StateManager::PreviousPreset() -> void {