From 7309bde88a9d6b46c84b4d9d02e9cea66be91718 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Thu, 6 May 2010 10:27:01 +0000 Subject: [PATCH] Remove objective POIs before adding a new one --- TomTom_POIIntegration.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TomTom_POIIntegration.lua b/TomTom_POIIntegration.lua index 3617085..27fc1d9 100644 --- a/TomTom_POIIntegration.lua +++ b/TomTom_POIIntegration.lua @@ -99,6 +99,8 @@ hooksecurefunc("QuestPOI_DisplayButton", function(parentName, buttonType, button end end) +local setPoints = {} + -- This code will enable auto-tracking of closest quest objectives. To -- accomplish this, it hooks the WatchFrame_Update function, and when it -- is called, it sets a waypoint to the closest quest id. @@ -127,7 +129,11 @@ local function updateClosestPOI() -- Set a waypoint for this POI, it should be the higehst local questFrame = findQuestFrameFromQuestIndex(questID) if questFrame then - setQuestWaypoint(questFrame.poiIcon) + for idx, uid in ipairs(setPoints) do + TomTom:RemoveWaypoint(uid) + end + local uid = setQuestWaypoint(questFrame.poiIcon) + table.insert(setPoints, uid) end end end -- 1.7.9.5