1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:07:25 +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:
Dean Herbert 2019-07-11 22:53:07 +09:00 committed by GitHub
commit 72da615dde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,19 +181,18 @@ namespace osu.Game.Beatmaps
lock (workingCache)
{
var cached = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
if (cached != null)
return cached;
var working = workingCache.FirstOrDefault(w => w.BeatmapInfo?.ID == beatmapInfo.ID);
if (working == null)
{
if (beatmapInfo.Metadata == null)
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);
workingCache.Add(working);
return working;
}
}