mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-11 04:42:34 +01:00
CORPORATION: Add missing checks for Export API (#1202)
This commit is contained in:
@ -411,6 +411,9 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
||||
(ctx) =>
|
||||
(_sourceDivision, _sourceCity, _targetDivision, _targetCity, _materialName, _amt): void => {
|
||||
checkAccess(ctx, CorpUnlockName.WarehouseAPI);
|
||||
if (!hasUnlock(CorpUnlockName.Export)) {
|
||||
throw helpers.errorMessage(ctx, `You have not unlocked the Export feature!`);
|
||||
}
|
||||
const sourceDivision = helpers.string(ctx, "sourceDivision", _sourceDivision);
|
||||
const sourceCity = getEnumHelper("CityName").nsGetMember(ctx, _sourceCity, "sourceCity");
|
||||
const targetDivision = getDivision(helpers.string(ctx, "targetDivision", _targetDivision));
|
||||
@ -424,6 +427,9 @@ export function NetscriptCorporation(): InternalAPI<NSCorporation> {
|
||||
(ctx) =>
|
||||
(_sourceDivision, _sourceCity, _targetDivision, _targetCity, _materialName): void => {
|
||||
checkAccess(ctx, CorpUnlockName.WarehouseAPI);
|
||||
if (!hasUnlock(CorpUnlockName.Export)) {
|
||||
throw helpers.errorMessage(ctx, `You have not unlocked the Export feature!`);
|
||||
}
|
||||
const sourceDivision = helpers.string(ctx, "sourceDivision", _sourceDivision);
|
||||
const sourceCity = getEnumHelper("CityName").nsGetMember(ctx, _sourceCity, "sourceCity");
|
||||
const targetDivision = helpers.string(ctx, "targetDivision", _targetDivision);
|
||||
|
Reference in New Issue
Block a user