spawn defaults to 1 thread

This commit is contained in:
Olivier Gagnon 2021-11-18 18:00:20 -05:00
parent ca7cb0bead
commit 762b5b44aa
3 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -889,7 +889,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
const server = safeGetServer(hostname, "exec"); const server = safeGetServer(hostname, "exec");
return runScriptFromScript("exec", server, scriptname, args, workerScript, threads); return runScriptFromScript("exec", server, scriptname, args, workerScript, threads);
}, },
spawn: function (scriptname: any, threads: any, ...args: any[]): any { spawn: function (scriptname: any, threads: any = 1, ...args: any[]): any {
updateDynamicRam("spawn", getRamCost("spawn")); updateDynamicRam("spawn", getRamCost("spawn"));
if (!scriptname || !threads) { if (!scriptname || !threads) {
throw makeRuntimeErrorMsg("spawn", "Usage: spawn(scriptname, threads)"); throw makeRuntimeErrorMsg("spawn", "Usage: spawn(scriptname, threads)");