From 963d138150dbfe27f790a0fabadff6306137dba2 Mon Sep 17 00:00:00 2001 From: Sainan Date: Tue, 25 Feb 2025 05:47:57 +0100 Subject: [PATCH] feat: give additionalItems for weapons --- src/services/inventoryService.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 81da3eb1..f2f8fc26 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -285,6 +285,11 @@ export const addItem = async ( const weapon = ExportWeapons[typeName]; if (weapon.totalDamage != 0) { const inventoryChanges = addEquipment(inventory, weapon.productCategory, typeName); + if (weapon.additionalItems) { + for (const item of weapon.additionalItems) { + combineInventoryChanges(inventoryChanges, await addItem(inventory, item, 1)); + } + } updateSlots(inventory, InventorySlot.WEAPONS, 0, 1); return { InventoryChanges: {