From d6c79280ce38692daffc007bed85831f5ee2904f Mon Sep 17 00:00:00 2001 From: Scott Sibley Date: Mon, 27 Dec 2010 22:50:36 +0000 Subject: [PATCH] Stop all lines from updating after UnitExists(unit) returns false. --- Modules/UnitTooltip/UnitTooltip.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Modules/UnitTooltip/UnitTooltip.lua b/Modules/UnitTooltip/UnitTooltip.lua index 26180a8..af12b91 100644 --- a/Modules/UnitTooltip/UnitTooltip.lua +++ b/Modules/UnitTooltip/UnitTooltip.lua @@ -104,6 +104,7 @@ return Colorize((Name(unit, true) or Name(unit)) .. afk , r, g, b) name = "Target", left = 'return "Target:"', right = [[ +if not UnitExists(unit) then return lastTarget or "None" end local r, g, b local unit = (unit or "mouseover") .. "target" if UnitIsPlayer(unit) then @@ -114,7 +115,9 @@ end local name = UnitName(unit) local name2 = UnitName("player") if name == name2 and Realm(unit) == Realm("player") then name = "<>" end -return name and Colorize(name, r, g, b) or "None" +local str = name and Colorize(name, r, g, b) or "None" +lastTarget = str +return str ]], rightUpdating = true, update = 1000, @@ -235,8 +238,6 @@ end return "Alive" ]], enabled = true, - update = 1000, - rightUpdating = true }, [13] = { name = "Health", @@ -411,7 +412,10 @@ end name = "Talents", left = "return 'Talents:'", right = [[ -return SpecText(unit) +if not UnitExists(unit) then return lastTalents end +local str = SpecText(unit) +lastTalents = str +return str ]], rightUpdating = true, enabled = true, -- 1.7.9.5