Skip to content

Commit

Permalink
fix enchants for weapons/shields/offhands
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Jan 18, 2025
1 parent 355a069 commit d205c51
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/core/proto_utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit d205c51

Please sign in to comment.