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

Merge pull request #1557 from miterosan/Fix_osu_crashing_when_an_unknown_ruleset_is_selected_in_the_config

Fix osu crashing if a invalid gamerule is given in the game.ini
This commit is contained in:
Dean Herbert 2017-11-21 23:31:39 +09:00 committed by GitHub
commit 7c65048ae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,7 @@ namespace osu.Game
dependencies.Cache(this);
configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value);
Ruleset.Value = RulesetStore.GetRuleset(configRuleset.Value) ?? RulesetStore.AvailableRulesets.First();
Ruleset.ValueChanged += r => configRuleset.Value = r.ID ?? 0;
}