From 968291c61e03fae8856b229bea678fd3c18562a9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Feb 2018 17:40:04 +0900 Subject: [PATCH] Sort hitobjects imported from legacy beatmps Apaprently some ranked maps contain unordered hitobjects. We probably never want to allow for this. --- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 3847787a4c..3e7b36f324 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -42,6 +42,10 @@ namespace osu.Game.Beatmaps.Formats ParseContent(stream); + // objects may be out of order *only* if a user has manually edited an .osu file. + // unfortunately there are ranked maps in this state (example: https://osu.ppy.sh/s/594828). + this.beatmap.HitObjects.Sort((x, y) => x.StartTime.CompareTo(y.StartTime)); + foreach (var hitObject in this.beatmap.HitObjects) hitObject.ApplyDefaults(this.beatmap.ControlPointInfo, this.beatmap.BeatmapInfo.BaseDifficulty); }