changeset 159:75cf16f95ad0 1.0.17

Hard-code NPC IDs for Sha of Anger and Galleon to see if they're simply not being recognized as NPCs.
author James D. Callahan III <jcallahan@curse.com>
date Fri, 05 Oct 2012 22:31:14 -0500
parents ff86944a6bda
children 090eff7671f2
files Main.lua
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Main.lua	Fri Oct 05 18:39:46 2012 -0500
+++ b/Main.lua	Fri Oct 05 22:31:14 2012 -0500
@@ -165,6 +165,13 @@
     _G.print(...)
 end
 
+local SHA_OF_ANGER_ID = 60491
+local GALLEON_ID = 62346
+
+local function IsHardCodedNPC(unit_id)
+    return unit_id == SHA_OF_ANGER_ID or unit_id == GALLEON_ID
+end
+
 
 local ActualCopperCost
 do
@@ -684,7 +691,7 @@
     if _G.type(func) == "boolean" then
         self[event_name](self, ...)
     elseif _G.type(func) == "function" then
-        self[EVENT_MAPPING[event_name]](self, ...)
+        self[func](self, ...)
     end
 end
 
@@ -799,7 +806,7 @@
         end
         local unit_type, unit_idnum = ParseGUID(_G.UnitGUID("target"))
 
-        if unit_type ~= private.UNIT_TYPES.NPC or not unit_idnum then
+        if not unit_idnum or (unit_type ~= private.UNIT_TYPES.NPC and not IsHardCodedNPC(unit_idnum)) then
             return
         end
         current_target_id = unit_idnum
@@ -986,7 +993,7 @@
         end
         local source_type, source_id = ParseGUID(source_guid)
 
-        if not source_id or source_type ~= private.UNIT_TYPES.NPC then
+        if not source_id or (source_type ~= private.UNIT_TYPES.NPC and not IsHardCodedNPC(source_id)) then
             return
         end