mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-27 08:27:32 +01:00
Merge pull request #2883 from chrisrabe/fix/hackanalyzethreads-infinity
fix: fixed hackAnalyzeThreads returning infinity
This commit is contained in:
commit
e56f7356cd
@ -539,6 +539,10 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
|
||||
const percentHacked = calculatePercentMoneyHacked(server, Player);
|
||||
|
||||
if (percentHacked === 0 || server.moneyAvailable === 0) {
|
||||
return 0; // To prevent returning infinity below
|
||||
}
|
||||
|
||||
return hackAmount / Math.floor(server.moneyAvailable * percentHacked);
|
||||
},
|
||||
hackAnalyze: function (hostname: any): any {
|
||||
|
Loading…
Reference in New Issue
Block a user