Correctly label functions so that disableLog will work

This commit is contained in:
Jeffrey A. Robinson
2022-01-12 16:55:45 -08:00
parent 3e7a9ac896
commit 910c9d9e7e
3 changed files with 9 additions and 12 deletions

View File

@@ -172,7 +172,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
throw makeRuntimeRejectMsg(
workerScript,
`Invalid scriptArgs argument passed into getRunningScript() from ${callingFnName}(). ` +
`This is probably a bug. Please report to game developer`,
`This is probably a bug. Please report to game developer`,
);
}
@@ -432,8 +432,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
throw makeRuntimeErrorMsg(funcName, `${argName} should be a string`);
},
number: (funcName: string, argName: string, v: any): number => {
if (!isNaN(v))
{
if (!isNaN(v)) {
if (typeof v === "number") return v;
if (!isNaN(parseFloat(v))) return parseFloat(v);
}
@@ -700,8 +699,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
workerScript.log(
"weaken",
() =>
`'${server.hostname}' security level weakened to ${
server.hackDifficulty
`'${server.hostname}' security level weakened to ${server.hackDifficulty
}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)})`,
);
workerScript.scriptRef.onlineExpGained += expGain;