mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 04:35:46 +01:00
Merge pull request #4062 from Snarling/sleevesQuitToo
SLEEVES: FIX #4051 Sleeves no longer crash when player quits company sleeve was working
This commit is contained in:
commit
2f7463d092
@ -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,12 @@ 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.stopWork(this);
|
||||
dialogBoxCreate(`You quit ${company} while one of your sleeves was working there. The sleeve is now idle.`)
|
||||
}
|
||||
}
|
||||
delete this.jobs[company];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user