hackAnalyzeThreads will return zero instead of NaN when checking the effect of zero threads on a server with zero cash.

This commit is contained in:
Andrew Cooper 2021-12-22 01:12:45 +00:00
parent ea0be338e1
commit 17b11f107f

@ -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);