mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
fix ram miscalc
This commit is contained in:
@@ -114,13 +114,14 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
threads = 1;
|
||||
}
|
||||
|
||||
workerScript.dynamicRamUsage += ramCost * threads;
|
||||
workerScript.dynamicRamUsage += ramCost;
|
||||
if (workerScript.dynamicRamUsage > 1.01 * workerScript.ramUsage) {
|
||||
throw makeRuntimeRejectMsg(
|
||||
workerScript,
|
||||
`Dynamic RAM usage calculated to be greater than initial RAM usage on fn: ${fnName}.
|
||||
This is probably because you somehow circumvented the static RAM calculation.
|
||||
|
||||
Threads: ${threads}
|
||||
Dynamic RAM Usage: ${numeralWrapper.formatRAM(workerScript.dynamicRamUsage)}
|
||||
Static RAM Usage: ${numeralWrapper.formatRAM(workerScript.ramUsage)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user