mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Fix multiple instances of last hitobject time being calculated incorrectly
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
#nullable disable
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Beatmaps.Timing;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
@ -102,5 +103,16 @@ namespace osu.Game.Beatmaps
|
||||
addCombo(nested, ref combo);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find the absolute end time of the latest <see cref="HitObject"/> in a beatmap. Will throw if beatmap contains no objects.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This correctly accounts for rulesets which have concurrent hitobjects which may have durations, causing the .Last() object
|
||||
/// to not necessarily have the latest end time.
|
||||
///
|
||||
/// It's not super efficient so calls should be kept to a minimum.
|
||||
/// </remarks>
|
||||
public static double GetLastObjectTime(this IBeatmap beatmap) => beatmap.HitObjects.Max(h => h.GetEndTime());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user