mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
Remove sleeve message when quitting job from a script (#1357)
This commit is contained in:
parent
bd5c502f53
commit
653d531d0a
@ -747,7 +747,7 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
||||
quitJob: (ctx) => (_companyName) => {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
const companyName = getEnumHelper("CompanyName").nsGetMember(ctx, _companyName);
|
||||
Player.quitJob(companyName);
|
||||
Player.quitJob(companyName, true);
|
||||
},
|
||||
getCompanyRep: (ctx) => (_companyName) => {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
|
@ -361,14 +361,16 @@ export function getNextCompanyPosition(
|
||||
return pos;
|
||||
}
|
||||
|
||||
export function quitJob(this: PlayerObject, company: CompanyName): void {
|
||||
export function quitJob(this: PlayerObject, company: CompanyName, suppressDialog?: boolean): void {
|
||||
if (isCompanyWork(this.currentWork) && this.currentWork.companyName === company) {
|
||||
this.finishWork(true);
|
||||
}
|
||||
for (const sleeve of this.sleeves) {
|
||||
if (sleeve.currentWork?.type === SleeveWorkType.COMPANY && sleeve.currentWork.companyName === company) {
|
||||
sleeve.stopWork();
|
||||
dialogBoxCreate(`You quit ${company} while one of your sleeves was working there. The sleeve is now idle.`);
|
||||
if (!suppressDialog) {
|
||||
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