forked from OpenWF/SpaceNinjaServer
		
	fix: always multiply acquired gear quantity by purchaseQuantity (#1924)
Closes #1915 Reviewed-on: OpenWF/SpaceNinjaServer#1924 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									9468768947
								
							
						
					
					
						commit
						c06abded11
					
				@ -11,7 +11,7 @@ import {
 | 
				
			|||||||
import { getAccountForRequest, getAccountFromSuffixedName, getSuffixedName } from "@/src/services/loginService";
 | 
					import { getAccountForRequest, getAccountFromSuffixedName, getSuffixedName } from "@/src/services/loginService";
 | 
				
			||||||
import { addItems, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
 | 
					import { addItems, combineInventoryChanges, getInventory } from "@/src/services/inventoryService";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					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 { handleStoreItemAcquisition } from "@/src/services/purchaseService";
 | 
				
			||||||
import { fromStoreItem, isStoreItem } from "@/src/services/itemDataService";
 | 
					import { fromStoreItem, isStoreItem } from "@/src/services/itemDataService";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -50,7 +50,7 @@ export const inboxController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                inventory,
 | 
					                inventory,
 | 
				
			||||||
                attachmentItems.map(attItem => ({
 | 
					                attachmentItems.map(attItem => ({
 | 
				
			||||||
                    ItemType: isStoreItem(attItem) ? fromStoreItem(attItem) : attItem,
 | 
					                    ItemType: isStoreItem(attItem) ? fromStoreItem(attItem) : attItem,
 | 
				
			||||||
                    ItemCount: attItem in ExportGear ? (ExportGear[attItem].purchaseQuantity ?? 1) : 1
 | 
					                    ItemCount: 1
 | 
				
			||||||
                })),
 | 
					                })),
 | 
				
			||||||
                inventoryChanges
 | 
					                inventoryChanges
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
 | 
				
			|||||||
@ -486,6 +486,10 @@ export const addItem = async (
 | 
				
			|||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (typeName in ExportGear) {
 | 
					    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 = [
 | 
					        const consumablesChanges = [
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                ItemType: typeName,
 | 
					                ItemType: typeName,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user