From c7117ba1172178821afa6bd0b6562e50d75f4153 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Thu, 23 Dec 2010 15:06:42 -0500 Subject: [PATCH] -Small fix ;P --- xanMortarPestle.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xanMortarPestle.lua b/xanMortarPestle.lua index 9f43d1c..9dc280d 100644 --- a/xanMortarPestle.lua +++ b/xanMortarPestle.lua @@ -2,7 +2,7 @@ local spells = {} local setInCombat = 0 -local lastItem = "" +local lastItem local colors = { [51005] = {r=181/255, g=230/255, b=29/255}, --milling @@ -122,6 +122,7 @@ function frm:PLAYER_LOGIN() GameTooltip:HookScript('OnTooltipSetItem', function(self) local item, link = self:GetItem() + --reset if no item (link will be nil) lastItem = link if(item and link and not InCombatLockdown() and IsControlKeyDown() and IsShiftKeyDown() and not CursorHasItem() and not IsEquippedItem(link)) then @@ -197,7 +198,7 @@ local originalOnEvent = UIErrorsFrame:GetScript("OnEvent") UIErrorsFrame:SetScript("OnEvent", function(self, event, msg, r, g, b, ...) if event ~= "SYSMSG" then --it's not a system message so lets grab it and compare with non-disenchant - if msg == SPELL_FAILED_CANT_BE_DISENCHANTED and XMP_DB and button:IsShown() and lastItem and lastItem ~= "" then + if msg == SPELL_FAILED_CANT_BE_DISENCHANTED and XMP_DB and button:IsShown() and lastItem then --get the id from the previously stored link local id = type(lastItem) == "number" and lastItem or select(3, lastItem:find("item:(%d+):")) id = tonumber(id) -- 1.7.9.5