mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-22 22:22:26 +01:00
getRunningScript fix
This commit is contained in:
parent
c05518e162
commit
6fb38b5439
@ -1961,16 +1961,12 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
updateDynamicRam("getRunningScript", getRamCost("getRunningScript"));
|
||||
|
||||
let runningScript;
|
||||
if (args.length === 0) {
|
||||
if (fn === undefined && hostname === undefined && args.length === 0) {
|
||||
runningScript = workerScript.scriptRef;
|
||||
} else if (typeof fn === "number") {
|
||||
runningScript = getRunningScriptByPid(fn, "getRunningScript");
|
||||
} else {
|
||||
const scriptArgs = [];
|
||||
for (let i = 2; i < args.length; ++i) {
|
||||
scriptArgs.push(args[i]);
|
||||
}
|
||||
runningScript = getRunningScript(fn, hostname, "getRunningScript", scriptArgs);
|
||||
runningScript = getRunningScript(fn, hostname, "getRunningScript", args);
|
||||
}
|
||||
if (runningScript === null) return null;
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user