From b8824a41b583453e7ac6656b0f7e69028cb761fe Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 14 Aug 2018 11:44:53 +0900 Subject: [PATCH] Fix certain control points not being replaced --- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 26f28c86ca..29be751de2 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -354,6 +354,11 @@ private void handleTimingPoint(string line) private void handleTimingControlPoint(TimingControlPoint newPoint) { + var existing = beatmap.ControlPointInfo.TimingPointAt(newPoint.Time); + + if (existing.Time == newPoint.Time) + beatmap.ControlPointInfo.TimingPoints.Remove(existing); + beatmap.ControlPointInfo.TimingPoints.Add(newPoint); } @@ -364,7 +369,9 @@ private void handleDifficultyControlPoint(DifficultyControlPoint newPoint) if (newPoint.EquivalentTo(existing)) return; - beatmap.ControlPointInfo.DifficultyPoints.RemoveAll(x => x.Time == newPoint.Time); + if (existing.Time == newPoint.Time) + beatmap.ControlPointInfo.DifficultyPoints.Remove(existing); + beatmap.ControlPointInfo.DifficultyPoints.Add(newPoint); } @@ -375,6 +382,9 @@ private void handleEffectControlPoint(EffectControlPoint newPoint) if (newPoint.EquivalentTo(existing)) return; + if (existing.Time == newPoint.Time) + beatmap.ControlPointInfo.EffectPoints.Remove(existing); + beatmap.ControlPointInfo.EffectPoints.Add(newPoint); } @@ -385,6 +395,9 @@ private void handleSampleControlPoint(SampleControlPoint newPoint) if (newPoint.EquivalentTo(existing)) return; + if (existing.Time == newPoint.Time) + beatmap.ControlPointInfo.SamplePoints.Remove(existing); + beatmap.ControlPointInfo.SamplePoints.Add(newPoint); }