comparison Gear.lua @ 69:69db1c3025ac v27

fixed some bugs with 6.2 item link format changes, added bib overwolf support
author yellowfive
date Mon, 06 Jul 2015 17:39:57 -0700
parents 932885bb1a6f
children 6abc0858b45e
comparison
equal deleted inserted replaced
68:6c523f147709 69:69db1c3025ac
664 664
665 local old = player.Equipped[spec][slotId] 665 local old = player.Equipped[spec][slotId]
666 old = Amr.ParseItemLink(old) 666 old = Amr.ParseItemLink(old)
667 667
668 local new = gear[slotId] 668 local new = gear[slotId]
669 669 if new then
670 local diff = countItemDifferences(old, new) 670 local diff = countItemDifferences(old, new)
671 if diff < 1000 then 671 if diff < 1000 then
672 -- same item, see if inventory has one that is closer (e.g. a duplicate item with correct enchants/gems) 672 -- same item, see if inventory has one that is closer (e.g. a duplicate item with correct enchants/gems)
673 local bestLink, bestItem, bestDiff = Amr:FindMatchingItem(new, player, usedItems) 673 local bestLink, bestItem, bestDiff = Amr:FindMatchingItem(new, player, usedItems)
674 if bestDiff and bestDiff < diff then 674 if bestDiff and bestDiff < diff then
675 itemsToEquip[slotId] = new
676 remaining = remaining + 1
677 end
678 else
675 itemsToEquip[slotId] = new 679 itemsToEquip[slotId] = new
676 remaining = remaining + 1 680 remaining = remaining + 1
677 end 681 end
678 else
679 itemsToEquip[slotId] = new
680 remaining = remaining + 1
681 end 682 end
682 end 683 end
683 684
684 if remaining > 0 then 685 if remaining > 0 then
685 _pendingEquip = { 686 _pendingEquip = {