Fix working for the CIA

This commit is contained in:
Olivier Gagnon 2021-10-16 12:19:53 -04:00
parent 371d41b7c3
commit 99c75baea0
4 changed files with 13 additions and 10 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -608,7 +608,7 @@ export function process(this: IPlayer, router: IRouter, numCycles = 1): void {
export function cancelationPenalty(this: IPlayer): number { export function cancelationPenalty(this: IPlayer): number {
const data = serverMetadata.find((s) => s.specialName === this.companyName); const data = serverMetadata.find((s) => s.specialName === this.companyName);
if (!data) throw new Error("Couldn't find server for company " + this.companyName); if (!data) return 0.5; // Does not have special server.
const server = GetServer(data.hostname); const server = GetServer(data.hostname);
if (server instanceof Server) { if (server instanceof Server) {
if (server && server.backdoorInstalled) return 0.75; if (server && server.backdoorInstalled) return 0.75;
@ -2658,9 +2658,12 @@ export function setMult(this: IPlayer, name: string, mult: number): void {
(this as any)[name] = mult; (this as any)[name] = mult;
} }
export function sourceFileLvl(this: IPlayer, n: number): number { export function canAccessCotMG(this: IPlayer): boolean {
for (const sf of this.sourceFiles) { return this.bitNodeN === 13 || SourceFileFlags[13] > 0;
if (sf.n === n) return sf.lvl; }
}
return 0; export function sourceFileLvl(this: IPlayer, n: number): number {
const sf = this.sourceFiles.find((sf) => sf.n === n);
if (!sf) return 0;
return sf.lvl;
} }