From 8c86e1e07ac44cd5582f13f1e31150104140e2a5 Mon Sep 17 00:00:00 2001 From: Caldwell <115591472+zerbosh@users.noreply.github.com> Date: Wed, 30 Aug 2023 20:51:16 +0200 Subject: [PATCH] fix NaN in Bladeburner success Chance (#761) --- src/Bladeburner/Action.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Bladeburner/Action.tsx b/src/Bladeburner/Action.tsx index 839cf27c3..143c000dc 100644 --- a/src/Bladeburner/Action.tsx +++ b/src/Bladeburner/Action.tsx @@ -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)];