Don't reset foundation progress when loading save

This commit is contained in:
thepaperpilot 2022-12-23 23:57:05 -06:00
parent 1ab77440fb
commit 29594391a6

View file

@ -30,6 +30,7 @@ import {
import { noPersist, persistent } from "game/persistence"; import { noPersist, persistent } from "game/persistence";
import Decimal, { DecimalSource, formatWhole } from "util/bignum"; import Decimal, { DecimalSource, formatWhole } from "util/bignum";
import { Direction, WithRequired } from "util/common"; import { Direction, WithRequired } from "util/common";
import { loadingSave } from "util/save";
import { render } from "util/vue"; import { render } from "util/vue";
import { computed, ref, unref, watchEffect } from "vue"; import { computed, ref, unref, watchEffect } from "vue";
import elves from "./elves"; import elves from "./elves";
@ -144,7 +145,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
})); }));
watchEffect(() => { watchEffect(() => {
if (Decimal.lt(computedMaxFoundation.value, foundationProgress.value)) { if (
!loadingSave.value &&
Decimal.lt(computedMaxFoundation.value, foundationProgress.value)
) {
foundationProgress.value = Decimal.min(0, computedMaxFoundation.value); foundationProgress.value = Decimal.min(0, computedMaxFoundation.value);
} }
}); });