Fix two implementation oversights

This commit is contained in:
Dean Herbert 2022-12-02 16:05:14 +09:00
parent d8dd7e7e0f
commit 809d02cda0
2 changed files with 6 additions and 4 deletions

View File

@ -81,12 +81,14 @@ public Beatmap()
public double GetMostCommonBeatLength()
{
if (!HitObjects.Any())
return ControlPointInfo.TimingPoints.LastOrDefault()?.Time ?? 0;
double lastTime;
// The last playable time in the beatmap - the last timing point extends to this time.
// Note: This is more accurate and may present different results because osu-stable didn't have the ability to calculate slider durations in this context.
double lastTime = this.GetLastObjectTime();
if (!HitObjects.Any())
lastTime = ControlPointInfo.TimingPoints.LastOrDefault()?.Time ?? 0;
else
lastTime = this.GetLastObjectTime();
var mostCommon =
// Construct a set of (beatLength, duration) tuples for each individual timing point.

View File

@ -114,7 +114,7 @@ private void load()
break;
}
double lastObjectTime = Beatmap.HitObjects.Any() ? Beatmap.GetLastObjectTime() : 0;
double lastObjectTime = Beatmap.HitObjects.Any() ? Beatmap.GetLastObjectTime() : double.MaxValue;
double baseBeatLength = TimingControlPoint.DEFAULT_BEAT_LENGTH;
if (RelativeScaleBeatLengths)