mirror of https://github.com/ppy/osu
Make sure we restore the clock rate on exiting
This commit is contained in:
parent
bdcc70e0bb
commit
7a72f2e3f5
|
@ -49,6 +49,7 @@ public class Player : OsuScreen
|
|||
private IAdjustableClock adjustableSourceClock;
|
||||
private FramedOffsetClock offsetClock;
|
||||
private DecoupleableInterpolatingFramedClock decoupledClock;
|
||||
private double clockRate;
|
||||
|
||||
private PauseContainer pauseContainer;
|
||||
|
||||
|
@ -149,6 +150,8 @@ private void load(AudioManager audio, OsuConfigManager config, APIAccess api)
|
|||
foreach (var mod in working.Mods.Value.OfType<IApplicableToClock>())
|
||||
mod.ApplyToClock(adjustableSourceClock);
|
||||
|
||||
clockRate = adjustableSourceClock.Rate;
|
||||
|
||||
decoupledClock.ChangeSource(adjustableSourceClock);
|
||||
});
|
||||
|
||||
|
@ -334,6 +337,8 @@ protected override bool OnExiting(Screen next)
|
|||
{
|
||||
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