From d69da1a7d5e86b8611de473c4e6c9e071003f1d0 Mon Sep 17 00:00:00 2001 From: Parnic Date: Wed, 16 Nov 2022 20:33:58 -0600 Subject: [PATCH] Fix lockboxes in 10.0.2 I failed to understand that GetContainerItemInfo isn't a 1:1 mapping to the new native version, so this adds a shim to make it work. --- Breakables.lua | 11 +++++++++-- changelog.txt | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Breakables.lua b/Breakables.lua index 5d8da0b..21db71d 100644 --- a/Breakables.lua +++ b/Breakables.lua @@ -20,7 +20,14 @@ if C_Container then GetContainerNumSlots = C_Container.GetContainerNumSlots end if C_Container.GetContainerItemInfo then - GetContainerItemInfo = C_Container.GetContainerItemInfo + GetContainerItemInfo = function(bagId, slotId) + local info = C_Container.GetContainerItemInfo(bagId, slotId) + if not info then + return nil + end + + return info.iconFileID, info.stackCount + end end if C_Container.GetContainerItemLink then GetContainerItemLink = C_Container.GetContainerItemLink @@ -1349,7 +1356,7 @@ function Breakables:FindBreakablesInSlot(bagId, slotId) self.myTooltip:SetOwner(WorldFrame, "ANCHOR_NONE") end - local texture, itemCount, locked, quality, readable = GetContainerItemInfo(bagId, slotId) + local texture, itemCount = GetContainerItemInfo(bagId, slotId) if texture then local itemLink = GetContainerItemLink(bagId, slotId) local itemId = self:GetItemIdFromLink(itemLink) diff --git a/changelog.txt b/changelog.txt index 54e2a14..05104f7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +v1.9.6: + +- Fix lockboxes in 10.0.2 + v1.9.5: - Fix another error from 10.0.2