1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 23:43:03 +08:00

Use time=0 as for the first control point

This commit is contained in:
Dan Balasescu 2022-01-11 12:55:12 +09:00
parent e333831c45
commit 81fed4c6bf

View File

@ -93,8 +93,10 @@ namespace osu.Game.Beatmaps
if (t.Time > lastTime)
return (beatLength: t.BeatLength, 0);
double currentTime = i == 0 ? 0 : t.Time;
double nextTime = i == ControlPointInfo.TimingPoints.Count - 1 ? lastTime : ControlPointInfo.TimingPoints[i + 1].Time;
return (beatLength: t.BeatLength, duration: nextTime - t.Time);
return (beatLength: t.BeatLength, duration: nextTime - currentTime);
})
// Aggregate durations into a set of (beatLength, duration) tuples for each beat length
.GroupBy(t => Math.Round(t.beatLength * 1000) / 1000)