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; }