diff --git a/osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs b/osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs index f155005f67..69d5a956d9 100644 --- a/osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs +++ b/osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs @@ -12,6 +12,7 @@ using osu.Framework.Graphics.Audio; using osu.Framework.Utils; using osu.Game.Beatmaps; using osu.Game.Configuration; +using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; @@ -124,10 +125,7 @@ namespace osu.Game.Rulesets.Mods drawable.OnNewResult += (o, result) => { if (dequeuedRates.ContainsKey(result.HitObject)) return; - - if (!result.IsHit) return; - if (!result.Type.AffectsAccuracy()) return; - if (!previousEndTimes.ContainsKey(result.HitObject)) return; + if (!shouldProcessResult(result)) return; double prevEndTime = previousEndTimes[result.HitObject]; @@ -141,10 +139,7 @@ namespace osu.Game.Rulesets.Mods drawable.OnRevertResult += (o, result) => { if (!dequeuedRates.ContainsKey(result.HitObject)) return; - - if (!result.IsHit) return; - if (!result.Type.AffectsAccuracy()) return; - if (!previousEndTimes.ContainsKey(result.HitObject)) return; + if (!shouldProcessResult(result)) return; recentRates.Insert(0, dequeuedRates[result.HitObject]); recentRates.RemoveAt(recentRates.Count - 1); @@ -179,5 +174,14 @@ namespace osu.Game.Rulesets.Mods yield return nested; } } + + private bool shouldProcessResult(JudgementResult result) + { + if (!result.IsHit) return false; + if (!result.Type.AffectsAccuracy()) return false; + if (!previousEndTimes.ContainsKey(result.HitObject)) return false; + + return true; + } } }