mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
Merge pull request #3104 from MartinFournier/fix/bladeburner-early-routing
Attempt to fix `bladeburner.process()` early routing issue
This commit is contained in:
commit
1ed27bb88a
@ -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);
|
||||
|
@ -111,6 +111,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||
);
|
||||
|
||||
export let Router: IRouter = {
|
||||
isInitialized: false,
|
||||
page: () => {
|
||||
throw new Error("Router called before initialization");
|
||||
},
|
||||
@ -267,6 +268,7 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme
|
||||
}
|
||||
|
||||
Router = {
|
||||
isInitialized: true,
|
||||
page: () => page,
|
||||
allowRouting: (value: boolean) => setAllowRoutingCalls(value),
|
||||
toActiveScripts: () => setPage(Page.ActiveScripts),
|
||||
|
@ -54,6 +54,7 @@ export interface IRouter {
|
||||
// toMission(): void;
|
||||
// toRedPill(): void;
|
||||
// toworkInProgress(): void;
|
||||
isInitialized: boolean;
|
||||
page(): Page;
|
||||
allowRouting(value: boolean): void;
|
||||
toActiveScripts(): void;
|
||||
|
Loading…
Reference in New Issue
Block a user