1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 16:32:54 +08:00

Adjust speed ratio fraction to avoid division by 0

This commit is contained in:
apollo-dw 2022-06-17 21:18:16 +01:00
parent 2634e56944
commit c4d69405bf

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Evaluators
double currDeltaTime = Math.Max(1, osuCurrObj.DeltaTime);
double nextDeltaTime = Math.Max(1, osuNextObj.DeltaTime);
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);
doubletapness = Math.Pow(speedRatio, 1 - windowRatio);
}