fix: give corresponding weapon when crafting Hound #1816

Merged
Sainan merged 2 commits from AMelonInsideLemon/SpaceNinjaServer:give-hound-weapon into main 2025-04-24 11:24:54 -07:00
2 changed files with 9 additions and 14 deletions
Showing only changes of commit ffa967c038 - Show all commits

View File

@ -139,20 +139,15 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
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];
if (category == "MoaPets") {
const weapon = ExportSentinels[data.WeaponType].defaultWeapon;
if (weapon) {
const category = ExportWeapons[weapon].productCategory;
addEquipment(inventory, category, weapon);
occupySlot(inventory, productCategoryToInventoryBin(category)!, !!data.isWebUi);
addEquipment(inventory, category, weapon, undefined, inventoryChanges);
combineInventoryChanges(
inventoryChanges,
occupySlot(inventory, productCategoryToInventoryBin(category)!, !!data.isWebUi)
);
}
}
defaultOverwrites.Configs = applyDefaultUpgrades(inventory, defaultUpgrades);

View File

@ -66,7 +66,7 @@ const getItemListsController: RequestHandler = (req, response) => {
});
}
for (const [uniqueName, item] of Object.entries(ExportSentinels)) {
if (item.productCategory != "SpecialItems") {
if (item.productCategory == "Sentinels" || item.productCategory == "KubrowPets") {
Sainan marked this conversation as resolved
Review

Not really related to this PR, but alongside this, maybe the MoaPets array should be removed from res again.

Not really related to this PR, but alongside this, maybe the MoaPets array should be removed from `res` again.
res[item.productCategory].push({
uniqueName,
name: getString(item.name, lang),