1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-21 03:39:53 +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
Unverified
parent ead8262257
commit 425dc8a210
+6
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()