From 21162c8cddd958ddeaa51fd58944af9c028c6b22 Mon Sep 17 00:00:00 2001 From: omuretsu <84951833+Snarling@users.noreply.github.com> Date: Mon, 15 May 2023 22:55:57 -0400 Subject: [PATCH] Fix stanek not recalculating stats immediately on game load --- src/CotMG/StaneksGift.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CotMG/StaneksGift.ts b/src/CotMG/StaneksGift.ts index cc2ae41c5..9c460030e 100644 --- a/src/CotMG/StaneksGift.ts +++ b/src/CotMG/StaneksGift.ts @@ -13,10 +13,11 @@ import { Player } from "@player"; import { AugmentationNames } from "../Augmentation/data/AugmentationNames"; import { defaultMultipliers, mergeMultipliers, Multipliers, scaleMultipliers } from "../PersonObjects/Multipliers"; import { StaticAugmentations } from "../Augmentation/StaticAugmentations"; +import { getKeyList } from "src/utils/helpers/getKeyList"; export class StaneksGift extends BaseGift { isBonusCharging = false; - justCharged = false; + justCharged = true; storedCycles = 0; constructor() { super(); @@ -244,14 +245,16 @@ export class StaneksGift extends BaseGift { this.storedCycles = 0; } + static includedProperties = getKeyList(StaneksGift, { removedKeys: ["justCharged"] }); + /** Serialize Staneks Gift to a JSON save state. */ toJSON(): IReviverValue { - return Generic_toJSON("StaneksGift", this); + return Generic_toJSON("StaneksGift", this, StaneksGift.includedProperties); } /** Initializes Staneks Gift from a JSON save state */ static fromJSON(value: IReviverValue): StaneksGift { - return Generic_fromJSON(StaneksGift, value.data); + return Generic_fromJSON(StaneksGift, value.data, StaneksGift.includedProperties); } }