From 8ce96052bf2e9918cd79d8f554d8867ae64ee12e Mon Sep 17 00:00:00 2001 From: Asriel Camora Date: Mon, 2 Dec 2024 22:29:18 -0800 Subject: [PATCH] Fix Optimal solver when MaxQuality == 0 --- Solver/Solver.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Solver/Solver.cs b/Solver/Solver.cs index 18d5ec8..9e5b437 100644 --- a/Solver/Solver.cs +++ b/Solver/Solver.cs @@ -224,8 +224,8 @@ public sealed class Solver : IDisposable Token.ThrowIfCancellationRequested(); } - - if (solution == null || ExecuteActions(solution).HQPercent != 100) + var state = solution != null ? (SimulationState?)ExecuteActions(solution) : null; + if (solution == null || state?.Quality != state?.Input.Recipe.MaxQuality) { Raphael.SolverConfig config = new() {