Merge pull request #2102 from mikomyazaki/2023-hack-analyze-threads-no-money

hackAnalyzeThreads will no longer return NaN under some circumstances
This commit is contained in:
hydroflame 2021-12-22 12:14:57 -05:00 committed by GitHub
commit ce0fb7a383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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