mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-22 00:21:31 +00:00
Make upgrade.canPurchase return false when already bought
This commit is contained in:
parent
3092fb91a9
commit
2a362a95c3
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