mirror of
https://github.com/ppy/osu
synced 2024-12-14 19:06:07 +00:00
Make sure we restore the clock rate on exiting
This commit is contained in:
parent
bdcc70e0bb
commit
7a72f2e3f5
@ -49,6 +49,7 @@ namespace osu.Game.Screens.Play
|
||||
private IAdjustableClock adjustableSourceClock;
|
||||
private FramedOffsetClock offsetClock;
|
||||
private DecoupleableInterpolatingFramedClock decoupledClock;
|
||||
private double clockRate;
|
||||
|
||||
private PauseContainer pauseContainer;
|
||||
|
||||
@ -149,6 +150,8 @@ namespace osu.Game.Screens.Play
|
||||
foreach (var mod in working.Mods.Value.OfType<IApplicableToClock>())
|
||||
mod.ApplyToClock(adjustableSourceClock);
|
||||
|
||||
clockRate = adjustableSourceClock.Rate;
|
||||
|
||||
decoupledClock.ChangeSource(adjustableSourceClock);
|
||||
});
|
||||
|
||||
@ -334,6 +337,8 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
if (HasFailed || !ValidForResume || pauseContainer?.AllowExit != false || RulesetContainer?.HasReplayLoaded != false)
|
||||
{
|
||||
// We want to make sure we restore the clock rate
|
||||
adjustableSourceClock.Rate = clockRate;
|
||||
fadeOut();
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user