1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Merge pull request #16409 from smoogipoo/fix-most-common-beatlength

Ensure first control point starts at 0 in most common beat length calculation
This commit is contained in:
Dean Herbert 2022-01-11 15:16:58 +09:00 committed by GitHub
commit 070903f5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,8 +93,12 @@ namespace osu.Game.Beatmaps
if (t.Time > lastTime)
return (beatLength: t.BeatLength, 0);
// osu-stable forced the first control point to start at 0.
// This is reproduced here to maintain compatibility around osu!mania scroll speed and song select display.
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)