Mercurial > wow > wowdb-profiler
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 215:3b04818b4c03 | 216:1af96c9a930e |
|---|---|
| 1006 function WDP:SHOW_LOOT_TOAST(event_name, loot_type, item_link, quantity) | 1006 function WDP:SHOW_LOOT_TOAST(event_name, loot_type, item_link, quantity) |
| 1007 if loot_type ~= "item" then | 1007 if loot_type ~= "item" then |
| 1008 return | 1008 return |
| 1009 end | 1009 end |
| 1010 local npc = NPCEntry(private.raid_finder_boss_id or private.world_boss_id) | 1010 local npc = NPCEntry(private.raid_finder_boss_id or private.world_boss_id) |
| 1011 private.raid_finder_boss_id = nil | 1011 ClearKilledBossID() |
| 1012 private.world_boss_id = nil | |
| 1013 | 1012 |
| 1014 if not npc then | 1013 if not npc then |
| 1015 Debug(("%s: NPC is nil."):format(event_name)) | 1014 Debug(("%s: NPC is nil."):format(event_name)) |
| 1016 return | 1015 return |
| 1017 end | 1016 end |
| 1207 local unit_type, unit_idnum = ParseGUID(dest_guid) | 1206 local unit_type, unit_idnum = ParseGUID(dest_guid) |
| 1208 | 1207 |
| 1209 if not unit_idnum or not UnitTypeIsNPC(unit_type) then | 1208 if not unit_idnum or not UnitTypeIsNPC(unit_type) then |
| 1210 Debug(("%s: %s is not an NPC, or has no ID."):format(sub_event, dest_name)) | 1209 Debug(("%s: %s is not an NPC, or has no ID."):format(sub_event, dest_name)) |
| 1211 ClearKilledNPC() | 1210 ClearKilledNPC() |
| 1211 ClearKilledBossID() | |
| 1212 private.harvesting = nil | 1212 private.harvesting = nil |
| 1213 return | 1213 return |
| 1214 end | 1214 end |
| 1215 | 1215 |
| 1216 if private.RAID_FINDER_BOSS_IDS[unit_idnum] then | 1216 if private.RAID_FINDER_BOSS_IDS[unit_idnum] then |
| 1217 Debug(("%s: Matching boss %s."):format(sub_event, dest_name)) | 1217 Debug(("%s: Matching boss %s."):format(sub_event, dest_name)) |
| 1218 ClearKilledBossID() | |
| 1218 private.raid_finder_boss_id = unit_idnum | 1219 private.raid_finder_boss_id = unit_idnum |
| 1219 private.world_boss_id = nil | |
| 1220 elseif private.WORLD_BOSS_IDS[unit_idnum] then | 1220 elseif private.WORLD_BOSS_IDS[unit_idnum] then |
| 1221 Debug(("%s: Matching world boss %s."):format(sub_event, dest_name)) | 1221 Debug(("%s: Matching world boss %s."):format(sub_event, dest_name)) |
| 1222 private.raid_finder_boss_id = nil | 1222 ClearKilledBossID() |
| 1223 private.world_boss_id = unit_idnum | 1223 private.world_boss_id = unit_idnum |
| 1224 else | 1224 else |
| 1225 Debug(("%s: Killed NPC %s (ID: %d) is not in LFG or World boss list."):format(sub_event, dest_name, unit_idnum)) | 1225 Debug(("%s: Killed NPC %s (ID: %d) is not in LFG or World boss list."):format(sub_event, dest_name, unit_idnum)) |
| 1226 end | 1226 end |
| 1227 | 1227 |
| 1228 if dest_guid ~= _G.UnitGUID("target") then | 1228 if dest_guid ~= _G.UnitGUID("target") then |
| 1229 ClearKilledNPC() | 1229 ClearKilledNPC() |
| 1230 ClearKilledBossID() | |
| 1230 return | 1231 return |
| 1231 end | 1232 end |
| 1232 killed_npc_id = unit_idnum | 1233 killed_npc_id = unit_idnum |
| 1233 WDP:ScheduleTimer(ClearKilledNPC, 0.1) | 1234 WDP:ScheduleTimer(ClearKilledNPC, 0.1) |
| 1234 WDP:ScheduleTimer(ClearKilledBossID, 1) | 1235 WDP:ScheduleTimer(ClearKilledBossID, 1) |
