mirror of
https://github.com/ppy/osu.git
synced 2024-11-15 15:17:44 +08:00
Fix NaN case when difficulty is 0
This commit is contained in:
parent
20c54ab697
commit
61afda1089
@ -77,6 +77,9 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
|
||||
/// </summary>
|
||||
public double CountDifficultStrains()
|
||||
{
|
||||
if (double.IsNaN(Difficulty))
|
||||
return 0.0;
|
||||
|
||||
double consistentTopStrain = Difficulty / 10; // What would the top strain be if all strain values were identical
|
||||
// Use a weighted sum of all strains. Constants are arbitrary and give nice values
|
||||
return ObjectStrains.Sum(s => 1.1 / (1 + Math.Exp(-10 * (s / consistentTopStrain - 0.88))));
|
||||
|
Loading…
Reference in New Issue
Block a user