From fef4570a7deac4bb170209a357a29c018ad13a45 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sun, 13 Sep 2009 00:26:00 +0200 Subject: [PATCH] Allow location matching instead of itemid - Should fix any issues with identic items with different gemming/enchants --- Broker_Equipment.lua | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Broker_Equipment.lua b/Broker_Equipment.lua index 8966a7c..1d56922 100644 --- a/Broker_Equipment.lua +++ b/Broker_Equipment.lua @@ -62,19 +62,17 @@ local function GetTextureIndex(tex) end local function matchEquipped(name) - for slot, id in next, GetEquipmentSetItemIDs(name) do - if(id ~= 1) then - local link = GetInventoryItemLink('player', slot) - if(link) then - local current = tonumber(string.match(link, 'item:(%d+)')) - if(current ~= id) then - return - end - else - if(id ~= 0) then - return - end - end + local located + for slot, location in next, GetEquipmentSetLocations(name) do + if(location == 0) then + located = not GetInventoryItemLink('player', slot) + elseif(location ~= 1) then + local player, bank, bags = EquipmentManager_UnpackLocation(location) + located = player and not bank and not bags + end + + if(not located) then + return end end -- 1.7.9.5