1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Sort hitobjects imported from legacy beatmps

Apaprently some ranked maps contain unordered hitobjects. We probably never want to allow for this.
This commit is contained in:
Dean Herbert 2018-02-28 17:40:04 +09:00
parent 6f44db6de0
commit 968291c61e

View File

@ -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);
}