From 6da341701ad8c26635d69c31e21b02ce5d09479d Mon Sep 17 00:00:00 2001 From: parnic Date: Mon, 1 Dec 2008 00:29:35 +0000 Subject: [PATCH] - no longer throws an error for players without inscription/jewelcrafting - fixed the prospecting button to be clickable for jewelcrafters --- Breakables.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Breakables.lua b/Breakables.lua index 3ed9201..c4f9dfd 100644 --- a/Breakables.lua +++ b/Breakables.lua @@ -80,10 +80,11 @@ function Breakables:CreateButtonFrame() self.buttonFrame:SetScript("OnMouseUp", function() self:OnMouseUp() end) self.buttonFrame:SetClampedToScreen(true) - self.buttonFrame:SetAttribute("type1", "spell") - self.buttonFrame:SetAttribute("spell1", GetSpellInfo(MillingId)) + local spellName, _, texture = GetSpellInfo((CanMill and MillingId) or (CanProspect and ProspectingId) or DisenchantingId) + + self.buttonFrame:SetAttribute("type1", "spell") + self.buttonFrame:SetAttribute("spell1", spellName) - local _,_,texture = GetSpellInfo((CanMill and MillingId) or (CanProspect and ProspectingId) or DisenchantingId) self.buttonFrame.icon:SetTexture(texture) self.buttonFrame.icon:SetAllPoints(self.buttonFrame) else @@ -169,10 +170,12 @@ function Breakables:FindBreakables() end end - if numBreakableStacks == 0 then - self.buttonFrame:Hide() - else - self.buttonFrame:Show() + if self.buttonFrame then + if numBreakableStacks == 0 then + self.buttonFrame:Hide() + else + self.buttonFrame:Show() + end end end