mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 22:22:55 +08:00
Adjust speed ratio fraction to avoid division by 0
This commit is contained in:
parent
2634e56944
commit
c4d69405bf
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
|
|||||||
double currDeltaTime = Math.Max(1, osuCurrObj.DeltaTime);
|
double currDeltaTime = Math.Max(1, osuCurrObj.DeltaTime);
|
||||||
double nextDeltaTime = Math.Max(1, osuNextObj.DeltaTime);
|
double nextDeltaTime = Math.Max(1, osuNextObj.DeltaTime);
|
||||||
double deltaDifference = Math.Abs(nextDeltaTime - currDeltaTime);
|
double deltaDifference = Math.Abs(nextDeltaTime - currDeltaTime);
|
||||||
double speedRatio = Math.Min(1, currDeltaTime / deltaDifference);
|
double speedRatio = currDeltaTime / Math.Max(currDeltaTime, deltaDifference);
|
||||||
double windowRatio = Math.Pow(Math.Min(1, currDeltaTime / greatWindowFull), 2);
|
double windowRatio = Math.Pow(Math.Min(1, currDeltaTime / greatWindowFull), 2);
|
||||||
doubletapness = Math.Pow(speedRatio, 1 - windowRatio);
|
doubletapness = Math.Pow(speedRatio, 1 - windowRatio);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user