From 631d6ef04a5ef4c67e984900725edcf8e8833ea1 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 21 Jul 2022 18:27:23 -0400 Subject: [PATCH] fix few bugs --- src/NetscriptFunctions.ts | 8 ++++++++ src/PersonObjects/Player/PlayerObjectWorkMethods.ts | 1 + 2 files changed, 9 insertions(+) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index c022f1dad..ac30ca233 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -467,6 +467,14 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { const argsToString = function (args: unknown[]): string { let out = ""; for (let arg of args) { + if (arg === null) { + out += "null"; + continue; + } + if (arg === undefined) { + out += "undefined"; + continue; + } arg = toNative(arg); out += typeof arg === "object" ? JSON.stringify(arg) : `${arg}`; } diff --git a/src/PersonObjects/Player/PlayerObjectWorkMethods.ts b/src/PersonObjects/Player/PlayerObjectWorkMethods.ts index 058c79b0c..949e1774f 100644 --- a/src/PersonObjects/Player/PlayerObjectWorkMethods.ts +++ b/src/PersonObjects/Player/PlayerObjectWorkMethods.ts @@ -18,4 +18,5 @@ export function finish(this: IPlayer, cancelled: boolean): void { if (this.currentWork === null) return; this.currentWork.finish(this, cancelled); this.currentWork = null; + this.focus = false; }