diff --git a/module_bags.lua b/module_bags.lua index b99cf6d..0fd73a1 100755 --- a/module_bags.lua +++ b/module_bags.lua @@ -18,7 +18,7 @@ function child:scanBag(bag) if(item) then local itemInfo = C_Container.GetContainerItemInfo(bag, slot) local id = item:GetItemID() - if(id) then + if(itemInfo and id) then empty = false itemlist[id] = itemlist[id] or {} itemlist[id]['count'] = itemlist[id]['count'] or 0 @@ -35,11 +35,11 @@ local function scanAllBags(delayed) local playerID = child.getPID() if(playerID) then local tab = modul['db'][playerID] - for bag=0,4 do + for bag=Enum.BagIndex.Backpack ,Enum.BagIndex.ReagentBag do tab[bag] = child:scanBag(bag) -- loop all bought bags end for k,v in pairs(modul['db'][playerID]) do - if(k<0 or k>4) then + if(kEnum.BagIndex.ReagentBag) then tab[k] = nil -- prevent bogus bags end end