From 4a5edb9f3c5cdd9e7af7d40b156d3f0a7a442e13 Mon Sep 17 00:00:00 2001 From: phyzical Date: Mon, 4 Apr 2022 19:44:25 +0800 Subject: [PATCH] changes static arrays to functions to force new creation when called --- src/Augmentation/AugmentationCreator.tsx | 6 +++--- src/Augmentation/AugmentationHelpers.tsx | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Augmentation/AugmentationCreator.tsx b/src/Augmentation/AugmentationCreator.tsx index d8429d0db..f9693c1bf 100644 --- a/src/Augmentation/AugmentationCreator.tsx +++ b/src/Augmentation/AugmentationCreator.tsx @@ -94,7 +94,7 @@ function getRandomBonus(): any { return bonuses[Math.floor(bonuses.length * randomNumber.random())]; } -export const generalAugmentations = [ +export const initGeneralAugmentations = (): Augmentation[] => [ new Augmentation({ name: AugmentationNames.HemoRecirculator, moneyCost: 4.5e7, @@ -1486,7 +1486,7 @@ export const generalAugmentations = [ }), ]; -export const bladeburnerAugmentations = [ +export const initBladeburnerAugmentations = (): Augmentation[] => [ new Augmentation({ name: AugmentationNames.EsperEyewear, repCost: 1.25e3, @@ -1751,7 +1751,7 @@ export const bladeburnerAugmentations = [ }), ]; -export const churchOfTheMachineGodAugmentations = [ +export const initChurchOfTheMachineGodAugmentations = (): Augmentation[] => [ new Augmentation({ name: AugmentationNames.StaneksGift1, repCost: 0, diff --git a/src/Augmentation/AugmentationHelpers.tsx b/src/Augmentation/AugmentationHelpers.tsx index d30f80786..2250d65f3 100644 --- a/src/Augmentation/AugmentationHelpers.tsx +++ b/src/Augmentation/AugmentationHelpers.tsx @@ -15,9 +15,9 @@ import { clearObject } from "../utils/helpers/clearObject"; import { FactionNames } from "../Faction/data/FactionNames"; import { - bladeburnerAugmentations, - churchOfTheMachineGodAugmentations, - generalAugmentations, + initBladeburnerAugmentations, + initChurchOfTheMachineGodAugmentations, + initGeneralAugmentations, initNeuroFluxGovernor, initUnstableCircadianModulator, } from "./AugmentationCreator"; @@ -49,9 +49,9 @@ function createAugmentations(): void { [ initNeuroFluxGovernor(), initUnstableCircadianModulator(), - ...generalAugmentations, - ...(factionExists(FactionNames.Bladeburners) ? bladeburnerAugmentations : []), - ...(factionExists(FactionNames.ChurchOfTheMachineGod) ? churchOfTheMachineGodAugmentations : []), + ...initGeneralAugmentations(), + ...(factionExists(FactionNames.Bladeburners) ? initBladeburnerAugmentations() : []), + ...(factionExists(FactionNames.ChurchOfTheMachineGod) ? initChurchOfTheMachineGodAugmentations() : []), ].map(resetAugmentation); }