1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:17:27 +08:00

Add guard against starting gameplay with invalid mod instances

Move guard to `Player` instead
This commit is contained in:
Salman Ahmed 2024-01-13 15:52:57 +03:00
parent b1fae2bc6a
commit 0c02062780

View File

@ -213,6 +213,12 @@ namespace osu.Game.Screens.Play
if (playableBeatmap == null)
return;
if (gameplayMods.Any(m => ruleset.AllMods.All(rulesetMod => m.GetType() != rulesetMod.GetType())))
{
Logger.Log($@"Gameplay was started with a mod belonging to a ruleset different than '{ruleset.Description}'.", level: LogLevel.Important);
return;
}
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
if (game != null)