mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 01:23:49 +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) => {
|
quitJob: (ctx) => (_companyName) => {
|
||||||
helpers.checkSingularityAccess(ctx);
|
helpers.checkSingularityAccess(ctx);
|
||||||
const companyName = getEnumHelper("CompanyName").nsGetMember(ctx, _companyName);
|
const companyName = getEnumHelper("CompanyName").nsGetMember(ctx, _companyName);
|
||||||
Player.quitJob(companyName);
|
Player.quitJob(companyName, true);
|
||||||
},
|
},
|
||||||
getCompanyRep: (ctx) => (_companyName) => {
|
getCompanyRep: (ctx) => (_companyName) => {
|
||||||
helpers.checkSingularityAccess(ctx);
|
helpers.checkSingularityAccess(ctx);
|
||||||
|
@ -361,16 +361,18 @@ export function getNextCompanyPosition(
|
|||||||
return pos;
|
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) {
|
if (isCompanyWork(this.currentWork) && this.currentWork.companyName === company) {
|
||||||
this.finishWork(true);
|
this.finishWork(true);
|
||||||
}
|
}
|
||||||
for (const sleeve of this.sleeves) {
|
for (const sleeve of this.sleeves) {
|
||||||
if (sleeve.currentWork?.type === SleeveWorkType.COMPANY && sleeve.currentWork.companyName === company) {
|
if (sleeve.currentWork?.type === SleeveWorkType.COMPANY && sleeve.currentWork.companyName === company) {
|
||||||
sleeve.stopWork();
|
sleeve.stopWork();
|
||||||
|
if (!suppressDialog) {
|
||||||
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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user