Fix #1916: Check blade console blackops rank

This prevents the player from starting a blackops without having the
rank requirements
This commit is contained in:
Martin Fournier 2021-12-21 07:03:59 -05:00
parent f2ccc63b2d
commit dbe36fd6b7

@ -164,6 +164,12 @@ export class Bladeburner implements IBladeburner {
} }
const action = this.getActionObject(actionId); const action = this.getActionObject(actionId);
if (!(action instanceof BlackOperation)) throw new Error(`Action should be BlackOperation but isn't`);
if (action.reqdRank > (player.bladeburner?.rank ?? 0)) {
this.resetAction();
this.log("Error: Tried to start a Black Operation without the rank requirement");
break;
}
if (action == null) { if (action == null) {
throw new Error("Failed to get BlackOperation object for: " + actionId.name); throw new Error("Failed to get BlackOperation object for: " + actionId.name);
} }