From d2f0a921ca1e7c3b2b6bd12b88c7a5e7b89e6d01 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 28 Nov 2018 20:41:48 +0900 Subject: [PATCH] Fix lookups by beatmapinfo failing for imports of existing sores --- osu.Game/OsuGame.cs | 6 ++++-- osu.Game/Scoring/ScoreStore.cs | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index eef384ba6f..830cefc58c 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -267,7 +267,9 @@ namespace osu.Game return; } - if (scoreInfo.BeatmapInfo == null) + var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == scoreInfo.BeatmapInfo.ID); + + if (databasedBeatmap == null) { notifications.Post(new SimpleNotification { @@ -279,7 +281,7 @@ namespace osu.Game ruleset.Value = scoreInfo.Ruleset; - Beatmap.Value = BeatmapManager.GetWorkingBeatmap(scoreInfo.BeatmapInfo); + Beatmap.Value = BeatmapManager.GetWorkingBeatmap(databasedBeatmap); Beatmap.Value.Mods.Value = scoreInfo.Mods; menu.Push(new PlayerLoader(new ReplayPlayer(ScoreManager.GetScore(scoreInfo).Replay))); diff --git a/osu.Game/Scoring/ScoreStore.cs b/osu.Game/Scoring/ScoreStore.cs index 0d32e2ebc7..eeef9894bf 100644 --- a/osu.Game/Scoring/ScoreStore.cs +++ b/osu.Game/Scoring/ScoreStore.cs @@ -16,6 +16,9 @@ namespace osu.Game.Scoring } protected override IQueryable AddIncludesForConsumption(IQueryable query) - => base.AddIncludesForConsumption(query).Include(s => s.Files).ThenInclude(f => f.FileInfo); + => base.AddIncludesForConsumption(query) + .Include(s => s.Files).ThenInclude(f => f.FileInfo) + .Include(s => s.BeatmapInfo) + .Include(s => s.Ruleset); } }