mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
BUGFIX: Patch a minor hole in RAM calculation (#820)
This commit is contained in:
parent
648c180952
commit
875bddbbdb
@ -385,7 +385,9 @@ function updateDynamicRam(ctx: NetscriptContext, ramCost: number): void {
|
|||||||
ws.dynamicLoadedFns[fnName] = true;
|
ws.dynamicLoadedFns[fnName] = true;
|
||||||
|
|
||||||
ws.dynamicRamUsage = Math.min(ws.dynamicRamUsage + ramCost, RamCostConstants.Max);
|
ws.dynamicRamUsage = Math.min(ws.dynamicRamUsage + ramCost, RamCostConstants.Max);
|
||||||
if (ws.dynamicRamUsage > 1.01 * ws.scriptRef.ramUsage) {
|
// This constant is just a handful of ULPs, and gives protection against
|
||||||
|
// rounding issues without exposing rounding exploits in ramUsage.
|
||||||
|
if (ws.dynamicRamUsage > 1.00000000000001 * ws.scriptRef.ramUsage) {
|
||||||
log(ctx, () => "Insufficient static ram available.");
|
log(ctx, () => "Insufficient static ram available.");
|
||||||
const err = makeRuntimeErrorMsg(
|
const err = makeRuntimeErrorMsg(
|
||||||
ctx,
|
ctx,
|
||||||
|
Loading…
Reference in New Issue
Block a user