Simplify rewind handling

This commit is contained in:
Dean Herbert
2020-07-21 19:21:30 +09:00
parent 947f4e0d4c
commit 7f2ae694cc

View File

@ -253,12 +253,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
int spins = (int)(Disc.CumulativeRotation / 360);
while (wholeSpins != spins)
if (spins < wholeSpins)
{
if (wholeSpins < spins)
// rewinding, silently handle
wholeSpins = spins;
return;
}
while (wholeSpins != spins)
{
var tick = ticks.FirstOrDefault(t => !t.IsHit);
// tick may be null if we've hit the spin limit.
if (tick != null)
{
tick.TriggerResult(HitResult.Great);
@ -268,11 +274,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
wholeSpins++;
}
else
{
wholeSpins--;
}
}
}
protected override void UpdateInitialTransforms()