Fix beat sync stopping after returning to menu from a failed play

Closes #20193.

Explanation is inline comment.
This commit is contained in:
Dean Herbert
2022-09-09 14:01:52 +09:00
parent eb93a838d4
commit 20ffbc4676
2 changed files with 11 additions and 5 deletions

View File

@ -121,6 +121,17 @@ namespace osu.Game.Beatmaps
protected override void Update()
{
base.Update();
if (Source != null && Source is not IAdjustableClock && Source.CurrentTime < finalClockSource.CurrentTime)
{
// InterpolatingFramedClock won't interpolate backwards unless its source has an ElapsedFrameTime.
// See https://github.com/ppy/osu-framework/blob/ba1385330cc501f34937e08257e586c84e35d772/osu.Framework/Timing/InterpolatingFramedClock.cs#L91-L93
// This is not always the case here when doing large seeks.
// (Of note, this is not an issue if the source is adjustable, as the source is seeked to be in time by DecoupleableInterpolatingFramedClock).
// Rather than trying to get around this by fixing the framework clock stack, let's work around it for now.
Seek(Source.CurrentTime);
}
finalClockSource.ProcessFrame();
}