Fixes an issue that prevented the "Reset waypoints" command from working
James Whitehead II [08-24-08 - 07:59]
Fixes an issue that prevented the "Reset waypoints" command from working
diff --git a/TomTom.lua b/TomTom.lua
index 1a93672..51125dc 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -159,6 +159,10 @@ end
function TomTom:ReloadWaypoints()
local pc, pz = GetCurrentMapContinent(), GetCurrentMapZone()
+ for uid,value in pairs(waypoints) do
+ self:ClearWaypoint(uid)
+ end
+
waypoints = {}
self.waypoints = waypoints
self.waypointprofile = self.waydb.profile
@@ -335,9 +339,7 @@ StaticPopupDialogs["TOMTOM_REMOVE_ALL_CONFIRM"] = {
button1 = L["Yes"],
button2 = L["No"],
OnAccept = function()
- for uid,point in pairs(waypoints) do
- TomTom.waydb:ResetProfile()
- end
+ TomTom.waydb:ResetProfile()
TomTom:ReloadWaypoints()
end,
timeout = 30,