mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 19:23:51 +08:00
Use non-zero length for fallback virtual track (allows tests to work as expected)
This commit is contained in:
parent
c1f52ef594
commit
96574a98ad
@ -39,7 +39,7 @@ namespace osu.Game.Beatmaps
|
|||||||
BeatmapSetInfo = beatmapInfo.BeatmapSet;
|
BeatmapSetInfo = beatmapInfo.BeatmapSet;
|
||||||
Metadata = beatmapInfo.Metadata ?? BeatmapSetInfo?.Metadata ?? new BeatmapMetadata();
|
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);
|
background = new RecyclableLazy<Texture>(GetBackground, BackgroundStillValid);
|
||||||
waveform = new RecyclableLazy<Waveform>(GetWaveform);
|
waveform = new RecyclableLazy<Waveform>(GetWaveform);
|
||||||
storyboard = new RecyclableLazy<Storyboard>(GetStoryboard);
|
storyboard = new RecyclableLazy<Storyboard>(GetStoryboard);
|
||||||
@ -48,7 +48,7 @@ namespace osu.Game.Beatmaps
|
|||||||
total_count.Value++;
|
total_count.Value++;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual Track GetVirtualTrack()
|
protected virtual Track GetVirtualTrack(double emptyLength = 0)
|
||||||
{
|
{
|
||||||
const double excess_length = 1000;
|
const double excess_length = 1000;
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ namespace osu.Game.Beatmaps
|
|||||||
switch (lastObject)
|
switch (lastObject)
|
||||||
{
|
{
|
||||||
case null:
|
case null:
|
||||||
length = 0;
|
length = emptyLength;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IHasEndTime endTime:
|
case IHasEndTime endTime:
|
||||||
|
Loading…
Reference in New Issue
Block a user