diff --git a/api/api.lua b/api/api.lua index c129245b..104bc63a 100644 --- a/api/api.lua +++ b/api/api.lua @@ -232,7 +232,7 @@ function pfUI.api.GetItemCount(itemName) if itemCount then local itemLink = GetContainerItemLink(bag,slot) local _, _, itemParse = strfind(itemLink, "(%d+):") - local queryName, _, _, _, _, _ = GetItemInfo(itemParse) + local queryName = GetItemInfo(itemParse) if queryName and queryName ~= "" then if queryName == itemName then count = count + itemCount; @@ -257,23 +257,13 @@ function pfUI.api.GetBagFamily(bag) local _, _, id = strfind(GetInventoryItemLink("player", ContainerIDToInventoryID(bag)) or "", "item:(%d+)") if id then - local _, _, _, _, itemType, subType = GetItemInfo(id) + local _, _, _, _, _, itemType, subType = GetItemInfo(id) local bagsubtype = L["bagtypes"][subType] if bagsubtype == "DEFAULT" then return "BAG" end if bagsubtype == "SOULBAG" then return "SOULBAG" end if bagsubtype == "QUIVER" then return "QUIVER" end - if bagsubtype == nil and GetContainerNumFreeSlots then - -- handle new bag classes introduced in TBC - local _, subtype = GetContainerNumFreeSlots(bag) - if subtype and subtype > 0 then - return "SPECIAL" - else - return "BAG" - end - elseif bagsubtype == nil then - return "SPECIAL" - end + if bagsubtype == nil then return "SPECIAL" end end return nil diff --git a/compat/vanilla.lua b/compat/vanilla.lua index 29fa640e..66f1dab1 100644 --- a/compat/vanilla.lua +++ b/compat/vanilla.lua @@ -53,3 +53,11 @@ function hooksecurefunc(name, func, append) _G[name] = pfUI.hooks[tostring(func)]["function"] end + +do -- GetItemInfo + local name, link, rarity, minlevel, itype, isubtype, stack + function GetItemInfo(item) + name, link, rarity, minlevel, itype, isubtype, stack = _G.GetItemInfo(item) + return name, link, rarity, nil, minlevel, itype, isubtype, stack + end +end diff --git a/skins/blizzard/character.lua b/skins/blizzard/character.lua index 9dd90981..a2849354 100644 --- a/skins/blizzard/character.lua +++ b/skins/blizzard/character.lua @@ -135,7 +135,7 @@ pfUI:RegisterSkin("Character", "vanilla:tbc", function () if ShaguScore and GetInventoryItemLink("player", slotId) and slot.scoreText then local _, _, itemID = string.find(GetInventoryItemLink("player", slotId), "item:(%d+):%d+:%d+:%d+") local itemLevel = ShaguScore.Database[tonumber(itemID)] or 0 - local _, _, itemRarity, _, _, _, _, itemSlot, _ = GetItemInfo(itemID) + local _, _, itemRarity, _, _, _, _, _, itemSlot, _ = GetItemInfo(itemID) local r,g,b = GetItemQualityColor((itemRarity or 1)) local score = ShaguScore:Calculate(itemSlot, itemRarity, itemLevel) if score and score > 0 then