Use stored options when reloading waypoints
Jim Whitehead II [02-07-12 - 10:17]
Use stored options when reloading waypoints
diff --git a/TomTom.lua b/TomTom.lua
index 66b0ba1..47553cf 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -268,15 +268,25 @@ function TomTom:ReloadWaypoints()
local m,f,x,y = unpack(waypoint)
local title = waypoint.title
- self:AddMFWaypoint(m, f, x, y, {
- desc = title,
- title = title,
- persistent = waypoint.persistent,
- minimap = minimap,
- world = world,
- callbacks = nil,
- silent = true,
- })
+ -- Set up default options
+ local options = {
+ desc = title,
+ title = title,
+ persistent = waypoint.persistent,
+ minimap = minimap,
+ world = world,
+ callbacks = nil,
+ silent = true,
+ }
+
+ -- Override options with what is stored in the profile
+ for k,v in pairs(waypoint) do
+ if type(k) == "string" then
+ options[k] = v
+ end
+ end
+
+ self:AddMFWaypoint(m, f, x, y, options)
end
end
end