fix: give defaultUpgrades for infested pets #1710
@ -17,7 +17,7 @@ import { getDefaultUpgrades } from "@/src/services/itemDataService";
 | 
				
			|||||||
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
 | 
					import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
 | 
				
			||||||
import { IEquipmentDatabase } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
					import { IEquipmentDatabase } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
				
			||||||
import { getRandomInt } from "@/src/services/rngService";
 | 
					import { getRandomInt } from "@/src/services/rngService";
 | 
				
			||||||
import { ExportSentinels } from "warframe-public-export-plus";
 | 
					import { ExportSentinels, IDefaultUpgrade } from "warframe-public-export-plus";
 | 
				
			||||||
import { Status } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
					import { Status } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface IModularCraftRequest {
 | 
					interface IModularCraftRequest {
 | 
				
			||||||
@ -34,10 +34,8 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
 | 
				
			|||||||
    const category = modularWeaponTypes[data.WeaponType];
 | 
					    const category = modularWeaponTypes[data.WeaponType];
 | 
				
			||||||
    const inventory = await getInventory(accountId);
 | 
					    const inventory = await getInventory(accountId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const defaultUpgrades = getDefaultUpgrades(data.Parts);
 | 
					    let defaultUpgrades: IDefaultUpgrade[] | undefined;
 | 
				
			||||||
    const defaultOverwrites: Partial<IEquipmentDatabase> = {
 | 
					    const defaultOverwrites: Partial<IEquipmentDatabase> = {};
 | 
				
			||||||
        Configs: applyDefaultUpgrades(inventory, defaultUpgrades)
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    const inventoryChanges: IInventoryChanges = {};
 | 
					    const inventoryChanges: IInventoryChanges = {};
 | 
				
			||||||
    if (category == "KubrowPets") {
 | 
					    if (category == "KubrowPets") {
 | 
				
			||||||
        const traits = {
 | 
					        const traits = {
 | 
				
			||||||
@ -132,7 +130,12 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
 | 
				
			|||||||
        for (const specialItem of ExportSentinels[data.WeaponType].exalted!) {
 | 
					        for (const specialItem of ExportSentinels[data.WeaponType].exalted!) {
 | 
				
			||||||
            addSpecialItem(inventory, specialItem, inventoryChanges);
 | 
					            addSpecialItem(inventory, specialItem, inventoryChanges);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        defaultUpgrades = ExportSentinels[data.WeaponType].defaultUpgrades;
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					        defaultUpgrades = getDefaultUpgrades(data.Parts);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    defaultOverwrites.Configs = applyDefaultUpgrades(inventory, defaultUpgrades);
 | 
				
			||||||
    addEquipment(inventory, category, data.WeaponType, data.Parts, inventoryChanges, defaultOverwrites);
 | 
					    addEquipment(inventory, category, data.WeaponType, data.Parts, inventoryChanges, defaultOverwrites);
 | 
				
			||||||
    combineInventoryChanges(inventoryChanges, occupySlot(inventory, productCategoryToInventoryBin(category)!, false));
 | 
					    combineInventoryChanges(inventoryChanges, occupySlot(inventory, productCategoryToInventoryBin(category)!, false));
 | 
				
			||||||
    if (defaultUpgrades) {
 | 
					    if (defaultUpgrades) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user