From 1dd37a401d6d3c0a19229f357511bb48edfac748 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sat, 15 Aug 2009 04:06:38 +0200 Subject: [PATCH] Fixed item match on ignored slots --- Broker_Equipment.lua | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Broker_Equipment.lua b/Broker_Equipment.lua index 16acb42..8966a7c 100644 --- a/Broker_Equipment.lua +++ b/Broker_Equipment.lua @@ -62,16 +62,18 @@ local function GetTextureIndex(tex) end local function matchEquipped(name) - for k, v in next, GetEquipmentSetItemIDs(name) do - local link = GetInventoryItemLink('player', k) - if(link) then - local id = tonumber(string.match(link, 'item:(%d+)')) - if(id ~= v) then - return - end - else - if(v ~= 0) then - return + 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 end end -- 1.7.9.5