fix: item rows
This commit is contained in:
+13
-1
@@ -93,7 +93,19 @@ local function CountCurrentCharacterItems(itemID)
|
|||||||
for i = 1, numInboxItems do
|
for i = 1, numInboxItems do
|
||||||
local _, _, _, _, _, _, _, hasItem = GetInboxHeaderInfo(i)
|
local _, _, _, _, _, _, _, hasItem = GetInboxHeaderInfo(i)
|
||||||
if hasItem then
|
if hasItem then
|
||||||
for j = 1, 12 do -- Turtle WoW supports up to 12 attachments
|
-- Turtle WoW supports up to 12 attachments per mail.
|
||||||
|
-- We use GetInboxNumAttachments if available to avoid over-scanning.
|
||||||
|
local numAttachments = 0
|
||||||
|
if GetInboxNumAttachments then
|
||||||
|
numAttachments = GetInboxNumAttachments(i) or 0
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Fallback: if we don't have the count but header says there's an item, assume at least 1.
|
||||||
|
if numAttachments == 0 and hasItem then
|
||||||
|
numAttachments = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for j = 1, numAttachments do -- Turtle WoW supports up to 12 attachments
|
||||||
local name, _, count = GetInboxItem(i, j)
|
local name, _, count = GetInboxItem(i, j)
|
||||||
if name then
|
if name then
|
||||||
local itemLink = addon.Modules.Utils:GetInboxItemLink(i, j)
|
local itemLink = addon.Modules.Utils:GetInboxItemLink(i, j)
|
||||||
|
|||||||
+14
-2
@@ -36,8 +36,20 @@ function MailboxScanner:ScanMailItemRows(index)
|
|||||||
local rows = {}
|
local rows = {}
|
||||||
|
|
||||||
if hasItem then
|
if hasItem then
|
||||||
-- Turtle WoW supports up to 12 attachments per mail
|
-- Turtle WoW supports up to 12 attachments per mail.
|
||||||
for itemIndex = 1, 12 do
|
-- We use GetInboxNumAttachments if available to avoid over-scanning on servers
|
||||||
|
-- that might ignore the second argument of GetInboxItem.
|
||||||
|
local numAttachments = 0
|
||||||
|
if GetInboxNumAttachments then
|
||||||
|
numAttachments = GetInboxNumAttachments(index) or 0
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Fallback: if we don't have the count but header says there's an item, assume at least 1.
|
||||||
|
if numAttachments == 0 and hasItem then
|
||||||
|
numAttachments = 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for itemIndex = 1, numAttachments do
|
||||||
-- GetInboxItem(index, itemIndex) returns: name, texture, count, quality, canUse
|
-- GetInboxItem(index, itemIndex) returns: name, texture, count, quality, canUse
|
||||||
local name, texture, count, quality, canUse = GetInboxItem(index, itemIndex)
|
local name, texture, count, quality, canUse = GetInboxItem(index, itemIndex)
|
||||||
if not name then break end
|
if not name then break end
|
||||||
|
|||||||
Reference in New Issue
Block a user