Quantcast

Refactor GetUnit hook a bit

Scott Sibley [10-27-10 - 20:40]
Refactor GetUnit hook a bit
Filename
StarTip.lua
diff --git a/StarTip.lua b/StarTip.lua
index dc6033c..86d53bc 100644
--- a/StarTip.lua
+++ b/StarTip.lua
@@ -796,11 +796,14 @@ function StarTip:GameTooltipShow(...)
 end

 function StarTip:GameTooltipGetUnit()
+	local name, unit = self.hooks[GameTooltip].GetUnit(GameTooltip)
+	if name then
+		return name, unit
+	end
 	if StarTip.unit and UnitExists(StarTip.unit) then
 		local name = UnitName(StarTip.unit)
 		return name, StarTip.unit
 	end
-	return self.hooks[GameTooltip].GetUnit(GameTooltip)
 end