From 42066efb628acff98534aacaded31b3a9deac823 Mon Sep 17 00:00:00 2001 From: Ludovicus Date: Sat, 19 Oct 2019 13:47:23 -0400 Subject: [PATCH] #477: If no coordinates, do not try to set waypoint from coord block. --- TomTom.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/TomTom.lua b/TomTom.lua index a1a659c..fb168e6 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -1058,11 +1058,13 @@ do function Block_OnClick(self, button, down) local m,x,y = TomTom:GetCurrentPlayerPosition() - local zoneName = hbd:GetLocalizedMap(m) - local desc = string.format("%s: %.2f, %.2f", zoneName, x*100, y*100) - TomTom:AddWaypoint(m, x, y, { - title = desc, - }) + if m and x and y then + local zoneName = hbd:GetLocalizedMap(m) + local desc = string.format("%s: %.2f, %.2f", zoneName, x*100, y*100) + TomTom:AddWaypoint(m, x, y, { + title = desc, + }) + end end function Block_OnEvent(self, event, ...) -- 1.7.9.5