From 59a689e75e65045f7ce794549f4594308ff295df Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Wed, 26 Mar 2008 12:42:25 +0000 Subject: [PATCH] * Fixed waypoints not automatically clearing when that option is set --- TomTom.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index b9beab6..b9c161b 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -558,20 +558,21 @@ function TomTom:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world) tooltip_update = _both_tooltip_show, }, remove = _remove, - distance = {}, + distance = { + }, } + local cleardistance = self.profile.persistence.cleardistance + if cleardistance > 0 then + callbacks.distance[cleardistance] = _both_clear_distance + callbacks.distance[cleardistance + 1] = noop + end + -- Default values if persistent == nil then persistent = self.profile.persistence.savewaypoints end if minimap == nil then minimap = true end if world == nil then world = true end - if not persistent then - local cleardistance = self.profile.persistence.cleardistance - callbacks.distance[cleardistance] = _both_clear_distance - callbacks.distance[cleardistance+1] = noop - end - local uid = self:SetWaypoint(c,z,x/100,y/100, callbacks, minimap, world) if self.profile.arrow.autoqueue then self:SetCrazyArrow(uid, self.profile.arrow.arrival, desc) -- 1.7.9.5