From 6f65d64779a2fe69f8e2772a1257348eb58a7f47 Mon Sep 17 00:00:00 2001 From: WilliamQiufeng Date: Sat, 17 Aug 2024 14:05:51 +0800 Subject: [PATCH] Return difficulty 0 when StrainSolverData is empty --- .../Difficulty/Rulesets/Keys/DifficultyProcessorKeys.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Quaver.API/Maps/Processors/Difficulty/Rulesets/Keys/DifficultyProcessorKeys.cs b/Quaver.API/Maps/Processors/Difficulty/Rulesets/Keys/DifficultyProcessorKeys.cs index 467eb6739..932c6137d 100644 --- a/Quaver.API/Maps/Processors/Difficulty/Rulesets/Keys/DifficultyProcessorKeys.cs +++ b/Quaver.API/Maps/Processors/Difficulty/Rulesets/Keys/DifficultyProcessorKeys.cs @@ -541,6 +541,10 @@ private void ComputeForPatternFlags() /// private float CalculateOverallDifficulty() { + // When the map has only scratch key notes, StrainSolverData would be empty, so we return 0 + if (StrainSolverData.Count == 0) + return 0; + float calculatedDiff; // Solve strain value of every data point