Adds a previously missing `throw` to allow `bladeburner.setActionLevel()` to properly produce errors and prevent invalid action levels from being set.
This commit is contained in:
MPJ / Quadryo 2022-08-26 20:59:26 +02:00 committed by GitHub
parent a5fb280be8
commit 197081dd3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -250,7 +250,7 @@ export function NetscriptBladeburner(): InternalAPI<INetscriptBladeburner> {
checkBladeburnerAccess(ctx);
const action = getBladeburnerActionObject(ctx, type, name);
if (level < 1 || level > action.maxLevel) {
helpers.makeRuntimeErrorMsg(ctx, `Level must be between 1 and ${action.maxLevel}, is ${level}`);
throw helpers.makeRuntimeErrorMsg(ctx, `Level must be between 1 and ${action.maxLevel}, is ${level}`);
}
action.level = level;
},