Quantcast

Fixed an error that can occur when equipping an item with a higher required level

James Whitehead II [08-22-08 - 11:44]
Fixed an error that can occur when equipping an item with a higher required level
Filename
DressToKill.lua
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)