From 17b11f107f25f62e60500cdc78375ec852ef52de Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Wed, 22 Dec 2021 01:12:45 +0000 Subject: [PATCH] hackAnalyzeThreads will return zero instead of NaN when checking the effect of zero threads on a server with zero cash. --- src/NetscriptFunctions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 3a180c052..83a4335ac 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -509,6 +509,8 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { if (hackAmount < 0 || hackAmount > server.moneyAvailable) { return -1; + } else if (hackAmount === 0) { + return 0; } const percentHacked = calculatePercentMoneyHacked(server, Player);