mirror of
https://github.com/ppy/osu
synced 2025-02-20 20:47:09 +00:00
fix being stuck in gameplay if exit is pressed too fast
The reliance on `pauseOverlay.Alpha == 1` created a race condition that, when you pressed Exit while the pauseoverlay is still fading in, could get you stuck in gameplay. The game wants to show the pause overlay but also thinks it's already paused and returns early.
This commit is contained in:
parent
b3279082e2
commit
7be55df790
@ -22,8 +22,6 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
public bool IsPaused { get; private set; }
|
||||
|
||||
public bool AllowExit => IsPaused && pauseOverlay.Alpha == 1;
|
||||
|
||||
public Func<bool> CheckCanPause;
|
||||
|
||||
private const double pause_cooldown = 1000;
|
||||
|
@ -357,7 +357,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override bool OnExiting(Screen next)
|
||||
{
|
||||
if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false)
|
||||
if (!AllowPause || HasFailed || !ValidForResume || pauseContainer?.IsPaused != false || RulesetContainer?.HasReplayLoaded != false)
|
||||
{
|
||||
// In the case of replays, we may have changed the playback rate.
|
||||
applyRateFromMods();
|
||||
|
Loading…
Reference in New Issue
Block a user