1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 21:00:58 +08:00

Make sure we restore the clock rate on exiting

This commit is contained in:
EVAST9919
2017-10-14 05:15:18 +03:00
Unverified
parent bdcc70e0bb
commit 7a72f2e3f5
+5
View File
@@ -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);
}