From dfe9e98c77f4d1de558b2c9daa854aeac7800c0f Mon Sep 17 00:00:00 2001 From: phyzical Date: Mon, 4 Apr 2022 18:29:43 +0800 Subject: [PATCH] move route to terminal to the inside of the common fucntion * tested without bandaid still works correctly * fix default script with installAugmentations --- src/Augmentation/AugmentationHelpers.tsx | 2 ++ src/NetscriptFunctions/Singularity.ts | 2 +- src/ui/GameRoot.tsx | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Augmentation/AugmentationHelpers.tsx b/src/Augmentation/AugmentationHelpers.tsx index d30f80786..1d00506c6 100644 --- a/src/Augmentation/AugmentationHelpers.tsx +++ b/src/Augmentation/AugmentationHelpers.tsx @@ -21,6 +21,7 @@ import { initNeuroFluxGovernor, initUnstableCircadianModulator, } from "./AugmentationCreator"; +import { Router } from "../ui/GameRoot"; export function AddToAugmentations(aug: Augmentation): void { const name = aug.name; @@ -186,6 +187,7 @@ function installAugmentations(): boolean { "
You wake up in your home...you feel different...", ); prestigeAugmentation(); + Router.toTerminal(); return true; } diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 51daf0189..0e813e303 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -218,7 +218,7 @@ export function NetscriptSingularity( workerScript.running = false; killWorkerScript(workerScript); }, - installAugmentations: function (_cbScript: unknown): boolean { + installAugmentations: function (_cbScript: unknown = ""): boolean { const cbScript = helper.string("installAugmentations", "cbScript", _cbScript); helper.updateDynamicRam("installAugmentations", getRamCost(player, "installAugmentations")); helper.checkSingularityAccess("installAugmentations"); diff --git a/src/ui/GameRoot.tsx b/src/ui/GameRoot.tsx index 3934fbd6c..f8a94602e 100644 --- a/src/ui/GameRoot.tsx +++ b/src/ui/GameRoot.tsx @@ -491,7 +491,6 @@ export function GameRoot({ player, engine, terminal }: IProps): React.ReactEleme }} installAugmentationsFn={() => { installAugmentations(); - Router.toTerminal(); }} /> );