Resolved more circular dependencies. Installed acorn-walk and imported it in RamCalculations using ES6 modules. Fixed bugs in stock market rework

This commit is contained in:
danielyxie
2019-05-06 18:01:06 -07:00
parent 8a5b6f6cbc
commit cdb5dfec62
34 changed files with 7246 additions and 305 deletions
+3 -4
View File
@@ -1145,8 +1145,7 @@ function NetscriptFunctions(workerScript) {
}
// Create new script if it does not already exist
var newScript = new Script();
newScript.filename = scriptname;
var newScript = new Script(scriptname);
newScript.code = sourceScript.code;
newScript.ramUsage = sourceScript.ramUsage;
newScript.server = destServer.ip;
@@ -1932,12 +1931,12 @@ function NetscriptFunctions(workerScript) {
let script = workerScript.getScriptOnServer(fn);
if (script == null) {
// Create a new script
script = new Script(fn, data, server.ip);
script = new Script(fn, data, server.ip, server.scripts);
server.scripts.push(script);
return true;
}
mode === "w" ? script.code = data : script.code += data;
script.updateRamUsage();
script.updateRamUsage(server.scripts);
} else {
// Write to text file
let txtFile = getTextFile(fn, server);