Quantcast

-Added extra checks to make sure you can't use this on the Character window.

Xruptor [12-19-11 - 21:33]
-Added extra checks to make sure you can't use this on the Character window.
-Not sure how but someone said they were able to get this to happen on their character panel.  The only thing I can think of is they have a modded character panel.
Filename
xanMortarPestle.lua
xanMortarPestle.toc
diff --git a/xanMortarPestle.lua b/xanMortarPestle.lua
index 7861fbd..3ddfb9b 100644
--- a/xanMortarPestle.lua
+++ b/xanMortarPestle.lua
@@ -144,19 +144,24 @@ function frm:PLAYER_LOGIN()
 		if CursorHasItem() then return end	--if the mouse has an item then exit

 		local item, link = self:GetItem()
+		--make sure we have an item to work with
+		if not item and not link then return end
+
+		local owner = self:GetOwner() --get the owner of the tooltip
+
+		--if it's the character frames <alt> equipment switch then ignore it
+		if owner and owner:GetName() and strfind(string.lower(owner:GetName()), "character") and strfind(string.lower(owner:GetName()), "slot") then return end
+		if owner and owner:GetParent() and owner:GetParent():GetName() and strfind(string.lower(owner:GetParent():GetName()), "paperdoll") then return end

 		--reset if no item (link will be nil)
 		lastItem = link
-
+
 		--make sure we have an item, it's not an equipped one, and the darn lootframe isn't showing
 		if item and link and not IsEquippedItem(link) and not LootFrame:IsShown() then
-
-			local owner = self:GetOwner() --get the owner of the tooltip
+
+			--get the bag slot info
 			local bag = owner:GetParent():GetID()
 			local slot = owner:GetID()
-
-			--if it's the character frames <alt> equipment switch then ignore it
-			if owner and owner:GetName() and strfind(owner:GetName(), "PaperDollFrame") then return end

 			local id = type(link) == "number" and link or select(3, link:find("item:(%d+):"))
 			id = tonumber(id)
diff --git a/xanMortarPestle.toc b/xanMortarPestle.toc
index 83fc64c..2802254 100644
--- a/xanMortarPestle.toc
+++ b/xanMortarPestle.toc
@@ -2,7 +2,7 @@
 ## Title: xanMortarPestle
 ## Notes: Mill/Prospect/Disenchant using (Alt + Right-Click) on an item.
 ## Author: Xruptor
-## Version: 1.8
+## Version: 1.9
 ## SavedVariables: XMP_DB

 xanMortarPestle.lua