From 96a5cfde020cad02e07e56bc002ff500e99adb17 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 22 Dec 2024 05:34:53 +0100 Subject: [PATCH] fix: unable to buy fish bait --- src/services/inventoryService.ts | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 32c08151..be09e6bd 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -35,6 +35,7 @@ import { ExportBoosterPacks, ExportCustoms, ExportFlavour, + ExportGear, ExportRecipes, ExportResources, ExportUpgrades @@ -186,6 +187,22 @@ export const addItem = async ( } }; } + if (typeName in ExportGear) { + const inventory = await getInventory(accountId); + const consumablesChanges = [ + { + ItemType: typeName, + ItemCount: quantity + } satisfies IConsumable + ]; + addConsumables(inventory, consumablesChanges); + await inventory.save(); + return { + InventoryChanges: { + Consumables: consumablesChanges + } + }; + } // Path-based duck typing switch (typeName.substr(1).split("/")[1]) { @@ -329,21 +346,6 @@ export const addItem = async ( }; } break; - case "Restoratives": // Codex Scanner, Remote Observer, Starburst - const inventory = await getInventory(accountId); - const consumablesChanges = [ - { - ItemType: typeName, - ItemCount: quantity - } satisfies IConsumable - ]; - addConsumables(inventory, consumablesChanges); - await inventory.save(); - return { - InventoryChanges: { - Consumables: consumablesChanges - } - }; } break; }