FORMULAS: Removing the possible exception when gymGains/universityGains is called (#898)

This commit is contained in:
Shockwave 2023-11-02 08:22:17 +08:00 committed by GitHub
parent 87e2f5c23b
commit 023f32bce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -85,7 +85,7 @@ export function calculateFactionExp(person: IPerson, type: FactionWorkType): Wor
export function calculateCost(classs: Class, location: Location): number {
const serverMeta = serverMetadata.find((s) => s.specialName === location.name);
const server = GetServer(serverMeta ? serverMeta.hostname : "");
const discount = (server as Server).backdoorInstalled ? 0.9 : 1;
const discount = (server as Server)?.backdoorInstalled ? 0.9 : 1;
return classs.earnings.money * location.costMult * discount;
}