Minor refactor

This commit is contained in:
Undeemiss 2022-05-17 15:54:05 -05:00
parent d52e1f44b4
commit b3aa0578fb

@ -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);
},