From 3fdc6879ad54f63f7089b6fca061ffde9e050d6b Mon Sep 17 00:00:00 2001 From: James Whitehead Ii Date: Thu, 11 Oct 2007 13:36:03 +0000 Subject: [PATCH] * Added a compat version of TomTom:AddZWaypoint(c,z,x,y,desc) that works with other zones --- TomTom.lua | 7 ++++++- TomTom_Waypoints.lua | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index 06b57f4..4dc0dc3 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -131,7 +131,6 @@ function WorldMapButton_OnClick(...) end local function WaypointCallback(event, data, dist, lastdist) - TomTom:Print(event, data, dist, lastdist) if event == "OnDistanceArrive" then TomTom:ClearWaypoint(data) end @@ -154,6 +153,12 @@ function TomTom:AddWaypoint(x,y,desc) local point = self:SetWaypoint(c, z, x, y, nil, nil, 10, WaypointCallback) self:SetCrazyArrow(point, 15) end + +function TomTom:AddZWaypoint(c,z,x,y,desc) + local point = self:SetWaypoint(c,z,x,y,nil,nil,10,WaypointCallback) + self:SetCrazyArrow(point, 15) +end + --[[ local Orig_WorldMapButton_OnClick = WorldMapButton_OnClick diff --git a/TomTom_Waypoints.lua b/TomTom_Waypoints.lua index 6ebdebb..9f436e5 100644 --- a/TomTom_Waypoints.lua +++ b/TomTom_Waypoints.lua @@ -168,6 +168,12 @@ do local rad_135 = math.rad(135) local minimap_count = 0 function Minimap_OnUpdate(self, elapsed) + local dist,x,y = Astrolabe:GetDistanceToIcon(self) + if not dist then + self:Hide() + return + end + minimap_count = minimap_count + elapsed -- Only take action every 0.2 seconds @@ -222,7 +228,6 @@ do if callback then -- Handle the logic/callbacks for arrival - local dist,x,y = Astrolabe:GetDistanceToIcon(self) local near,far,arrive = data.near,data.far,data.arrive local state = data.state -- 1.7.9.5