Fix softlock

This commit is contained in:
thepaperpilot 2022-12-01 00:45:59 -06:00
parent 6cb3492782
commit 9e16c98949
3 changed files with 24 additions and 9 deletions

View file

@ -46,8 +46,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
}));
const manualPlantUpgrade1 = createUpgrade(() => ({
resource: saplings,
cost: 5,
resource: logs,
cost: 10,
display: {
title: "Leafy Fingers",
description: "Plant an additional tree per click"
@ -62,8 +62,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
}));
const autoPlantUpgrade1 = createUpgrade(() => ({
resource: saplings,
cost: 10,
resource: logs,
cost: 25,
display: {
title: "Automated Spade",
description: "Plant a tree every second"

View file

@ -1,11 +1,17 @@
import "@fontsource/material-icons";
import Spacer from "components/layout/Spacer.vue";
import { CoercableComponent, Component, GatherProps, GenericComponent, jsx } from "features/feature";
import {
CoercableComponent,
Component,
GatherProps,
GenericComponent,
jsx
} from "features/feature";
import { BaseLayer, createLayer, GenericLayer, layers } from "game/layers";
import { persistent } from "game/persistence";
import type { PlayerData } from "game/player";
import type { LayerData, PlayerData } from "game/player";
import player from "game/player";
import { format, formatTime } from "util/bignum";
import Decimal, { format, formatTime } from "util/bignum";
import { Computable, convertComputable, ProcessedComputable } from "util/computed";
import { createLazyProxy } from "util/proxies";
import { renderRow, VueFeature } from "util/vue";
@ -316,5 +322,14 @@ export function fixOldSave(
oldVersion: string | undefined,
player: Partial<PlayerData>
// eslint-disable-next-line @typescript-eslint/no-empty-function
): void {}
): void {
if (oldVersion === "0.0") {
if (player.layers?.trees) {
(player.layers.trees as LayerData<typeof trees>).trees = Decimal.sub(
10,
(player.layers.trees as LayerData<typeof trees>).saplings ?? 0
);
}
}
}
/* eslint-enable @typescript-eslint/no-unused-vars */

View file

@ -8,7 +8,7 @@
"discordName": "",
"discordLink": "",
"versionNumber": "0.0",
"versionNumber": "0.1",
"versionTitle": "Initial Commit",
"allowGoBack": true,