1
0
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:
Dean Herbert 2021-02-01 20:20:19 +09:00
parent ead8262257
commit 425dc8a210

View File

@ -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()