use GetContainerItemCharges from classicapi

This commit is contained in:
Brues
2026-05-27 23:50:10 -05:00
parent 3ef78044fb
commit d47287da3a
+10 -9
View File
@@ -698,19 +698,20 @@ pfUI:RegisterModule("bags", function ()
end end
end end
local itemID = C_Container.GetContainerItemID(bag, slot)
local texture, count, locked, quality = GetContainerItemInfo(bag, slot) local texture, count, locked, quality = GetContainerItemInfo(bag, slot)
-- Nampower 4.1.4+: spellChargesRemaining gives accurate charge count for
-- charged items (e.g. Brilliant Mana Oil). if count == 1 then
-- Only use it when stackCount == 1 and spellChargesRemaining > 1, local charges = C_Container.GetContainerItemCharges(bag, slot)
-- otherwise we'd override normal stack counts. if charges > 1 then
if GetBagItem then count = charges
local ok, itemInfo = pcall(GetBagItem, bag, slot)
if ok and itemInfo and itemInfo.stackCount == 1 and itemInfo.spellChargesRemaining and itemInfo.spellChargesRemaining > 1 then
count = itemInfo.spellChargesRemaining
end end
end end
local _, _, q, _, _, _, itype = GetItemInfo(C_Container.GetContainerItemID(bag, slot))
local _, _, q, _, _, _, itype = GetItemInfo(itemID)
-- running advanced item color scan -- running advanced item color scan
if C.appearance.bags.borderonlygear == "0" and texture and quality and quality < 1 then if C.appearance.bags.borderonlygear == "0" and texture and quality and quality < 1 then