1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Use non-zero length for fallback virtual track (allows tests to work as expected)

This commit is contained in:
Dean Herbert 2020-02-09 21:34:56 +09:00
parent c1f52ef594
commit 96574a98ad

View File

@ -39,7 +39,7 @@ namespace osu.Game.Beatmaps
BeatmapSetInfo = beatmapInfo.BeatmapSet;
Metadata = beatmapInfo.Metadata ?? BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
track = new RecyclableLazy<Track>(() => GetTrack() ?? GetVirtualTrack());
track = new RecyclableLazy<Track>(() => GetTrack() ?? GetVirtualTrack(1000));
background = new RecyclableLazy<Texture>(GetBackground, BackgroundStillValid);
waveform = new RecyclableLazy<Waveform>(GetWaveform);
storyboard = new RecyclableLazy<Storyboard>(GetStoryboard);
@ -48,7 +48,7 @@ namespace osu.Game.Beatmaps
total_count.Value++;
}
protected virtual Track GetVirtualTrack()
protected virtual Track GetVirtualTrack(double emptyLength = 0)
{
const double excess_length = 1000;
@ -59,7 +59,7 @@ namespace osu.Game.Beatmaps
switch (lastObject)
{
case null:
length = 0;
length = emptyLength;
break;
case IHasEndTime endTime: