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:
Unknown 2017-11-25 19:09:05 +01:00
parent b3279082e2
commit 7be55df790
2 changed files with 1 additions and 3 deletions

View File

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

View File

@ -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();