mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-24 17:31:47 +00:00
Make upgrade.canPurchase return false when already bought
This commit is contained in:
parent
04f14c17bd
commit
8dd2cbe466
1 changed files with 3 additions and 1 deletions
|
@ -137,7 +137,9 @@ export function createUpgrade<T extends UpgradeOptions>(
|
|||
upgrade.bought = bought;
|
||||
Object.assign(upgrade, decoratedData);
|
||||
|
||||
upgrade.canPurchase = computed(() => requirementsMet(upgrade.requirements));
|
||||
upgrade.canPurchase = computed(
|
||||
() => !bought.value && requirementsMet(upgrade.requirements)
|
||||
);
|
||||
upgrade.purchase = function () {
|
||||
const genericUpgrade = upgrade as GenericUpgrade;
|
||||
if (!unref(genericUpgrade.canPurchase)) {
|
||||
|
|
Loading…
Reference in a new issue