mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 11:27:24 +08:00
Fix track transfer not running when beatmap is retrieved from c… (#5296)
Fix track transfer not running when beatmap is retrieved from cache
This commit is contained in:
commit
72da615dde
@ -181,19 +181,18 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
lock (workingCache)
|
lock (workingCache)
|
||||||
{
|
{
|
||||||
var cached = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
|
var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
|
||||||
|
|
||||||
if (cached != null)
|
|
||||||
return cached;
|
|
||||||
|
|
||||||
|
if (working == null)
|
||||||
|
{
|
||||||
if (beatmapInfo.Metadata == null)
|
if (beatmapInfo.Metadata == null)
|
||||||
beatmapInfo.Metadata = beatmapInfo.BeatmapSet.Metadata;
|
beatmapInfo.Metadata = beatmapInfo.BeatmapSet.Metadata;
|
||||||
|
|
||||||
WorkingBeatmap working = new BeatmapManagerWorkingBeatmap(Files.Store, new LargeTextureStore(host?.CreateTextureLoaderStore(Files.Store)), beatmapInfo, audioManager);
|
workingCache.Add(working = new BeatmapManagerWorkingBeatmap(Files.Store,
|
||||||
|
new LargeTextureStore(host?.CreateTextureLoaderStore(Files.Store)), beatmapInfo, audioManager));
|
||||||
|
}
|
||||||
|
|
||||||
previous?.TransferTo(working);
|
previous?.TransferTo(working);
|
||||||
workingCache.Add(working);
|
|
||||||
|
|
||||||
return working;
|
return working;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user