Merge pull request #4049 from MPJ-K/dev

NETSCRIPT: FIX #3963 Prevent bladeburner.setActionLevel from setting invalid action levels
This commit is contained in:
hydroflame 2022-08-29 11:20:28 -03:00 committed by GitHub
commit a0475cc630
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;
},