1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 13:15:08 +08:00

Add ruleset fallback logic into cache lookup class

This commit is contained in:
Dean Herbert 2020-11-06 16:58:53 +09:00
parent d3a303e251
commit f51cb0dd14

View File

@ -273,7 +273,8 @@ namespace osu.Game.Beatmaps
public DifficultyCacheLookup([NotNull] BeatmapInfo beatmap, [NotNull] RulesetInfo ruleset, IEnumerable<Mod> mods)
{
Beatmap = beatmap;
Ruleset = ruleset;
// In the case that the user hasn't given us a ruleset, use the beatmap's default ruleset.
Ruleset = ruleset ?? Beatmap.Ruleset;
OrderedMods = mods?.OrderBy(m => m.Acronym).ToArray() ?? Array.Empty<Mod>();
}