# HG changeset patch # User James D. Callahan III # Date 1373298475 18000 # Node ID ca7abdbda0781c6d3731cf874b2e23e217dd140d # Parent 216f807df43416b6ce564ea6d335e618c36afeda Use quantity from GetLootSlotQuantity() instead of what's returned by GetLootSourceInfo(). diff -r 216f807df434 -r ca7abdbda078 Main.lua --- a/Main.lua Mon Jul 01 17:49:49 2013 -0500 +++ b/Main.lua Mon Jul 08 10:47:55 2013 -0500 @@ -1730,7 +1730,7 @@ loot_guid_registry[current_loot.label] = loot_guid_registry[current_loot.label] or {} for loot_slot = 1, _G.GetNumLootItems() do - local icon_texture, item_text, quantity, quality, locked = _G.GetLootSlotInfo(loot_slot) + local icon_texture, item_text, slot_quantity, quality, locked = _G.GetLootSlotInfo(loot_slot) local slot_type = _G.GetLootSlotType(loot_slot) local loot_info = { _G.GetLootSourceInfo(loot_slot) @@ -1744,19 +1744,19 @@ local loot_quantity = loot_info[loot_index + 1] local source_type, source_id = ParseGUID(source_guid) local source_key = ("%s:%d"):format(private.UNIT_TYPE_NAMES[source_type + 1], source_id) - Debug("GUID: %s - Type:ID: %s - Amount: %d", loot_info[loot_index], source_key, loot_quantity) + Debug("GUID: %s - Type:ID: %s - Amount: %d (%d)", loot_info[loot_index], source_key, loot_quantity, slot_quantity) if slot_type == _G.LOOT_SLOT_ITEM then local item_id = ItemLinkToID(_G.GetLootSlotLink(loot_slot)) current_loot.sources[source_guid] = current_loot.sources[source_guid] or {} - current_loot.sources[source_guid][item_id] = current_loot.sources[source_guid][item_id] or 0 + loot_quantity + current_loot.sources[source_guid][item_id] = current_loot.sources[source_guid][item_id] or 0 + slot_quantity guids_used[source_guid] = true elseif slot_type == _G.LOOT_SLOT_MONEY then Debug("money:%d", _toCopper(item_text)) table.insert(current_loot.list, ("money:%d"):format(_toCopper(item_text))) elseif slot_type == _G.LOOT_SLOT_CURRENCY then Debug("Found currency: %s", icon_texture) - table.insert(current_loot.list, ("currency:%d:%s"):format(quantity, icon_texture:match("[^\\]+$"):lower())) + table.insert(current_loot.list, ("currency:%d:%s"):format(slot_quantity, icon_texture:match("[^\\]+$"):lower())) end end end