From f15394fb6d5975cb599102f7718b496997b11048 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 28 Jul 2023 14:42:43 +0900 Subject: [PATCH] Fix temporary auto mod (ctrl+enter at song select) not reverting in all scenarios --- osu.Game/Screens/Select/PlaySongSelect.cs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index b99d949b43..fe13d6d5a8 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -146,12 +146,24 @@ namespace osu.Game.Screens.Select public override void OnResuming(ScreenTransitionEvent e) { base.OnResuming(e); + revertMods(); + } - if (playerLoader != null) - { - Mods.Value = modsAtGameplayStart; - playerLoader = null; - } + public override bool OnExiting(ScreenExitEvent e) + { + if (base.OnExiting(e)) + return true; + + revertMods(); + return false; + } + + private void revertMods() + { + if (playerLoader == null) return; + + Mods.Value = modsAtGameplayStart; + playerLoader = null; } } }