From 3f10abbb097549a384bac8845090a821c0f62166 Mon Sep 17 00:00:00 2001
From: thepaperpilot <thepaperpilot@gmail.com>
Date: Fri, 20 May 2022 16:49:54 -0500
Subject: [PATCH] Fix buyables' onPurchase not being called

---
 src/features/buyable.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/features/buyable.tsx b/src/features/buyable.tsx
index 7f94ad4..1adcce5 100644
--- a/src/features/buyable.tsx
+++ b/src/features/buyable.tsx
@@ -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;