mirror of
https://github.com/ppy/osu
synced 2024-12-17 12:25:19 +00:00
Modify global index directly in the for loop
Moves the global index to a near break if not in a break yet
This commit is contained in:
parent
5a94a22314
commit
4c9e8527d8
@ -158,25 +158,15 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
if (time > breaks[currentBreakIndex].EndTime)
|
||||
{
|
||||
for (int i = currentBreakIndex; i < breaks.Count; i++)
|
||||
{
|
||||
if (time <= breaks[i].EndTime)
|
||||
{
|
||||
currentBreakIndex = i;
|
||||
for (; currentBreakIndex < breaks.Count; currentBreakIndex++)
|
||||
if (time <= breaks[currentBreakIndex].EndTime)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (time < breaks[currentBreakIndex].StartTime)
|
||||
{
|
||||
for (int i = currentBreakIndex; i >= 0; i--)
|
||||
{
|
||||
if (time >= breaks[i].StartTime)
|
||||
{
|
||||
currentBreakIndex = i;
|
||||
for (; currentBreakIndex >= 0; currentBreakIndex--)
|
||||
if (time >= breaks[currentBreakIndex].StartTime)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This ensures that IsBreakTime is generally consistent with the overlay's transforms during a break.
|
||||
|
Loading…
Reference in New Issue
Block a user