From 29594391a6c0f12b2586ba9e349d9ee0f9718737 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 23 Dec 2022 23:57:05 -0600 Subject: [PATCH] Don't reset foundation progress when loading save --- src/data/layers/workshop.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/data/layers/workshop.tsx b/src/data/layers/workshop.tsx index 4a0401a..8ac7f16 100644 --- a/src/data/layers/workshop.tsx +++ b/src/data/layers/workshop.tsx @@ -30,6 +30,7 @@ import { import { noPersist, persistent } from "game/persistence"; import Decimal, { DecimalSource, formatWhole } from "util/bignum"; import { Direction, WithRequired } from "util/common"; +import { loadingSave } from "util/save"; import { render } from "util/vue"; import { computed, ref, unref, watchEffect } from "vue"; import elves from "./elves"; @@ -144,7 +145,10 @@ const layer = createLayer(id, function (this: BaseLayer) { })); watchEffect(() => { - if (Decimal.lt(computedMaxFoundation.value, foundationProgress.value)) { + if ( + !loadingSave.value && + Decimal.lt(computedMaxFoundation.value, foundationProgress.value) + ) { foundationProgress.value = Decimal.min(0, computedMaxFoundation.value); } });