From ba3df4bdbc553ae4606b142a0c49dbd1fea6faa7 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 13 Jul 2025 21:08:23 -0700 Subject: [PATCH] fix: don't give mastery xp for SpecialItems except for venari (#2484) Closes #2482 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2484 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/services/inventoryService.ts | 44 ++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 30db6edc..94736a08 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -1662,28 +1662,34 @@ export const applyClientEquipmentUpdates = ( item.XP ??= 0; item.XP += XP; - let xpItemType = item.ItemType; - if (item.ModularParts) { - for (const part of item.ModularParts) { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - const partType = ExportWeapons[part]?.partType; - if (partType !== undefined && xpEarningParts.indexOf(partType) != -1) { - xpItemType = part; - break; + if ( + categoryName != "SpecialItems" || + item.ItemType == "/Lotus/Powersuits/Khora/Kavat/KhoraKavatPowerSuit" || + item.ItemType == "/Lotus/Powersuits/Khora/Kavat/KhoraPrimeKavatPowerSuit" + ) { + let xpItemType = item.ItemType; + if (item.ModularParts) { + for (const part of item.ModularParts) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + const partType = ExportWeapons[part]?.partType; + if (partType !== undefined && xpEarningParts.indexOf(partType) != -1) { + xpItemType = part; + break; + } } + logger.debug(`adding xp to ${xpItemType} for modular item ${fromOid(ItemId)} (${item.ItemType})`); } - logger.debug(`adding xp to ${xpItemType} for modular item ${fromOid(ItemId)} (${item.ItemType})`); - } - const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == xpItemType); - if (xpinfoIndex !== -1) { - const xpinfo = inventory.XPInfo[xpinfoIndex]; - xpinfo.XP += XP; - } else { - inventory.XPInfo.push({ - ItemType: xpItemType, - XP: XP - }); + const xpinfoIndex = inventory.XPInfo.findIndex(x => x.ItemType == xpItemType); + if (xpinfoIndex !== -1) { + const xpinfo = inventory.XPInfo[xpinfoIndex]; + xpinfo.XP += XP; + } else { + inventory.XPInfo.push({ + ItemType: xpItemType, + XP: XP + }); + } } }