Merge pull request #30618 from Natelytle/ltca-broke-pp

Fix NaN PP counter values while SR is 0
This commit is contained in:
Dean Herbert 2024-11-14 17:42:05 +09:00 committed by GitHub
commit 23167b0221
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -74,6 +74,10 @@ public virtual double CountTopWeightedStrains()
return 0.0;
double consistentTopStrain = DifficultyValue() / 10; // What would the top strain be if all strain values were identical
if (consistentTopStrain == 0)
return ObjectStrains.Count;
// 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))));
}