Quantcast

Don't display distance on the tooltip when we can't calculate it

James Whitehead II [10-22-08 - 04:47]
Don't display distance on the tooltip when we can't calculate it
Filename
TomTom.lua
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