fix NaN in Bladeburner success Chance (#761)

This commit is contained in:
Caldwell 2023-08-30 20:51:16 +02:00 committed by GitHub
parent 1ea555f572
commit 8c86e1e07a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -223,7 +223,8 @@ export class Action {
let low = real - diff;
let high = real + diff;
const city = inst.getCurrentCity();
const r = city.pop / city.popEst;
let r = city.pop / city.popEst;
if (Number.isNaN(r)) r = 0;
if (r < 1) low *= r;
else high *= r;
return [clamp(low), clamp(high)];