mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
Merge pull request #2646 from zeddrak/patch-1
Correction for ns.hack pro-rated security increase
This commit is contained in:
commit
4171b98015
@ -352,7 +352,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
if (rand < hackChance) {
|
||||
// Success!
|
||||
const percentHacked = calculatePercentMoneyHacked(server, Player);
|
||||
let maxThreadNeeded = Math.ceil((1 / percentHacked) * (server.moneyAvailable / server.moneyMax));
|
||||
let maxThreadNeeded = Math.ceil(1 / percentHacked);
|
||||
if (isNaN(maxThreadNeeded)) {
|
||||
// Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large value
|
||||
maxThreadNeeded = 1e6;
|
||||
|
Loading…
Reference in New Issue
Block a user