From c40e24739b2040a62035021786226e26b9cdfaf0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Mar 2019 21:37:33 +0900 Subject: [PATCH] Fix weird application logic --- osu.Game/Rulesets/Mods/ModTimeRamp.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModTimeRamp.cs b/osu.Game/Rulesets/Mods/ModTimeRamp.cs index 0fadbd1d39..082f0091c6 100644 --- a/osu.Game/Rulesets/Mods/ModTimeRamp.cs +++ b/osu.Game/Rulesets/Mods/ModTimeRamp.cs @@ -62,12 +62,14 @@ namespace osu.Game.Rulesets.Mods public virtual void Update(Playfield playfield) { var absRate = Math.Abs(FinalRateAdjustment); - applyAdjustment(MathHelper.Clamp(absRate * ((clock.CurrentTime - beginRampTime) / finalRateTime), 0, absRate)); + applyAdjustment((clock.CurrentTime - beginRampTime) / finalRateTime); } - private void applyAdjustment(double adjustment) + private void applyAdjustment(double adjustAmount) { - var localAdjust = 1 + Math.Sign(FinalRateAdjustment) * adjustment; + adjustAmount = MathHelper.Clamp(adjustAmount, 0, 1); + + var localAdjust = 1 + Math.Sign(FinalRateAdjustment) * adjustAmount * Math.Abs(FinalRateAdjustment); if (clock is IHasPitchAdjust tempo) tempo.PitchAdjust = baseAdjust * localAdjust;