From ca92a7819774e404b5843109e6797fb391c02794 Mon Sep 17 00:00:00 2001 From: Asriel Camora Date: Wed, 15 Nov 2023 00:12:35 -0800 Subject: [PATCH] Restart RecipeNote solving if it was stopped halfway through --- Craftimizer/Windows/RecipeNote.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Craftimizer/Windows/RecipeNote.cs b/Craftimizer/Windows/RecipeNote.cs index fcc4895..c80a3d8 100644 --- a/Craftimizer/Windows/RecipeNote.cs +++ b/Craftimizer/Windows/RecipeNote.cs @@ -102,6 +102,11 @@ public sealed unsafe class RecipeNote : Window, IDisposable { if (wasOpen) BestMacroTokenSource?.Cancel(); + else + { + if (!BestSuggestedMacro.HasValue && CraftStatus == CraftableStatus.OK && BestMacroTokenSource == null) + CalculateBestMacros(); + } } wasOpen = isOpen; @@ -172,7 +177,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable statsChanged = true; } - if ((statsChanged || (BestMacroTokenSource?.IsCancellationRequested ?? false)) && CraftStatus == CraftableStatus.OK) + if (statsChanged && CraftStatus == CraftableStatus.OK) CalculateBestMacros(); return true;