From 5540e6701c1b1113b28f38f65643797c68ee6346 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Wed, 22 Oct 2008 04:49:59 +0000 Subject: [PATCH] * Instead of displaying nothing and erroring OnUpdate, just display "Unknown Distance" --- TomTom.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TomTom.lua b/TomTom.lua index 28b18c3..d26c645 100755 --- a/TomTom.lua +++ b/TomTom.lua @@ -566,6 +566,8 @@ local function _both_tooltip_show(event, tooltip, uid, dist) tooltip:SetText(data.title or L["TomTom waypoint"]) if dist and tonumber(dist) then tooltip:AddLine(string.format(L["%s yards away"], math.floor(dist)), 1, 1, 1) + else + tooltip:AddLine(L["Unknown distance"]) end tooltip:AddLine(string.format(L["%s (%.2f, %.2f)"], data.zone, data.x, data.y), 0.7, 0.7, 0.7) tooltip:Show() @@ -588,7 +590,11 @@ local function _world_tooltip_show(event, tooltip, uid, dist) end local function _both_tooltip_update(event, tooltip, uid, dist) - tooltip.lines[2]:SetFormattedText(L["%s yards away"], math.floor(dist), 1, 1, 1) + if dist and tonumber(dist) then + tooltip.lines[2]:SetFormattedText(L["%s yards away"], math.floor(dist), 1, 1, 1) + else + tooltip.lines[2]:SetText(L["Unknown distance"]) + end end local function _both_clear_distance(event, uid, range, distance, lastdistance) -- 1.7.9.5