mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 18:50:56 +02:00
fix undying script bug
This commit is contained in:
@@ -941,6 +941,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
return runScriptFromScript("run", scriptServer, scriptname, args, workerScript, threads);
|
||||
},
|
||||
exec: function (scriptname: any, hostname: any, threads: any = 1, ...args: any[]): any {
|
||||
console.log(`${scriptname} ${hostname} ${threads} ${JSON.stringify(args)}`);
|
||||
updateDynamicRam("exec", getRamCost("exec"));
|
||||
if (scriptname === undefined || hostname === undefined) {
|
||||
throw makeRuntimeErrorMsg("exec", "Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)");
|
||||
@@ -1061,11 +1062,13 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
throw makeRuntimeErrorMsg("scp", "No scripts to copy");
|
||||
}
|
||||
let res = true;
|
||||
await Promise.all(scripts.map(async function(script) {
|
||||
if (!await NetscriptFunctions(workerScript).scp(script, hostname1, hostname2)) {
|
||||
res = false;
|
||||
}
|
||||
}));
|
||||
await Promise.all(
|
||||
scripts.map(async function (script) {
|
||||
if (!(await NetscriptFunctions(workerScript).scp(script, hostname1, hostname2))) {
|
||||
res = false;
|
||||
}
|
||||
}),
|
||||
);
|
||||
return Promise.resolve(res);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user