# HG changeset patch # User James D. Callahan III # Date 1373307983 18000 # Node ID 1e55a8ebedbde7a609313a780f853c1b7079c023 # Parent e54e370e3a015d8cef8367201cfc85416e9f7b62 Fixed double-counting for loot in items. diff -r e54e370e3a01 -r 1e55a8ebedbd Main.lua --- a/Main.lua Mon Jul 08 13:17:22 2013 -0500 +++ b/Main.lua Mon Jul 08 13:26:23 2013 -0500 @@ -594,30 +594,28 @@ if current_loot.sources then for source_guid, loot_data in pairs(current_loot.sources) do - local entry, source_id + local source_id if current_loot.target_type == AF.ITEM then -- Items return the player as the source, so we need to use the item's ID (disenchant, milling, etc) source_id = current_loot.identifier - entry = DBEntry(data_type, source_id) elseif current_loot.target_type == AF.OBJECT then source_id = ("%s:%s"):format(current_loot.spell_label, select(2, ParseGUID(source_guid))) - entry = DBEntry(data_type, source_id) else source_id = select(2, ParseGUID(source_guid)) - entry = DBEntry(data_type, source_id) end + local entry = DBEntry(data_type, source_id) if entry then local loot_table = LootTable(entry, loot_type, top_field) - if not source_list[source_guid] then + if not source_list[source_id] then if top_field then entry[top_field][loot_count] = (entry[top_field][loot_count] or 0) + 1 else entry[loot_count] = (entry[loot_count] or 0) + 1 end - source_list[source_guid] = true + source_list[source_id] = true end UpdateDBEntryLocation(data_type, source_id) @@ -652,6 +650,7 @@ else entry[loot_count] = (entry[loot_count] or 0) + 1 end + source_list[current_loot.identifier] = true end for index = 1, #current_loot.list do