Mercurial > wow > wowdb-profiler
changeset 12:be3d67c28a27
Refactoring, and record quest ending unit.
author | James D. Callahan III <jcallahan@curse.com> |
---|---|
date | Tue, 01 May 2012 12:16:17 -0500 |
parents | 0ec5c8f4b72b |
children | 39972835bdc9 |
files | Main.lua |
diffstat | 1 files changed, 21 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/Main.lua Tue May 01 12:04:29 2012 -0500 +++ b/Main.lua Tue May 01 12:16:17 2012 -0500 @@ -473,25 +473,33 @@ end -function WDP:QUEST_COMPLETE() -end +do + local function UpdateQuestJuncture(point) + local unit_name = _G.UnitName("questnpc") + if not unit_name then + return + end + local unit_type, unit_id = WDP:ParseGUID(_G.UnitGUID("questnpc")) -function WDP:QUEST_DETAIL() - local unit_name = _G.UnitName("questnpc") + if unit_type == private.UNIT_TYPES.OBJECT then + UpdateObjectLocation(unit_id) + end + local quest = UnitEntry("quests", _G.GetQuestID()) + quest[point] = quest[point] or {} + quest[point][("%s:%d"):format(private.UNIT_TYPE_NAMES[unit_type + 1], unit_id)] = true + end - if not unit_name then - return + + function WDP:QUEST_COMPLETE() + UpdateQuestJuncture("end") end - local unit_type, unit_id = self:ParseGUID(_G.UnitGUID("questnpc")) - if unit_type == private.UNIT_TYPES.OBJECT then - UpdateObjectLocation(unit_id) + + function WDP:QUEST_DETAIL() + UpdateQuestJuncture("begin") end - local quest = UnitEntry("quests", _G.GetQuestID()) - quest.begin = quest.begin or {} - quest.begin[("%s:%d"):format(private.UNIT_TYPE_NAMES[unit_type + 1], unit_id)] = true -end +end -- do-block function WDP:QUEST_LOG_UPDATE()