diff ReagentMaker.lua @ 19:f7b23db7bcc6

Correct tooltips for external tradeskills like milling
author contrebasse
date Fri, 08 Apr 2011 19:58:08 +0200
parents c37c2a46723c
children 4ea38bae4174
line wrap: on
line diff
--- a/ReagentMaker.lua	Fri Apr 08 19:24:22 2011 +0200
+++ b/ReagentMaker.lua	Fri Apr 08 19:58:08 2011 +0200
@@ -208,14 +208,15 @@
 	end
 
 	-- Tooltips
-	local reagentIndex = A.findSkillIndex(reagentID)
-	if reagentIndex then
+	local link
+	if A.data[reagentID].spell then
+		link = GetSpellLink(A.data[reagentID].spellID)
+	else
+		link = GetTradeSkillRecipeLink(A.findSkillIndex(reagentID))
+	end
+	if link then
 		A.tooltipRecipe:SetOwner(btn)
-		if A.data[reagentID].spell then
-			A.tooltipRecipe:SetHyperlink(GetSpellLink(A.data[reagentID].spellID))
-		else
-			A.tooltipRecipe:SetHyperlink(GetTradeSkillRecipeLink(reagentIndex))
-		end
+		A.tooltipRecipe:SetHyperlink(link)
 		A.tooltipRecipe:Show()
 		A.tooltipRecipe:ClearAllPoints()
 		--A.tooltipRecipe:SetPoint("TOPLEFT",btn,"TOPRIGHT")