From ea595173fb67ce41dedd62c9a0e218dc3f53b030 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 29 Apr 2025 21:27:48 +0200 Subject: [PATCH] fix: always multiply acquired gear quantity by purchaseQuantity --- src/controllers/api/inboxController.ts | 4 ++-- src/services/inventoryService.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/controllers/api/inboxController.ts b/src/controllers/api/inboxController.ts index 7adc2d3d..7462de3e 100644 --- a/src/controllers/api/inboxController.ts +++ b/src/controllers/api/inboxController.ts @@ -11,7 +11,7 @@ import { import { getAccountForRequest, getAccountFromSuffixedName, getSuffixedName } from "@/src/services/loginService"; import { addItems, combineInventoryChanges, getInventory } from "@/src/services/inventoryService"; import { logger } from "@/src/utils/logger"; -import { ExportFlavour, ExportGear } from "warframe-public-export-plus"; +import { ExportFlavour } from "warframe-public-export-plus"; import { handleStoreItemAcquisition } from "@/src/services/purchaseService"; import { fromStoreItem, isStoreItem } from "@/src/services/itemDataService"; @@ -50,7 +50,7 @@ export const inboxController: RequestHandler = async (req, res) => { inventory, attachmentItems.map(attItem => ({ ItemType: isStoreItem(attItem) ? fromStoreItem(attItem) : attItem, - ItemCount: attItem in ExportGear ? (ExportGear[attItem].purchaseQuantity ?? 1) : 1 + ItemCount: 1 })), inventoryChanges ); diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index da8b0848..6c5a4b06 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -486,6 +486,10 @@ export const addItem = async ( }; } if (typeName in ExportGear) { + // Multipling by purchase quantity for gear because: + // - The Saya's Vigil scanner message has it as a non-counted attachment. + // - Blueprints for Ancient Protector Specter, Shield Osprey Specter, etc. have num=1 despite giving their purchaseQuantity. + quantity *= ExportGear[typeName].purchaseQuantity ?? 1; const consumablesChanges = [ { ItemType: typeName,