mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Fix division by 0
This commit is contained in:
parent
9bb4c70393
commit
32adc1ec14
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
countOk = score.Statistics.GetValueOrDefault(HitResult.Ok);
|
||||
countMeh = score.Statistics.GetValueOrDefault(HitResult.Meh);
|
||||
countMiss = score.Statistics.GetValueOrDefault(HitResult.Miss);
|
||||
scoreAccuracy = customAccuracy;
|
||||
scoreAccuracy = customAccuracy();
|
||||
|
||||
// Arbitrary initial value for scaling pp in order to standardize distributions across game modes.
|
||||
// The specific number has no intrinsic meaning and can be adjusted as needed.
|
||||
@ -73,6 +73,12 @@ namespace osu.Game.Rulesets.Mania.Difficulty
|
||||
/// <summary>
|
||||
/// Accuracy used to weight judgements independently from the score's actual accuracy.
|
||||
/// </summary>
|
||||
private double customAccuracy => (countPerfect * 320 + countGreat * 300 + countGood * 200 + countOk * 100 + countMeh * 50) / (totalHits * 320);
|
||||
private double customAccuracy()
|
||||
{
|
||||
if (totalHits==0)
|
||||
return 0;
|
||||
|
||||
return (countPerfect * 320 + countGreat * 300 + countGood * 200 + countOk * 100 + countMeh * 50) / (totalHits * 320);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user