From dbe36fd6b74507b2033cccacc46f9d3c28cb867f Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Tue, 21 Dec 2021 07:03:59 -0500 Subject: [PATCH] Fix #1916: Check blade console blackops rank This prevents the player from starting a blackops without having the rank requirements --- src/Bladeburner/Bladeburner.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Bladeburner/Bladeburner.tsx b/src/Bladeburner/Bladeburner.tsx index 06396301a..7136e7b9a 100644 --- a/src/Bladeburner/Bladeburner.tsx +++ b/src/Bladeburner/Bladeburner.tsx @@ -164,6 +164,12 @@ export class Bladeburner implements IBladeburner { } 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) { throw new Error("Failed to get BlackOperation object for: " + actionId.name); }