mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:23:20 +08:00
Ensure mods are always in a valid state at a game level
This commit is contained in:
parent
ead8262257
commit
425dc8a210
@ -468,6 +468,12 @@ namespace osu.Game
|
||||
private void modsChanged(ValueChangedEvent<IReadOnlyList<Mod>> mods)
|
||||
{
|
||||
updateModDefaults();
|
||||
|
||||
if (!ModUtils.CheckValidForGameplay(mods.NewValue, out var invalid))
|
||||
{
|
||||
// ensure we always have a valid set of mods.
|
||||
SelectedMods.Value = mods.NewValue.Except(invalid).ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateModDefaults()
|
||||
|
Loading…
Reference in New Issue
Block a user