From 84d7b5a62e36ca3a9c6fb2f907d6e66c72659024 Mon Sep 17 00:00:00 2001 From: Sainan Date: Sun, 23 Feb 2025 03:54:46 -0800 Subject: [PATCH] fix: handle droptable giving a 3-day booster (#993) e.g. sorties can rarely give these Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/993 Co-authored-by: Sainan Co-committed-by: Sainan --- src/services/missionInventoryUpdateService.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 3d10bc39..5d7ecf16 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -11,7 +11,6 @@ import { addFocusXpIncreases, addFusionTreasures, addGearExpByCategory, - addItem, addMiscItems, addMissionComplete, addMods, @@ -28,6 +27,7 @@ import { getEntriesUnsafe } from "@/src/utils/ts-utils"; import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes"; import junctionRewards from "@/static/fixed_responses/junctionRewards.json"; import { IJunctionRewards } from "@/src/types/commonTypes"; +import { handleStoreItemAcquisition } from "./purchaseService"; const getRotations = (rotationCount: number): number[] => { if (rotationCount === 0) return [0]; @@ -287,8 +287,7 @@ export const addMissionRewards = async ( } for (const reward of MissionRewards) { - //TODO: additem should take in storeItems - const inventoryChange = await addItem(inventory, reward.StoreItem.replace("StoreItems/", ""), reward.ItemCount); + const inventoryChange = await handleStoreItemAcquisition(reward.StoreItem, inventory, reward.ItemCount); //TODO: combineInventoryChanges improve type safety, merging 2 of the same item? //TODO: check for the case when two of the same item are added, combineInventoryChanges should merge them, but the client also merges them //TODO: some conditional types to rule out binchanges?