From 63a0ea54109c93984501b66435febf676663cab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 9 Nov 2023 17:50:57 +0900 Subject: [PATCH] Fix `PlayerTouchInputDetector` applying touch device mod when other inactive mods present --- osu.Game/Screens/Play/PlayerTouchInputDetector.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/PlayerTouchInputDetector.cs b/osu.Game/Screens/Play/PlayerTouchInputDetector.cs index a5055dfb00..69c3cd0ded 100644 --- a/osu.Game/Screens/Play/PlayerTouchInputDetector.cs +++ b/osu.Game/Screens/Play/PlayerTouchInputDetector.cs @@ -7,6 +7,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Configuration; using osu.Game.Rulesets.Mods; +using osu.Game.Utils; namespace osu.Game.Screens.Play { @@ -45,10 +46,15 @@ namespace osu.Game.Screens.Play if (touchDeviceMod == null) return; + var candidateMods = player.Score.ScoreInfo.Mods.Append(touchDeviceMod).ToArray(); + + if (!ModUtils.CheckCompatibleSet(candidateMods, out _)) + return; + // `Player` (probably rightly so) assumes immutability of mods, // so this will not be shown immediately on the mod display in the top right. // if this is to change, the mod immutability should be revisited. - player.Score.ScoreInfo.Mods = player.Score.ScoreInfo.Mods.Append(touchDeviceMod).ToArray(); + player.Score.ScoreInfo.Mods = candidateMods; } } }