1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 16:25:32 +08:00

Fix potential NaN values

This commit is contained in:
apollo-dw 2021-11-12 00:56:08 +00:00
parent c330093476
commit cdfe022805

View File

@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
double speedRating = Math.Sqrt(skills[2].DifficultyValue()) * difficulty_multiplier; double speedRating = Math.Sqrt(skills[2].DifficultyValue()) * difficulty_multiplier;
double flashlightRating = Math.Sqrt(skills[3].DifficultyValue()) * difficulty_multiplier; double flashlightRating = Math.Sqrt(skills[3].DifficultyValue()) * difficulty_multiplier;
double sliderFactor = aimRatingNoSliders / aimRating; double sliderFactor = (aimRating > 0) ? aimRatingNoSliders / aimRating : 1;
if (mods.Any(h => h is OsuModRelax)) if (mods.Any(h => h is OsuModRelax))
speedRating = 0.0; speedRating = 0.0;