safeguyard against Formulas.exe missing

This commit is contained in:
Olivier Gagnon 2021-10-28 15:59:04 -04:00
parent dc88d9b478
commit ee5eaf9658
3 changed files with 9 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -5,6 +5,7 @@ import { sanitizeExploits } from "./Exploits/Exploit";
import { Reviver } from "./utils/JSONReviver"; import { Reviver } from "./utils/JSONReviver";
import Decimal from "decimal.js"; import Decimal from "decimal.js";
import { Programs } from "./Programs/Programs";
export let Player = new PlayerObject(); export let Player = new PlayerObject();
@ -29,4 +30,9 @@ export function loadPlayer(saveString: string): void {
} }
Player.exploits = sanitizeExploits(Player.exploits); Player.exploits = sanitizeExploits(Player.exploits);
const home = Player.getHomeComputer();
if (Player.sourceFileLvl(5) > 0 && !home.programs.includes(Programs.Formulas.name)) {
Player.getHomeComputer().programs.push(Programs.Formulas.name);
}
} }