mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 23:38:35 +02:00
GRAFTING: Add new api for checking ongoing grafting (#1435)
This commit is contained in:
@@ -97,5 +97,18 @@ export function NetscriptGrafting(): InternalAPI<IGrafting> {
|
||||
helpers.log(ctx, () => `Began grafting Augmentation ${augName}.`);
|
||||
return true;
|
||||
},
|
||||
|
||||
waitForOngoingGrafting: (ctx) => () => {
|
||||
checkGraftingAPIAccess(ctx);
|
||||
if (!Player.currentWork) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!(Player.currentWork instanceof GraftingWork)) {
|
||||
return Promise.reject(
|
||||
`The current work is not a grafting work. Type of current work: ${Player.currentWork.type}.`,
|
||||
);
|
||||
}
|
||||
return Player.currentWork.completion;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user