From 76c1d6f73924b84a62dd17b32839a769913e6ec7 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Fri, 15 Aug 2008 11:05:39 +0000 Subject: [PATCH] Fixed an error that occured when trying to equip an item the player doesn't have the proficiency for --- DressToKill.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DressToKill.lua b/DressToKill.lua index e88124d..bfa7cb3 100644 --- a/DressToKill.lua +++ b/DressToKill.lua @@ -192,13 +192,18 @@ end local eventFrame = CreateFrame("Frame") eventFrame:RegisterEvent("UNIT_INVENTORY_CHANGED") eventFrame:RegisterEvent("EQUIP_BIND_CONFIRM") +eventFrame:RegisterEvent("UI_ERROR_MESSAGE") -local function OnEvent(self, event) +local function OnEvent(self, event, arg1) self.equipped = true if event == "EQUIP_BIND_CONFIRM" and CursorHasItem() then self.equipped = false debug(L["Clearing non-soulbound item"]) ClearCursor() + elseif event == "UI_ERROR_MESSAGE" and arg1 == ERR_PROFICIENCY_NEEDED then + self.equipped = false + debug(L["Clearing item we don't have the proficiency for"]) + ClearCursor() end local thread = DressToKill.currentThread -- 1.7.9.5