mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 02:42:54 +08:00
Move conditional to within BreakPeriod
This commit is contained in:
parent
1391aa342c
commit
038e49701e
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -416,8 +416,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
// breaks and time-based conditions may allow instant resume.
|
||||
double time = GameplayClockContainer.GameplayClock.CurrentTime;
|
||||
if (Beatmap.Value.Beatmap.Breaks.Any(b => time >= b.StartTime && time <= b.EndTime) ||
|
||||
time < Beatmap.Value.Beatmap.HitObjects.First().StartTime)
|
||||
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