From 830e0a0be19383f12ca09aa13e9a274b1d8cb9bc Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sat, 25 Jul 2026 10:34:33 -0500 Subject: [PATCH] Drop vanilla GetItemInfo shim for C_Item.GetItemInfo The compat/vanilla.lua GetItemInfo override reshaped vanilla's tuple into retail order by inserting nil at slot 4 (itemLevel), but truncated at 8 fields, dropping itemEquipLoc/itemTexture. ClassicAPI's global GetItemInfo keeps the vanilla shape (its hook only warms the item cache), so the shim stayed necessary but incomplete. Remove it and point the three callers at ClassicAPI's C_Item.GetItemInfo, which returns the full 18-field retail tuple. Positions 1-8 are identical to the old shim output, so bags/roll are unchanged; character.lua's itemSlot (equipLoc, field 9) was always nil under the truncating shim and now resolves correctly for ShaguScore. --- compat/vanilla.lua | 9 --------- modules/bags.lua | 2 +- modules/roll.lua | 2 +- skins/blizzard/character.lua | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/compat/vanilla.lua b/compat/vanilla.lua index 0e2dc39f..26e698a0 100644 --- a/compat/vanilla.lua +++ b/compat/vanilla.lua @@ -29,15 +29,6 @@ UNITFRAME_SECURE_TEMPLATE = nil --[[ Vanilla API Extensions ]]-- -do -- GetItemInfo - local name, link, rarity, minlevel, itype, isubtype, stack - function GetItemInfo(item) - if not item then return end - name, link, rarity, minlevel, itype, isubtype, stack = _G.GetItemInfo(item) - return name, link, rarity, nil, minlevel, itype, isubtype, stack - end -end - do -- RunMacroText local obj = { ["GetText"] = function(self) return self.text end } obj = setmetatable(obj, {__index = function(tab,key) diff --git a/modules/bags.lua b/modules/bags.lua index d8b1198b..99116b88 100644 --- a/modules/bags.lua +++ b/modules/bags.lua @@ -448,7 +448,7 @@ pfUI:RegisterModule("bags", function () end end - local _, _, q, _, _, _, itype = GetItemInfo(itemID) + local _, _, q, _, _, _, itype = C_Item.GetItemInfo(itemID) -- running advanced item color scan if C.appearance.bags.borderonlygear == "0" and texture and quality and quality < 1 then diff --git a/modules/roll.lua b/modules/roll.lua index e0253e08..7cab0d11 100644 --- a/modules/roll.lua +++ b/modules/roll.lua @@ -42,7 +42,7 @@ pfUI:RegisterModule("roll", function () end local _, _, itemLink = string.find(hyperlink, "(item:%d+:%d+:%d+:%d+)") - local itemName = GetItemInfo(itemLink) + local itemName = C_Item.GetItemInfo(itemLink) -- delete obsolete tables if pfUI.roll.cache[itemName] and pfUI.roll.cache[itemName]["TIMESTAMP"] < GetTime() - 60 then diff --git a/skins/blizzard/character.lua b/skins/blizzard/character.lua index 96189c5c..271e532d 100644 --- a/skins/blizzard/character.lua +++ b/skins/blizzard/character.lua @@ -131,7 +131,7 @@ pfUI:RegisterSkin("Character", function () if ShaguScore and itemID then local itemLevel = C_Item.GetCurrentItemLevel({ equipmentSlotIndex = slotId }) - local _, _, quality, _, _, _, _, _, itemSlot, _ = GetItemInfo(itemID) + local _, _, quality, _, _, _, _, _, itemSlot, _ = C_Item.GetItemInfo(itemID) local score = ShaguScore:Calculate(itemSlot, quality, itemLevel) if score and score > 0 and quality and quality > 0 then local r,g,b = GetItemQualityColor(quality)