From 19548953f50d0e76526cd86838774399e48321df Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Tue, 11 Jan 2011 09:54:47 +0000 Subject: [PATCH] Fix some bugs in quest objective source --- sources/QuestObjectives.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sources/QuestObjectives.lua b/sources/QuestObjectives.lua index 1e1b728..b2f6cfd 100644 --- a/sources/QuestObjectives.lua +++ b/sources/QuestObjectives.lua @@ -62,6 +62,7 @@ function addon:OBJECTIVES_CHANGED() -- Scan through every quest that is being tracked, and create a waypoint -- for each of the objectives that are being tracked. These waypoints will -- be unordered, and will be sorted or ordered by the user/algorithm + local first local watchIndex = 1 while true do local questIndex = GetQuestIndexForWatch(watchIndex) @@ -84,13 +85,16 @@ function addon:OBJECTIVES_CHANGED() end local key = title .. tostring(qid + (x * 100) * (y * 100) * map * (floor + 1)) + if not first then + first = key + end if waypoints[key] then -- This waypoint already exists, no need to do anything, except -- possibly change the priority local waypoint = waypoints[key] - local newpri = (watchIndex == 1) and addon.PRI_ACTIVE or addon.PRI_NORMAL + local newpri = key == first and addon.PRI_ACTIVE or addon.PRI_NORMAL if waypoint.priority ~= newpri then changed = true waypoint.priority = newpri @@ -101,7 +105,7 @@ function addon:OBJECTIVES_CHANGED() -- Create the waypoint, setting priority local waypoint = self:AddWaypoint(map, floor, x, y, { title = title, - priority = (watchIndex == 1) and addon.PRI_ACTIVE or addon.PRI_NORMAL, + priority = key == first and addon.PRI_ACTIVE or addon.PRI_NORMAL, }) newWaypoints[key] = waypoint -- 1.7.9.5