From 69c90f9926f7d4b4e07ab53d69a2e3d15af5a165 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Sun, 6 Apr 2025 09:36:18 +0100 Subject: [PATCH] Use `Precision.AlmostEquals` to compare deviation lower bound (#32694) --- osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs index a667d12a44..98ab39eb24 100644 --- a/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs +++ b/osu.Game.Rulesets.Osu/Difficulty/OsuPerformanceCalculator.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using osu.Framework.Audio.Track; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Utils; using osu.Game.Beatmaps; using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Difficulty.Utils; @@ -409,7 +410,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty double limitValue = okHitWindow / Math.Sqrt(3); // If precision is not enough to compute true deviation - use limit value - if (pLowerBound == 0 || randomValue >= 1 || deviation > limitValue) + if (Precision.AlmostEquals(pLowerBound, 0.0) || randomValue >= 1 || deviation > limitValue) deviation = limitValue; // Then compute the variance for mehs.