mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 19:43:49 +01:00
fix: fixed hackAnalyzeThreads returning infinity
This commit is contained in:
parent
9ddb1c4379
commit
3e61780fad
@ -536,6 +536,10 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
|
|
||||||
const percentHacked = calculatePercentMoneyHacked(server, Player);
|
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);
|
return hackAmount / Math.floor(server.moneyAvailable * percentHacked);
|
||||||
},
|
},
|
||||||
hackAnalyze: function (hostname: any): any {
|
hackAnalyze: function (hostname: any): any {
|
||||||
|
Loading…
Reference in New Issue
Block a user