JS is weird. fixes BL showing NaN pp

This commit is contained in:
Lee 2023-03-21 16:18:31 +00:00
parent 42945218a4
commit 5ccbb815d9
No known key found for this signature in database
GPG Key ID: BAF8F4DB8E7F38EF

@ -27,7 +27,7 @@ export function getBeatLeaderPP(acc, stars) {
return undefined;
}
const modifierBonus = Utils.calculateModifierBonus();
//let rawPP = curve(acc, stars - 0.5) * (stars + 0.5) * 42;
let rawPP = curve(acc, stars - 0.5) * (stars + 0.5) * 42;
let fullPP =
curve(acc, stars * modifierBonus - 0.5) *
(stars * modifierBonus + 0.5) *
@ -38,7 +38,10 @@ export function getBeatLeaderPP(acc, stars) {
acc *= -1;
}
if (fullPP == NaN || fullPP == Infinity) {
if (isNaN(rawPP) || rawPP == Infinity) {
return 1024;
}
if (isNaN(fullPP) || fullPP == Infinity) {
return 1024;
}