diff Main.lua @ 205:6cac044fd0f9

In the LOOT_OPENED NPC verify function, only set current_action.identifier to the unit_id of the player's target if the identifier is nil.
author James D. Callahan III <jcallahan@curse.com>
date Mon, 10 Dec 2012 16:20:06 -0600
parents 83fdf52f0310
children d401bf9aa80c
line wrap: on
line diff
--- a/Main.lua	Mon Dec 10 11:27:06 2012 -0600
+++ b/Main.lua	Mon Dec 10 16:20:06 2012 -0600
@@ -1419,8 +1419,11 @@
             if not _G.UnitExists("target") or _G.UnitIsFriend("player", "target") or _G.UnitIsPlayer("target") or _G.UnitPlayerControlled("target") then
                 return false
             end
-            local unit_type, id_num = ParseGUID(_G.UnitGUID("target"))
-            current_action.identifier = id_num
+
+            if not current_action.identifier then
+                local unit_type, id_num = ParseGUID(_G.UnitGUID("target"))
+                current_action.identifier = id_num
+            end
             return true
         end,
         [AF.OBJECT] = true,
@@ -1535,7 +1538,6 @@
         if not current_action.target_type then
             return
         end
-
         local verify_func = LOOT_OPENED_VERIFY_FUNCS[current_action.target_type]
         local update_func = LOOT_OPENED_UPDATE_FUNCS[current_action.target_type]
 
@@ -2011,8 +2013,6 @@
     if not spell_label then
         return
     end
-    table.wipe(current_action)
-
     local item_name, item_link = _G.GameTooltip:GetItem()
     local unit_name, unit_id = _G.GameTooltip:GetUnit()
 
@@ -2023,6 +2023,7 @@
     local spell_flags = private.SPELL_FLAGS_BY_LABEL[spell_label]
     local zone_name, area_id, x, y, map_level, instance_token = CurrentLocationData()
 
+    table.wipe(current_action)
     current_action.instance_token = instance_token
     current_action.map_level = map_level
     current_action.x = x