1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:22:55 +08:00

Remove calculation for scores with combo above threshold, avoid division by zero

This commit is contained in:
StanR 2021-10-15 16:51:05 +03:00
parent 205d95e8c6
commit c8d99e68a5

View File

@ -262,9 +262,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty
{ {
double fullComboThreshold = Attributes.MaxCombo - 0.1 * Attributes.SliderCount; double fullComboThreshold = Attributes.MaxCombo - 0.1 * Attributes.SliderCount;
if (scoreMaxCombo < fullComboThreshold) if (scoreMaxCombo < fullComboThreshold)
comboBasedMissCount = fullComboThreshold / scoreMaxCombo; comboBasedMissCount = fullComboThreshold / Math.Max(1.0, scoreMaxCombo);
else
comboBasedMissCount = Math.Pow((Attributes.MaxCombo - scoreMaxCombo) / (0.1 * Attributes.SliderCount), 3);
} }
return Math.Max(countMiss, (int)Math.Floor(comboBasedMissCount)); return Math.Max(countMiss, (int)Math.Floor(comboBasedMissCount));