diff --git a/src/Bladeburner/Bladeburner.tsx b/src/Bladeburner/Bladeburner.tsx index 4b47874b3..7f4d99936 100644 --- a/src/Bladeburner/Bladeburner.tsx +++ b/src/Bladeburner/Bladeburner.tsx @@ -1914,6 +1914,9 @@ export class Bladeburner implements IBladeburner { } process(router: IRouter, player: IPlayer): void { + // Edge race condition when the engine checks the processing counters and attempts to route before the router is initialized. + if (!router.isInitialized) return; + // Edge case condition...if Operation Daedalus is complete trigger the BitNode if (router.page() !== Page.BitVerse && this.blackops.hasOwnProperty("Operation Daedalus")) { return router.toBitVerse(false, false); diff --git a/src/ui/GameRoot.tsx b/src/ui/GameRoot.tsx index 5dc290211..8dfa085cf 100644 --- a/src/ui/GameRoot.tsx +++ b/src/ui/GameRoot.tsx @@ -111,6 +111,7 @@ const useStyles = makeStyles((theme: Theme) => ); export let Router: IRouter = { + isInitialized: false, page: () => { throw new Error("Router called before initialization"); }, @@ -266,6 +267,7 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme } Router = { + isInitialized: true, page: () => page, allowRouting: (value: boolean) => setAllowRoutingCalls(value), toActiveScripts: () => setPage(Page.ActiveScripts), diff --git a/src/ui/Router.ts b/src/ui/Router.ts index 2e89f6f3d..c840c8b86 100644 --- a/src/ui/Router.ts +++ b/src/ui/Router.ts @@ -54,6 +54,7 @@ export interface IRouter { // toMission(): void; // toRedPill(): void; // toworkInProgress(): void; + isInitialized: boolean; page(): Page; allowRouting(value: boolean): void; toActiveScripts(): void;