1
0
Bifurcation 0

Resolves issue 551. Apparently at times, when the link is nil, the item name is nil too. Made the checks more aggressive to attempt to find the problem. Dunno why Blizzard is returning nil on the culprits when looting, but hopefully they're returning at least the texture.

Cette révision appartient à :
Nathanial.C.Jones 2011-02-21 14:55:34 +00:00
Parent 1f04543366
révision 91c044eb1b
1 fichiers modifiés avec 15 ajouts et 2 suppressions

Voir le fichier

@ -530,7 +530,7 @@ local function LootOpened()
local items = {}
items[PseudoIDs["gold"]] = 0
for i = 1, GetNumLootItems() do
_, name, quant, _ = GetLootSlotInfo(i)
tex, name, quant, _ = GetLootSlotInfo(i)
link = GetLootSlotLink(i)
if quant == 0 then
-- moneys
@ -548,7 +548,20 @@ local function LootOpened()
end
items[QHC.PseudoIDs[name]] = (items[QHC.PseudoIDs[name]] or 0) + quant
else
QuestHelper:Assert(link, "Need more info on '" .. name .. "'x" .. tostring(quant) .. ".")
if not link and not name then
local msg = "Texture is " .. tostring(tex) .. " with a quantity of " .. tostring(quant) .. "."
if LootSlotIsCoin(i) then
QuestHelper:Assert(false, "Loot is coin. " .. msg)
elseif LootSlotIsItem(i) then
QuestHelper:Assert(false, "Loot is item. " .. msg)
else
QuestHelper:Assert(false, "Loot is ???. " .. msg)
end
elseif not link then
QuestHelper:Assert(link, "Need more info on '" .. name .. "'x" .. tostring(quant) .. ".")
elseif not name then
QuestHelper:Assert(name, "Need more info on '" .. link .. "'x" .. tostring(quant) .. ".")
end
local itype = GetItemType(link)
items[itype] = (items[itype] or 0) + quant
end