fix: give corresponding weapon when crafting Hound
All checks were successful
Build / build (pull_request) Successful in 1m32s

This commit is contained in:
AMelonInsideLemon 2025-04-23 21:29:35 +02:00
parent eb594af9d8
commit 604ae5776a

View File

@ -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, IDefaultUpgrade } from "warframe-public-export-plus"; import { ExportSentinels, ExportWeapons, IDefaultUpgrade } from "warframe-public-export-plus";
import { Status } from "@/src/types/inventoryTypes/inventoryTypes"; import { Status } from "@/src/types/inventoryTypes/inventoryTypes";
interface IModularCraftRequest { interface IModularCraftRequest {
@ -138,6 +138,23 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
} else { } else {
defaultUpgrades = getDefaultUpgrades(data.Parts); defaultUpgrades = getDefaultUpgrades(data.Parts);
} }
if (category == "MoaPets" && data.WeaponType.startsWith("/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPet")) {
const defaultWeaponMap = {
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetAPowerSuit":
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetMeleeWeaponIP",
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetBPowerSuit":
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetMeleeWeaponIS",
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetCPowerSuit":
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetMeleeWeaponPS"
};
if (data.WeaponType in defaultWeaponMap) {
const weapon = defaultWeaponMap[data.WeaponType as keyof typeof defaultWeaponMap];
const category = ExportWeapons[weapon].productCategory;
addEquipment(inventory, category, weapon);
occupySlot(inventory, productCategoryToInventoryBin(category)!, !!data.isWebUi);
}
}
defaultOverwrites.Configs = applyDefaultUpgrades(inventory, defaultUpgrades); defaultOverwrites.Configs = applyDefaultUpgrades(inventory, defaultUpgrades);
addEquipment(inventory, category, data.WeaponType, data.Parts, inventoryChanges, defaultOverwrites); addEquipment(inventory, category, data.WeaponType, data.Parts, inventoryChanges, defaultOverwrites);
combineInventoryChanges( combineInventoryChanges(