Merge pull request #4116 from ekrctb/fix-import-beatmap-completion-notification-click

Fix PresentBeatmap not working for unsubmitted beatmap set
This commit is contained in:
Dean Herbert 2019-01-22 16:48:22 +09:00 committed by GitHub
commit 55fb401532
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,13 +221,18 @@ namespace osu.Game
return;
}
var databasedSet = BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID);
var databasedSet = beatmap.OnlineBeatmapSetID != null ?
BeatmapManager.QueryBeatmapSet(s => s.OnlineBeatmapSetID == beatmap.OnlineBeatmapSetID) :
BeatmapManager.QueryBeatmapSet(s => s.Hash == beatmap.Hash);
// Use first beatmap available for current ruleset, else switch ruleset.
var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First();
if (databasedSet != null)
{
// Use first beatmap available for current ruleset, else switch ruleset.
var first = databasedSet.Beatmaps.Find(b => b.Ruleset == ruleset.Value) ?? databasedSet.Beatmaps.First();
ruleset.Value = first.Ruleset;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first);
ruleset.Value = first.Ruleset;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(first);
}
}
switch (currentScreen)