mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-01-27 16:31:31 +01:00
BUGFIX: update weaken results to correctly reflect change when close to minSecurity (#1887)
This commit is contained in:
parent
a6d6aa7410
commit
85fa15c5a5
@ -394,7 +394,10 @@ export const ns: InternalAPI<NSFull> = {
|
||||
throw helpers.errorMessage(ctx, `Cannot find host of WorkerScript. Hostname: ${ctx.workerScript.hostname}.`);
|
||||
}
|
||||
const weakenAmt = getWeakenEffect(threads, host.cpuCores);
|
||||
const securityBeforeWeaken = server.hackDifficulty;
|
||||
server.weaken(weakenAmt);
|
||||
const securityAfterWeaken = server.hackDifficulty;
|
||||
const securityReduction = securityBeforeWeaken - securityAfterWeaken;
|
||||
ctx.workerScript.scriptRef.recordWeaken(server.hostname, threads);
|
||||
const expGain = calculateHackingExpGain(server, Player) * threads;
|
||||
helpers.log(
|
||||
@ -407,7 +410,7 @@ export const ns: InternalAPI<NSFull> = {
|
||||
ctx.workerScript.scriptRef.onlineExpGained += expGain;
|
||||
Player.gainHackingExp(expGain);
|
||||
// Account for hidden multiplier in Server.weaken()
|
||||
return Promise.resolve(weakenAmt);
|
||||
return Promise.resolve(securityReduction);
|
||||
});
|
||||
},
|
||||
weakenAnalyze:
|
||||
|
Loading…
Reference in New Issue
Block a user