diff --git a/!Compatibility/api/wowAPI.lua b/!Compatibility/api/wowAPI.lua index 86a191f..34d7179 100644 --- a/!Compatibility/api/wowAPI.lua +++ b/!Compatibility/api/wowAPI.lua @@ -402,22 +402,22 @@ function GetItemInfoByName(itemName) end function GetItemCount(itemName) - local count = 0 - for bag = 4, 0, -1 do - for slot = 1, GetContainerNumSlots(bag) do - local _, itemCount = GetContainerItemInfo(bag, slot); - if itemCount then - local itemLink = GetContainerItemLink(bag,slot) - local _, _, itemParse = strfind(itemLink, "(%d+):") - local queryName, _, _, _, _, _ = GetItemInfo(itemParse) - if queryName and queryName ~= "" then - if queryName == itemName then - count = count + itemCount; - end - end - end - end - end + local count = 0 + for bag = 4, 0, -1 do + for slot = 1, GetContainerNumSlots(bag) do + local _, itemCount = GetContainerItemInfo(bag, slot) + if itemCount then + local itemLink = GetContainerItemLink(bag,slot) + local _, _, itemParse = strfind(itemLink, "(%d+):") + local queryName, _, _, _, _, _ = GetItemInfo(itemParse) + if queryName and queryName ~= "" then + if queryName == itemName then + count = count + itemCount + end + end + end + end + end - return count + return count end \ No newline at end of file