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

View File

@@ -109,7 +109,7 @@ export function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript, he
}
const node = getHacknetNode(i, "upgradeCache");
if (!(node instanceof HacknetServer)) {
workerScript.log("upgradeCache", "Can only be called on hacknet servers");
workerScript.log("upgradeCache", () => "Can only be called on hacknet servers");
return false;
}
const res = purchaseCacheUpgrade(player, node, n);
@@ -136,7 +136,7 @@ export function NetscriptHacknet(player: IPlayer, workerScript: WorkerScript, he
}
const node = getHacknetNode(i, "upgradeCache");
if (!(node instanceof HacknetServer)) {
workerScript.log("getCacheUpgradeCost", "Can only be called on hacknet servers");
workerScript.log("getCacheUpgradeCost", () => "Can only be called on hacknet servers");
return -1;
}
return node.calculateCacheUpgradeCost(n);