From b3aa0578fb10821dae3af2a11d3d0d2f20c80670 Mon Sep 17 00:00:00 2001 From: Undeemiss Date: Tue, 17 May 2022 15:54:05 -0500 Subject: [PATCH] Minor refactor --- src/NetscriptFunctions.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index a555a6665..6674d6944 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -988,12 +988,9 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { LogBoxEvents.emit(runningScriptObj); }, - closeTail: function (pid?: number): void { + closeTail: function (_pid: unknown = workerScript.scriptRef.pid): void { updateDynamicRam("closeTail", getRamCost(Player, "closeTail")); - //Get the pid of the calling script if no pid is given - if (pid === undefined) { - pid = workerScript.scriptRef.pid; - } + const pid = helper.number("closeTail", "pid", _pid); //Emit an event to tell the game to close the tail window if it exists LogBoxCloserEvents.emit(pid); },