mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +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) {
|
if (rand < hackChance) {
|
||||||
// Success!
|
// Success!
|
||||||
const percentHacked = calculatePercentMoneyHacked(server, Player);
|
const percentHacked = calculatePercentMoneyHacked(server, Player);
|
||||||
let maxThreadNeeded = Math.ceil((1 / percentHacked) * (server.moneyAvailable / server.moneyMax));
|
let maxThreadNeeded = Math.ceil(1 / percentHacked);
|
||||||
if (isNaN(maxThreadNeeded)) {
|
if (isNaN(maxThreadNeeded)) {
|
||||||
// Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large value
|
// Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large value
|
||||||
maxThreadNeeded = 1e6;
|
maxThreadNeeded = 1e6;
|
||||||
|
Loading…
Reference in New Issue
Block a user