changeset 124:8669b4c43278 1.0.8

Improved loot sentry - scoped outside of current_action, since current_action can be wiped by subsequent actions. Hopefully prevents mixing action types for loot.
author James D. Callahan III <jcallahan@curse.com>
date Mon, 17 Sep 2012 15:58:37 -0500
parents 9b5dcdc5a1e8
children 790769fc6a76
files Main.lua
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)