Merge pull request #1743 from danielyxie/dev

spawn defaults to 1 thread
This commit is contained in:
hydroflame 2021-11-18 18:01:04 -05:00 committed by GitHub
commit 73bbf4d454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)");