mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 11:27:04 +02:00
NETSCRIPT: Rework script ram updates (#408)
This commit is contained in:
@@ -272,7 +272,8 @@ export abstract class BaseServer {
|
||||
if (fn === this.scripts[i].filename) {
|
||||
const script = this.scripts[i];
|
||||
script.code = code;
|
||||
script.updateRamUsage(this.scripts);
|
||||
// Set ramUsage to null in order to force recalculation on next run
|
||||
script.ramUsage = null;
|
||||
script.markUpdated();
|
||||
ret.overwritten = true;
|
||||
ret.success = true;
|
||||
@@ -281,7 +282,7 @@ export abstract class BaseServer {
|
||||
}
|
||||
|
||||
// Otherwise, create a new script
|
||||
const newScript = new Script(fn, code, this.hostname, this.scripts);
|
||||
const newScript = new Script(fn, code, this.hostname);
|
||||
this.scripts.push(newScript);
|
||||
ret.success = true;
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user