diff --git a/ui/core/proto_utils/utils.ts b/ui/core/proto_utils/utils.ts index b2f994f07c..36ff47ec6d 100644 --- a/ui/core/proto_utils/utils.ts +++ b/ui/core/proto_utils/utils.ts @@ -1667,10 +1667,11 @@ export function enchantAppliesToItem(enchant: Enchant, item: Item): boolean { const sharedSlots = intersection(getEligibleEnchantSlots(enchant), getEligibleItemSlots(item)); if (sharedSlots.length === 0) return false; - if (item.handType === HandType.HandTypeTwoHand && enchant.enchantType !== EnchantType.EnchantTypeTwoHand) return false; - if (item.weaponType === WeaponType.WeaponTypeShield && enchant.enchantType !== EnchantType.EnchantTypeShield) return false; - if (item.weaponType === WeaponType.WeaponTypeOffHand && enchant.enchantType !== EnchantType.EnchantTypeOffHand) return false; - if (item.weaponType === WeaponType.WeaponTypeStaff && enchant.enchantType !== EnchantType.EnchantTypeStaff) return false; + if (enchant.enchantType === EnchantType.EnchantTypeTwoHand && item.handType !== HandType.HandTypeTwoHand) return false; + if (enchant.enchantType === EnchantType.EnchantTypeStaff && item.weaponType !== WeaponType.WeaponTypeStaff) return false; + if ((enchant.enchantType === EnchantType.EnchantTypeShield) !== (item.weaponType === WeaponType.WeaponTypeShield)) return false; + if ((enchant.enchantType === EnchantType.EnchantTypeOffHand) !== (item.weaponType === WeaponType.WeaponTypeOffHand)) return false; + if (sharedSlots.includes(ItemSlot.ItemSlotRanged)) { if (