1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:12:57 +08:00

Account for potentially longer non-last objects

This commit is contained in:
Dean Herbert 2020-10-05 14:04:04 +09:00
parent 21bf93a7c2
commit 4b81880655

View File

@ -226,9 +226,11 @@ namespace osu.Game.Tests.Visual
public ClockBackedTestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio)
: base(beatmap, storyboard, audio)
{
var lastHitObject = beatmap.HitObjects.LastOrDefault();
double trackLength = 60000;
double trackLength = lastHitObject?.GetEndTime() + 2000 ?? 60000;
if (beatmap.HitObjects.Count > 0)
// add buffer after last hitobject to allow for final replay frames etc.
trackLength = beatmap.HitObjects.Max(h => h.GetEndTime()) + 2000;
if (referenceClock != null)
{