* Added a comment clarifying that TomTom_Waypoints API is private
James Whitehead II [04-06-08 - 07:42]
* Added a comment clarifying that TomTom_Waypoints API is private
* When a duplicate waypoint is set, return the original uid
diff --git a/TomTom.lua b/TomTom.lua
index 724ba26..548507c 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -648,8 +648,8 @@ function TomTom:AddZWaypoint(c, z, x, y, desc, persistent, minimap, world)
for uid in pairs(waypoints[zone]) do
local data = waypoints[uid]
if data.title == desc and data.coord == coord then
- -- This is a duplicate waypoint
- return
+ -- This is a duplicate waypoint, so return that uid
+ return uid
end
end
end
diff --git a/TomTom_Waypoints.lua b/TomTom_Waypoints.lua
index 135dd68..46ddfef 100644
--- a/TomTom_Waypoints.lua
+++ b/TomTom_Waypoints.lua
@@ -1,5 +1,11 @@
--[[--------------------------------------------------------------------------
-- TomTom - A navigational assistant for World of Warcraft
+--
+-- This file contains the internal implementation of TomTom's waypoints.
+-- None of these functions should be called directly by addons if they want
+-- the waypoints to obey normal TomTom options and behavior. In otherwords
+-- don't call TomTom:SetWaypoint() or TomTom:ClearWaypoint(), use the public
+-- TomTom:AddZWaypoint() and TomTom:RemoveWaypoint() instead.
----------------------------------------------------------------------------]]
-- Import Astrolabe for locations