sleevesQuitToo

This commit is contained in:
Snarling
2022-08-29 04:02:38 -04:00
parent 3ee55b2918
commit c2af87a769

@ -23,6 +23,7 @@ import { Locations } from "../../Locations/Locations";
import { CityName } from "../../Locations/data/CityNames";
import { LocationName } from "../../Locations/data/LocationNames";
import { Sleeve } from "../Sleeve/Sleeve";
import { SleeveCompanyWork } from "../Sleeve/Work/SleeveCompanyWork";
import {
calculateSkill as calculateSkillF,
calculateSkillProgress as calculateSkillProgressF,
@ -593,6 +594,11 @@ export function quitJob(this: IPlayer, company: string): void {
if (isCompanyWork(this.currentWork) && this.currentWork.companyName === company) {
this.finishWork(true);
}
for (const sleeve of this.sleeves) {
if (sleeve.currentWork instanceof SleeveCompanyWork && sleeve.currentWork.companyName === company){
sleeve.currentWork.finish(this);
}
}
delete this.jobs[company];
}