# HG changeset patch # User James D. Callahan III # Date 1348246826 18000 # Node ID 05b77c08b211ff3397e6c4026008a7a2404d7499 # Parent 35da36cc87f05821dd2034c264257c0c98863584 Simplification for loot labels. Set target type for loot to NPC if none is listed on the current action, since the only reason it would be otherwise is via a spell. diff -r 35da36cc87f0 -r 05b77c08b211 Main.lua --- a/Main.lua Fri Sep 21 11:19:36 2012 -0500 +++ b/Main.lua Fri Sep 21 12:00:26 2012 -0500 @@ -441,7 +441,7 @@ end function GenericLootUpdate(data_type, top_field) - local loot_type = current_loot.label or "drops" + local loot_type = current_loot.label local loot_count = ("%s_count"):format(loot_type) local source_list = {} @@ -795,7 +795,7 @@ ("%d:%d"):format(item_id, quantity) }, identifier = current_action.identifier, - label = current_action.loot_label, + label = current_action.loot_label or "drops", map_level = current_action.map_level, object_name = current_action.object_name, spell_label = current_action.spell_label, @@ -1094,7 +1094,7 @@ end, [AF.NPC] = function() local difficulty_token = InstanceDifficultyToken() - local loot_type = current_loot.label or "drops" + local loot_type = current_loot.label local source_list = {} for source_guid, loot_data in pairs(current_loot.sources) do @@ -1150,7 +1150,7 @@ drops = {} } end - local loot_count = ("%s_count"):format(current_loot.label or "drops") + local loot_count = ("%s_count"):format(current_loot.label) current_loot.zone_data[location_token][loot_count] = (current_loot.zone_data[location_token][loot_count] or 0) + 1 if current_loot.sources then @@ -1182,9 +1182,11 @@ function WDP:LOOT_OPENED(event_name) - if current_loot or not current_action.target_type then + if current_loot then return end + current_action.target_type = current_action.target_type or AF.NPC + local verify_func = LOOT_VERIFY_FUNCS[current_action.target_type] local update_func = LOOT_UPDATE_FUNCS[current_action.target_type] @@ -1196,11 +1198,12 @@ return end local guids_used = {} + current_loot = { list = {}, sources = {}, identifier = current_action.identifier, - label = current_action.loot_label, + label = current_action.loot_label or "drops", map_level = current_action.map_level, object_name = current_action.object_name, spell_label = current_action.spell_label,