workerscript log takes a function now, hopefully this will increase performance.

This commit is contained in:
Olivier Gagnon
2021-11-26 18:30:58 -05:00
parent fe3aa5a357
commit c05518e162
14 changed files with 376 additions and 316 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel
const checkSleeveNumber = function (func: any, sleeveNumber: any): void {
if (sleeveNumber >= player.sleeves.length || sleeveNumber < 0) {
const msg = `Invalid sleeve number: ${sleeveNumber}`;
workerScript.log(func, msg);
workerScript.log(func, () => msg);
throw helper.makeRuntimeErrorMsg(`sleeve.${func}`, msg);
}
};