diff Main.lua @ 216:1af96c9a930e

More consistent usage of ClearKilledBossID() as well as calling it in two cases where ClearKilledNPC() is called in the UNIT_DIED handler of COMBAT_LOG_FUNCS.
author James D. Callahan III <jcallahan@curse.com>
date Tue, 22 Jan 2013 13:20:54 -0600
parents 3b04818b4c03
children 719fe69d3af2
line wrap: on
line diff
--- a/Main.lua	Tue Jan 22 12:23:35 2013 -0600
+++ b/Main.lua	Tue Jan 22 13:20:54 2013 -0600
@@ -1008,8 +1008,7 @@
         return
     end
     local npc = NPCEntry(private.raid_finder_boss_id or private.world_boss_id)
-    private.raid_finder_boss_id = nil
-    private.world_boss_id = nil
+    ClearKilledBossID()
 
     if not npc then
         Debug(("%s: NPC is nil."):format(event_name))
@@ -1209,17 +1208,18 @@
             if not unit_idnum or not UnitTypeIsNPC(unit_type) then
                 Debug(("%s: %s is not an NPC, or has no ID."):format(sub_event, dest_name))
                 ClearKilledNPC()
+                ClearKilledBossID()
                 private.harvesting = nil
                 return
             end
 
             if private.RAID_FINDER_BOSS_IDS[unit_idnum] then
                 Debug(("%s: Matching boss %s."):format(sub_event, dest_name))
+                ClearKilledBossID()
                 private.raid_finder_boss_id = unit_idnum
-                private.world_boss_id = nil
             elseif private.WORLD_BOSS_IDS[unit_idnum] then
                 Debug(("%s: Matching world boss %s."):format(sub_event, dest_name))
-                private.raid_finder_boss_id = nil
+                ClearKilledBossID()
                 private.world_boss_id = unit_idnum
             else
                 Debug(("%s: Killed NPC %s (ID: %d) is not in LFG or World boss list."):format(sub_event, dest_name, unit_idnum))
@@ -1227,6 +1227,7 @@
 
             if dest_guid ~= _G.UnitGUID("target") then
                 ClearKilledNPC()
+                ClearKilledBossID()
                 return
             end
             killed_npc_id = unit_idnum