Skip to content

Commit 184e0da

Browse files
committed
* Fix for Wrath 3.4.1. Unfortunately this likely breaks ability for addon to mail account bound items (tooltip scanning isn't working), and might try to mail conjured items and such.
* Removed debug messages from #31
1 parent 52f0675 commit 184e0da

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

BulkMail.lua

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,27 @@ local function multiFind(tt, exact, t1, t2, t3, t4, t5, t6)
372372
end
373373
return found
374374
end
375-
375+
local function dump(o)
376+
if type(o) == 'table' then
377+
local s = '{ '
378+
for k,v in pairs(o) do
379+
if type(k) ~= 'number' then k = '"'..k..'"' end
380+
s = s .. '['..k..'] = ' .. dump(v) .. ','
381+
end
382+
return s .. '} '
383+
else
384+
return tostring(o)
385+
end
386+
end
376387
local function isItemMailable(bag, slot)
377-
if _G.GetContainerNumSlots then
388+
if _G.C_TooltipInfo == nil then
389+
local item = ItemLocation:CreateFromBagAndSlot(bag, slot)
390+
if item then
391+
return not C_Item.IsBound(item)
392+
end
378393
gratuity:SetBagItem(bag, slot)
379-
return not gratuity:MultiFind(2, 7, nil, true, ITEM_SOULBOUND, ITEM_BIND_QUEST, ITEM_CONJURED, ITEM_BIND_ON_PICKUP)
380-
or gratuity:Find(ITEM_BIND_ON_EQUIP, 2, 7, nil, true, true)
394+
return not gratuity:MultiFind(2, 7, false, false, ITEM_SOULBOUND, ITEM_BIND_QUEST, ITEM_CONJURED, ITEM_BIND_ON_PICKUP)
395+
or gratuity:Find(ITEM_BIND_ON_EQUIP, 2, 7, false, false, true)
381396
end
382397
local tt = C_TooltipInfo.GetBagItem(bag, slot)
383398
return not multiFind(tt, false, ITEM_SOULBOUND, ITEM_BIND_QUEST, ITEM_CONJURED, ITEM_BIND_ON_PICKUP)
@@ -883,7 +898,6 @@ function mod:SendMailFrame_CanSend()
883898
end
884899

885900
function mod:ContainerFrame_Update(...)
886-
print(...)
887901
local frame = ...
888902
local bag = tonumber(strsub(frame:GetName(),15))
889903
if bag then bag = bag - 1 else return end

0 commit comments

Comments
 (0)