From c588f434e5f51bee3683c6114bc951fda40fb50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 31 Oct 2023 13:54:18 +0100 Subject: [PATCH] Fix song select touch handler causing crashes when song select is suspended --- osu.Game/Screens/Select/SongSelectTouchInputHandler.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Select/SongSelectTouchInputHandler.cs b/osu.Game/Screens/Select/SongSelectTouchInputHandler.cs index bf4761e871..5c27e59c5b 100644 --- a/osu.Game/Screens/Select/SongSelectTouchInputHandler.cs +++ b/osu.Game/Screens/Select/SongSelectTouchInputHandler.cs @@ -32,14 +32,18 @@ namespace osu.Game.Screens.Select { base.LoadComplete(); - ruleset.BindValueChanged(_ => updateState()); - mods.BindValueChanged(_ => updateState()); - touchActive.BindValueChanged(_ => updateState()); + ruleset.BindValueChanged(_ => Scheduler.AddOnce(updateState)); + mods.BindValueChanged(_ => Scheduler.AddOnce(updateState)); + mods.BindDisabledChanged(_ => Scheduler.AddOnce(updateState)); + touchActive.BindValueChanged(_ => Scheduler.AddOnce(updateState)); updateState(); } private void updateState() { + if (mods.Disabled) + return; + var touchDeviceMod = ruleset.Value.CreateInstance().GetTouchDeviceMod(); if (touchDeviceMod == null)