From 0659fc73a50774e8c9a4fd30a9b2100ba49e0bc6 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Fri, 22 Aug 2008 11:44:31 +0000 Subject: [PATCH] Fixed an error that can occur when equipping an item with a higher required level --- DressToKill.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/DressToKill.lua b/DressToKill.lua index 82666a2..e468cd9 100644 --- a/DressToKill.lua +++ b/DressToKill.lua @@ -361,6 +361,10 @@ local function OnEvent(self, event, arg1) self.equipped = false debug(L["Clearing item since we lack dual wielding skill"]) ClearCursor() + elseif event == "UI_ERROR_MESSAGE" and arg1 == LEVEL_TOO_LOW then + self.equipped = false + debug(L["Clearing item that we're too low to equip"]) + ClearCursor() end local thread = DressToKill.currentThread @@ -447,10 +451,13 @@ local bagMap = { [0x400] = 3, [0x800] = 4, } -function DressToKill:ItemInBag(mask) - if not mask then - debug(debugstack()) + +function DressToKill:ItemInBank(mask) + if bit.band(mask, ITEM_INVENTORY_BANK) > 0 then end +end + +function DressToKill:ItemInBag(mask) if bit.band(mask, ITEM_INVENTORY_BAGS) > 0 then local bag = bagMap[bit.band(mask, MASK_BAG)] local slot = bit.band(mask, MASK_SLOT) -- 1.7.9.5