mirror of
https://github.com/ppy/osu
synced 2024-12-15 19:36:34 +00:00
Don’t allow ResumeContainers to appear during breaks (#4607)
Don’t allow ResumeContainers to appear during breaks Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
commit
bfa6156092
@ -29,5 +29,12 @@ namespace osu.Game.Beatmaps.Timing
|
||||
/// Whether the break has any effect. Breaks that are too short are culled before they are added to the beatmap.
|
||||
/// </summary>
|
||||
public bool HasEffect => Duration >= MIN_BREAK_DURATION;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this break contains a specified time.
|
||||
/// </summary>
|
||||
/// <param name="time">The time to check in milliseconds.</param>
|
||||
/// <returns>Whether the time falls within this <see cref="BreakPeriod"/>.</returns>
|
||||
public bool Contains(double time) => time >= StartTime && time <= EndTime;
|
||||
}
|
||||
}
|
||||
|
@ -414,8 +414,9 @@ namespace osu.Game.Screens.Play
|
||||
IsResuming = true;
|
||||
PauseOverlay.Hide();
|
||||
|
||||
// time-based conditions may allow instant resume.
|
||||
if (GameplayClockContainer.GameplayClock.CurrentTime < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
|
||||
// breaks and time-based conditions may allow instant resume.
|
||||
double time = GameplayClockContainer.GameplayClock.CurrentTime;
|
||||
if (Beatmap.Value.Beatmap.Breaks.Any(b => b.Contains(time)) || time < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
|
||||
completeResume();
|
||||
else
|
||||
DrawableRuleset.RequestResume(completeResume);
|
||||
|
Loading…
Reference in New Issue
Block a user