From 73f71d4b2dfa67342f745525a4cae17dcd2af97b Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Wed, 22 Oct 2008 04:47:09 +0000 Subject: [PATCH] Don't display distance on the tooltip when we can't calculate it --- TomTom.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TomTom.lua b/TomTom.lua index 825f3e0..28b18c3 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -564,7 +564,9 @@ local function _both_tooltip_show(event, tooltip, uid, dist) local data = waypoints[uid] tooltip:SetText(data.title or L["TomTom waypoint"]) - tooltip:AddLine(string.format(L["%s yards away"], math.floor(dist)), 1, 1, 1) + if dist and tonumber(dist) then + tooltip:AddLine(string.format(L["%s yards away"], math.floor(dist)), 1, 1, 1) + end tooltip:AddLine(string.format(L["%s (%.2f, %.2f)"], data.zone, data.x, data.y), 0.7, 0.7, 0.7) tooltip:Show() end -- 1.7.9.5