返回提交历史
Modified
src/controllers/api/inboxController.ts
+2
-2
Modified
src/services/inventoryService.ts
+4
-0
XFEstudio/XFESpaceNinjaServer
fix: always multiply acquired gear quantity by purchaseQuantity (#1924)
Closes #1915 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1924 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
c06abded
代码差异
2 个文件
+6
-2
@@ -11,7 +11,7 @@ import {
11
11
import { getAccountForRequest, getAccountFromSuffixedName, getSuffixedName } from "@/src/services/loginService";
12
12
import { addItems, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
13
13
import { logger } from "@/src/utils/logger";
14
import { ExportFlavour, ExportGear } from "warframe-public-export-plus";
14
import { ExportFlavour } from "warframe-public-export-plus";
15
15
import { handleStoreItemAcquisition } from "@/src/services/purchaseService";
16
16
import { fromStoreItem, isStoreItem } from "@/src/services/itemDataService";
17
17
@@ -50,7 +50,7 @@ export const inboxController: RequestHandler = async (req, res) => {
50
50
inventory,
51
51
attachmentItems.map(attItem => ({
52
52
ItemType: isStoreItem(attItem) ? fromStoreItem(attItem) : attItem,
53
ItemCount: attItem in ExportGear ? (ExportGear[attItem].purchaseQuantity ?? 1) : 1
53
ItemCount: 1
54
54
})),
55
55
inventoryChanges
56
56
);
@@ -486,6 +486,10 @@ export const addItem = async (
486
486
};
487
487
}
488
488
if (typeName in ExportGear) {
489
// Multipling by purchase quantity for gear because:
490
// - The Saya's Vigil scanner message has it as a non-counted attachment.
491
// - Blueprints for Ancient Protector Specter, Shield Osprey Specter, etc. have num=1 despite giving their purchaseQuantity.
492
quantity *= ExportGear[typeName].purchaseQuantity ?? 1;
489
493
const consumablesChanges = [
490
494
{
491
495
ItemType: typeName,