NETSCRIPT: Change error return of hackAnalyzeThreads (#482)

Fixes #102
This commit is contained in:
David Walker 2023-04-24 08:04:19 -07:00 committed by GitHub
parent e7fcda19c1
commit b3c0027b66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,7 +173,7 @@ export const ns: InternalAPI<NSFull> = {
const percentHacked = calculatePercentMoneyHacked(server, Player);
if (percentHacked === 0 || server.moneyAvailable === 0) {
return 0; // To prevent returning infinity below
return -1; // To prevent returning infinity below
}
return hackAmount / (server.moneyAvailable * percentHacked);