# HG changeset patch # User James D. Callahan III # Date 1347915517 18000 # Node ID 8669b4c4327882756629bd1a0283abeeecc93a1e # Parent 9b5dcdc5a1e8469e422053796681be1791cac51c Improved loot sentry - scoped outside of current_action, since current_action can be wiped by subsequent actions. Hopefully prevents mixing action types for loot. diff -r 9b5dcdc5a1e8 -r 8669b4c43278 Main.lua --- a/Main.lua Mon Sep 17 15:44:12 2012 -0500 +++ b/Main.lua Mon Sep 17 15:58:37 2012 -0500 @@ -61,6 +61,7 @@ GOSSIP_SHOW = true, GUILDBANKFRAME_OPENED = true, ITEM_TEXT_BEGIN = true, + LOOT_CLOSED = true, LOOT_OPENED = true, MAIL_SHOW = true, MERCHANT_SHOW = "UpdateMerchantItems", @@ -1109,9 +1110,16 @@ -- Prevent opening the same loot window multiple times from recording data multiple times. local loot_guid_registry = {} + local currently_looting + + + function WDP:LOOT_CLOSED(event_name) + currently_looting = nil + end + function WDP:LOOT_OPENED(event_name) - if current_action.looting or not current_action.target_type then + if currently_looting or not current_action.target_type then return end local verify_func = LOOT_VERIFY_FUNCS[current_action.target_type] @@ -1127,7 +1135,7 @@ local guids_used = {} current_action.loot_list = {} current_action.loot_sources = {} - current_action.looting = true + currently_looting = true for loot_slot = 1, _G.GetNumLootItems() do local icon_texture, item_text, quantity, quality, locked = _G.GetLootSlotInfo(loot_slot)