Only undo adjustments in GameplayClockContainer if applied at least once

This commit is contained in:
Dean Herbert 2019-12-06 13:49:01 +09:00
parent de23364608
commit 48c6279e8b

View File

@ -214,10 +214,13 @@ namespace osu.Game.Screens.Play
base.Update();
}
private bool speedAdjustmentsApplied;
private void updateRate()
{
if (sourceClock == null) return;
speedAdjustmentsApplied = true;
sourceClock.ResetSpeedAdjustments();
if (sourceClock is IHasTempoAdjust tempo)
@ -239,7 +242,12 @@ namespace osu.Game.Screens.Play
private void removeSourceClockAdjustments()
{
sourceClock.ResetSpeedAdjustments();
if (speedAdjustmentsApplied)
{
sourceClock.ResetSpeedAdjustments();
speedAdjustmentsApplied = false;
}
(sourceClock as IAdjustableAudioComponent)?.RemoveAdjustment(AdjustableProperty.Frequency, pauseFreqAdjust);
}
}