Only trigger pause cooldown on pause (not exit)

This commit is contained in:
Dean Herbert 2021-02-09 17:29:18 +09:00
parent cba116ff09
commit 2c052d70e8

View File

@ -505,6 +505,10 @@ namespace osu.Game.Screens.Play
if (canPause && !GameplayClockContainer.IsPaused.Value) if (canPause && !GameplayClockContainer.IsPaused.Value)
{ {
if (pauseCooldownActive && !GameplayClockContainer.IsPaused.Value)
// still want to block if we are within the cooldown period and not already paused.
return;
Pause(); Pause();
return; return;
} }
@ -808,14 +812,6 @@ namespace osu.Game.Screens.Play
return true; return true;
} }
// ValidForResume is false when restarting
if (ValidForResume)
{
if (pauseCooldownActive && !GameplayClockContainer.IsPaused.Value)
// still want to block if we are within the cooldown period and not already paused.
return true;
}
// GameplayClockContainer performs seeks / start / stop operations on the beatmap's track. // GameplayClockContainer performs seeks / start / stop operations on the beatmap's track.
// as we are no longer the current screen, we cannot guarantee the track is still usable. // as we are no longer the current screen, we cannot guarantee the track is still usable.
GameplayClockContainer?.StopUsingBeatmapClock(); GameplayClockContainer?.StopUsingBeatmapClock();