fix few bugs

This commit is contained in:
Olivier Gagnon 2022-07-21 18:27:23 -04:00
parent 590bc37db0
commit 631d6ef04a
2 changed files with 9 additions and 0 deletions

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

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