Fix buyables' onPurchase not being called

This commit is contained in:
thepaperpilot 2022-05-20 16:49:54 -05:00
parent 1e6104a349
commit 3f10abbb09

View file

@ -161,7 +161,7 @@ export function createBuyable<T extends BuyableOptions>(
);
genericBuyable.amount.value = Decimal.add(genericBuyable.amount.value, 1);
}
this.onPurchase?.(cost);
genericBuyable.onPurchase?.(cost);
};
processComputable(buyable as T, "display");
const display = buyable.display;