From e4f25fc4d49bfd0d91f764c4b54a68c4671404d6 Mon Sep 17 00:00:00 2001 From: sw1tchbl4d3 Date: Wed, 26 Oct 2022 16:42:00 +0200 Subject: [PATCH] Don't overwrite special precision legacy difficulty points --- osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs index c9ee63424c..b1383c9e85 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs @@ -10,6 +10,7 @@ using System.IO; using System.Linq; using System.Text; using JetBrains.Annotations; +using osu.Framework.Utils; using osu.Game.Audio; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Beatmaps.Legacy; @@ -190,7 +191,14 @@ namespace osu.Game.Beatmaps.Formats extractSampleControlPoints(beatmap.HitObjects); foreach (var point in legacyControlPoints.EffectPoints) + { + DifficultyControlPoint difficultyPoint = legacyControlPoints.DifficultyPointAt(point.Time); + + if (Precision.AlmostEquals(difficultyPoint.SliderVelocity, point.ScrollSpeed, acceptableDifference: point.ScrollSpeedBindable.Precision)) + continue; + legacyControlPoints.Add(point.Time, new DifficultyControlPoint { SliderVelocity = point.ScrollSpeed }); + } foreach (var group in legacyControlPoints.Groups) {