mirror of
https://github.com/ppy/osu.git
synced 2025-03-10 22:17:20 +08:00
Fix drain length calculation helper method being able to return negative durations
This is the principal failure behind https://github.com/ppy/osu-server-beatmap-submission/issues/40.
This commit is contained in:
parent
0a50fb1dfa
commit
87fb8da351
@ -161,7 +161,7 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// Find the total milliseconds between the first and last hittable objects, excluding any break time.
|
||||
/// </summary>
|
||||
public static double CalculateDrainLength(this IBeatmap beatmap) => CalculatePlayableLength(beatmap.HitObjects) - beatmap.TotalBreakTime;
|
||||
public static double CalculateDrainLength(this IBeatmap beatmap) => Math.Max(CalculatePlayableLength(beatmap.HitObjects) - beatmap.TotalBreakTime, 0);
|
||||
|
||||
/// <summary>
|
||||
/// Find the timestamps in milliseconds of the start and end of the playable region.
|
||||
|
Loading…
x
Reference in New Issue
Block a user