fix: give defaultUpgrades for infested pets
All checks were successful
Build / build (push) Successful in 43s
Build / build (pull_request) Successful in 1m36s

This commit is contained in:
Sainan 2025-04-17 23:49:16 +02:00
parent 41d976d362
commit d3f9956d0f

View File

@ -17,7 +17,7 @@ import { getDefaultUpgrades } from "@/src/services/itemDataService";
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
import { IEquipmentDatabase } from "@/src/types/inventoryTypes/commonInventoryTypes";
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";
interface IModularCraftRequest {
@ -34,10 +34,8 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
const category = modularWeaponTypes[data.WeaponType];
const inventory = await getInventory(accountId);
const defaultUpgrades = getDefaultUpgrades(data.Parts);
const defaultOverwrites: Partial<IEquipmentDatabase> = {
Configs: applyDefaultUpgrades(inventory, defaultUpgrades)
};
let defaultUpgrades: IDefaultUpgrade[] | undefined;
const defaultOverwrites: Partial<IEquipmentDatabase> = {};
const inventoryChanges: IInventoryChanges = {};
if (category == "KubrowPets") {
const traits = {
@ -132,7 +130,12 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
for (const specialItem of ExportSentinels[data.WeaponType].exalted!) {
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);
combineInventoryChanges(inventoryChanges, occupySlot(inventory, productCategoryToInventoryBin(category)!, false));
if (defaultUpgrades) {