diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index df60d64e8..cd128000b 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -839,7 +839,8 @@ const base: InternalAPI = { throw helpers.makeRuntimeErrorMsg(ctx, "No scripts to copy"); } let res = true; - scripts.map(function (script) { + scripts.forEach(function (script) { + //TODO: This array method still needs to be reworked because it is terribly inefficient. if (!NetscriptFunctions(ctx.workerScript).scp(script, destination, source)) { res = false; } diff --git a/src/NetscriptJSEvaluator.ts b/src/NetscriptJSEvaluator.ts index d3e31f1d2..46a9ef5c1 100644 --- a/src/NetscriptJSEvaluator.ts +++ b/src/NetscriptJSEvaluator.ts @@ -29,7 +29,7 @@ export async function compile(player: IPlayer, script: Script, scripts: Script[] // but not really behaves like import. Particularly, it cannot // load fully dynamic content. So we hide the import from webpack // by placing it inside an eval call. - await script.updateRamUsage(player, scripts); + script.updateRamUsage(player, scripts); const uurls = _getScriptUrls(script, scripts, []); const url = uurls[uurls.length - 1].url; if (script.url && script.url !== url) { diff --git a/src/ScriptEditor/ui/ScriptEditorRoot.tsx b/src/ScriptEditor/ui/ScriptEditorRoot.tsx index fa4db9370..7256fd3a9 100644 --- a/src/ScriptEditor/ui/ScriptEditorRoot.tsx +++ b/src/ScriptEditor/ui/ScriptEditorRoot.tsx @@ -277,7 +277,7 @@ export function Root(props: IProps): React.ReactElement { } setUpdatingRam(true); const codeCopy = newCode + ""; - const ramUsage = await calculateRamUsage(props.player, codeCopy, props.player.getCurrentServer().scripts); + const ramUsage = calculateRamUsage(props.player, codeCopy, props.player.getCurrentServer().scripts); if (ramUsage.cost > 0) { const entries = ramUsage.entries?.sort((a, b) => b.cost - a.cost) ?? []; const entriesDisp = [];