Combine conditionals and clarify comment

This commit is contained in:
Dean Herbert 2019-03-22 14:42:51 +09:00
parent 5b8fd6822e
commit 9e6cdd7bd5

View File

@ -353,9 +353,8 @@ namespace osu.Game.Screens.Play
&& !DrawableRuleset.HasReplayLoaded.Value
// cannot pause if we are already in a fail state
&& !HasFailed
// cannot pause if already paused (and not in the process of resuming)
&& (GameplayClockContainer.IsPaused.Value == false || IsResuming)
&& (!pauseCooldownActive || IsResuming);
// cannot pause if already paused (or in a cooldown state) unless we are in a resuming state.
&& (IsResuming || (GameplayClockContainer.IsPaused.Value == false && !pauseCooldownActive));
private bool pauseCooldownActive =>
lastPauseActionTime.HasValue && GameplayClockContainer.GameplayClock.CurrentTime < lastPauseActionTime + pause_cooldown;
@ -454,7 +453,7 @@ namespace osu.Game.Screens.Play
return true;
}
if (LoadedBeatmapSuccessfully && canPause)
if (canPause)
{
Pause();
return true;