minor fix in instance calculation

This commit is contained in:
Olivier Gagnon 2022-08-29 10:06:20 -04:00
parent 2f7463d092
commit 0942b7b6ee

@ -23,7 +23,7 @@ import { Locations } from "../../Locations/Locations";
import { CityName } from "../../Locations/data/CityNames"; import { CityName } from "../../Locations/data/CityNames";
import { LocationName } from "../../Locations/data/LocationNames"; import { LocationName } from "../../Locations/data/LocationNames";
import { Sleeve } from "../Sleeve/Sleeve"; import { Sleeve } from "../Sleeve/Sleeve";
import { SleeveCompanyWork } from "../Sleeve/Work/SleeveCompanyWork"; import { isSleeveCompanyWork, SleeveCompanyWork } from "../Sleeve/Work/SleeveCompanyWork";
import { import {
calculateSkill as calculateSkillF, calculateSkill as calculateSkillF,
calculateSkillProgress as calculateSkillProgressF, calculateSkillProgress as calculateSkillProgressF,
@ -595,9 +595,9 @@ export function quitJob(this: IPlayer, company: string): void {
this.finishWork(true); this.finishWork(true);
} }
for (const sleeve of this.sleeves) { for (const sleeve of this.sleeves) {
if (sleeve.currentWork instanceof SleeveCompanyWork && sleeve.currentWork.companyName === company){ if (isSleeveCompanyWork(sleeve.currentWork) && sleeve.currentWork.companyName === company) {
sleeve.stopWork(this); sleeve.stopWork(this);
dialogBoxCreate(`You quit ${company} while one of your sleeves was working there. The sleeve is now idle.`) dialogBoxCreate(`You quit ${company} while one of your sleeves was working there. The sleeve is now idle.`);
} }
} }
delete this.jobs[company]; delete this.jobs[company];