From db8b72eb37464d50ec5092f7180082507e7fc2b0 Mon Sep 17 00:00:00 2001 From: Aurelian Date: Mon, 20 May 2024 16:23:16 +0200 Subject: [PATCH] Clamped Difficulty Ranges to [0,10] --- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 6fa78fa8e6..059451e228 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -383,21 +383,24 @@ namespace osu.Game.Beatmaps.Formats switch (pair.Key) { case @"HPDrainRate": - difficulty.DrainRate = Parsing.ParseFloat(pair.Value); + difficulty.DrainRate = Math.Clamp(Parsing.ParseFloat(pair.Value), 0, 10); break; case @"CircleSize": difficulty.CircleSize = Parsing.ParseFloat(pair.Value); + //If the mode is not Mania, clamp circle size to [0,10] + if (!beatmap.BeatmapInfo.Ruleset.OnlineID.Equals(3)) + difficulty.CircleSize = Math.Clamp(difficulty.CircleSize, 0, 10); break; case @"OverallDifficulty": - difficulty.OverallDifficulty = Parsing.ParseFloat(pair.Value); + difficulty.OverallDifficulty = Math.Clamp(Parsing.ParseFloat(pair.Value), 0, 10); if (!hasApproachRate) difficulty.ApproachRate = difficulty.OverallDifficulty; break; case @"ApproachRate": - difficulty.ApproachRate = Parsing.ParseFloat(pair.Value); + difficulty.ApproachRate = Math.Clamp(Parsing.ParseFloat(pair.Value), 0, 10); hasApproachRate = true; break;