1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 07:22:54 +08:00

Fix PlayerTouchInputDetector applying touch device mod when other inactive mods present

This commit is contained in:
Bartłomiej Dach 2023-11-09 17:50:57 +09:00
parent 5d5c803cf6
commit 63a0ea5410
No known key found for this signature in database

View File

@ -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;
}
}
}