1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:43:21 +08:00

Ensure there's a buffer after the last hitobject to allow certain replay tests to complete correctly

This commit is contained in:
Dean Herbert 2020-10-05 13:29:36 +09:00
parent a8cbd400d3
commit 21bf93a7c2

View File

@ -226,16 +226,18 @@ namespace osu.Game.Tests.Visual
public ClockBackedTestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio) public ClockBackedTestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio)
: base(beatmap, storyboard, audio) : base(beatmap, storyboard, audio)
{ {
double lastObjectTime = beatmap.HitObjects.LastOrDefault()?.GetEndTime() ?? 60000; var lastHitObject = beatmap.HitObjects.LastOrDefault();
double trackLength = lastHitObject?.GetEndTime() + 2000 ?? 60000;
if (referenceClock != null) if (referenceClock != null)
{ {
store = new TrackVirtualStore(referenceClock); store = new TrackVirtualStore(referenceClock);
audio.AddItem(store); audio.AddItem(store);
track = store.GetVirtual(lastObjectTime); track = store.GetVirtual(trackLength);
} }
else else
track = audio?.Tracks.GetVirtual(lastObjectTime); track = audio?.Tracks.GetVirtual(trackLength);
} }
~ClockBackedTestWorkingBeatmap() ~ClockBackedTestWorkingBeatmap()