Fix hackAnalyzeThreads

It was previously returning infinity any time a single thread was calculated to hack less than $1, due to an improper use of Math.floor.
This commit is contained in:
omuretsu 2023-02-28 09:02:14 -05:00
parent 2f4c29fdf0
commit 45ca94b1dc

@ -176,7 +176,7 @@ export const ns: InternalAPI<NSFull> = {
return 0; // To prevent returning infinity below return 0; // To prevent returning infinity below
} }
return hackAmount / Math.floor(server.moneyAvailable * percentHacked); return hackAmount / server.moneyAvailable * percentHacked;
}, },
hackAnalyze: (ctx) => (_hostname) => { hackAnalyze: (ctx) => (_hostname) => {
const hostname = helpers.string(ctx, "hostname", _hostname); const hostname = helpers.string(ctx, "hostname", _hostname);