mirror of https://github.com/ppy/osu
Avoid doing any re-fetch on beatmap from test scenes
This commit is contained in:
parent
b33d5e7a7a
commit
a639132825
|
@ -286,11 +286,10 @@ public WorkingBeatmap GetWorkingBeatmap(BeatmapInfo beatmapInfo, WorkingBeatmap
|
|||
{
|
||||
if (beatmapInfo?.ID > 0 && previous != null && previous.BeatmapInfo?.ID == beatmapInfo.ID)
|
||||
return previous;
|
||||
|
||||
if (beatmapInfo?.BeatmapSet == null || beatmapInfo == DefaultBeatmap?.BeatmapInfo)
|
||||
return DefaultBeatmap;
|
||||
|
||||
if (beatmapInfo.BeatmapSet.Files == null)
|
||||
if (beatmapInfo.BeatmapSet.Files == null || beatmapInfo.ID == 0)
|
||||
{
|
||||
var info = beatmapInfo;
|
||||
beatmapInfo = QueryBeatmap(b => b.ID == info.ID);
|
||||
|
|
|
@ -497,7 +497,11 @@ public override bool OnExiting(IScreen next)
|
|||
ApplyToBackground(b => b.FadeColour(Color4.White, 500));
|
||||
resetTrack();
|
||||
|
||||
Beatmap.Value = beatmapManager.GetWorkingBeatmap(Beatmap.Value.BeatmapInfo);
|
||||
var refetchedBeatmap = beatmapManager.GetWorkingBeatmap(Beatmap.Value.BeatmapInfo);
|
||||
|
||||
// beatmap re-fetch may not be feasible in tests.
|
||||
if (!(refetchedBeatmap is DummyWorkingBeatmap))
|
||||
Beatmap.Value = refetchedBeatmap;
|
||||
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue