MISC: move server constants into their own constant (#1075)

This commit is contained in:
Caldwell
2024-02-10 10:13:42 +01:00
committed by GitHub
parent fd5b0f8241
commit 4d551915b3
13 changed files with 56 additions and 48 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ import { workerScripts } from "../Netscript/WorkerScripts";
import { scriptKey } from "../utils/helpers/scriptKey";
import type { ScriptFilePath } from "../Paths/ScriptFilePath";
import { ServerConstants } from "../Server/data/Constants";
export function scriptCalculateOfflineProduction(runningScript: RunningScript): void {
//The Player object stores the last update time from when we were online
@@ -83,7 +84,7 @@ export function scriptCalculateOfflineProduction(runningScript: RunningScript):
);
runningScript.log(`Called weaken() on ${serv.hostname} ${timesWeakened} times while offline`);
const coreBonus = 1 + (host.cpuCores - 1) / 16;
serv.weaken(CONSTANTS.ServerWeakenAmount * timesWeakened * coreBonus);
serv.weaken(ServerConstants.ServerWeakenAmount * timesWeakened * coreBonus);
}
}
}