mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-02 12:33:56 +01:00
Better error message for dynamic ram miscalculation
This commit is contained in:
parent
a18bdd6afc
commit
05bab22807
@ -243,15 +243,27 @@ function NetscriptFunctions(workerScript) {
|
|||||||
if (workerScript.dynamicRamUsage > 1.01 * workerScript.ramUsage) {
|
if (workerScript.dynamicRamUsage > 1.01 * workerScript.ramUsage) {
|
||||||
throw makeRuntimeRejectMsg(
|
throw makeRuntimeRejectMsg(
|
||||||
workerScript,
|
workerScript,
|
||||||
"Dynamic RAM usage calculated to be greater than initial RAM usage on fn: " +
|
`Dynamic RAM usage calculated to be greater than initial RAM usage on fn: ${fnName}.
|
||||||
fnName +
|
This is probably because you somehow circumvented the static RAM calculation.
|
||||||
". This is probably because you somehow circumvented the static RAM " +
|
|
||||||
"calculation.<br><br>Please don't do that :(<br><br>" +
|
Dynamic RAM Usage: ${numeralWrapper.formatRAM(
|
||||||
"Dynamic RAM Usage: " +
|
workerScript.dynamicRamUsage,
|
||||||
numeralWrapper.formatRAM(workerScript.dynamicRamUsage) +
|
)}
|
||||||
"<br>" +
|
Static RAM Usage: ${numeralWrapper.formatRAM(workerScript.ramUsage)}
|
||||||
"Static RAM Usage: " +
|
|
||||||
numeralWrapper.formatRAM(workerScript.ramUsage),
|
One of these could be the reason:
|
||||||
|
* Using eval() to get a reference to a ns function
|
||||||
|
const scan = eval('ns.scan');
|
||||||
|
|
||||||
|
* Using map access to do the same
|
||||||
|
const scan = ns['scan'];
|
||||||
|
|
||||||
|
* Saving script in the improper order.
|
||||||
|
Increase the cost of an imported script, save it, then run the
|
||||||
|
parent. To fix this just re-open & save every script in order
|
||||||
|
from most imported to least imported (parent script).
|
||||||
|
|
||||||
|
Sorry :(`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
18
src/ThirdParty/raphael.min.js
vendored
18
src/ThirdParty/raphael.min.js
vendored
@ -2512,16 +2512,14 @@
|
|||||||
a = this.matrix ? Q(a, this.matrix) : a;
|
a = this.matrix ? Q(a, this.matrix) : a;
|
||||||
for (var s = 1; s < r + 1; s++)
|
for (var s = 1; s < r + 1; s++)
|
||||||
n.push(
|
n.push(
|
||||||
i
|
i.path(a).attr({
|
||||||
.path(a)
|
stroke: e.color,
|
||||||
.attr({
|
fill: e.fill ? e.color : "none",
|
||||||
stroke: e.color,
|
"stroke-linejoin": "round",
|
||||||
fill: e.fill ? e.color : "none",
|
"stroke-linecap": "round",
|
||||||
"stroke-linejoin": "round",
|
"stroke-width": +((e.width / r) * s).toFixed(3),
|
||||||
"stroke-linecap": "round",
|
opacity: +(e.opacity / r).toFixed(3),
|
||||||
"stroke-width": +((e.width / r) * s).toFixed(3),
|
}),
|
||||||
opacity: +(e.opacity / r).toFixed(3),
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
return n.insertBefore(this).translate(e.offsetx, e.offsety);
|
return n.insertBefore(this).translate(e.offsetx, e.offsety);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user