Quantcast

Make sure the item(s) are in a bag

p3lim [12-12-10 - 23:03]
Make sure the item(s) are in a bag
Filename
Molinari.lua
diff --git a/Molinari.lua b/Molinari.lua
index 147b815..d9cf641 100644
--- a/Molinari.lua
+++ b/Molinari.lua
@@ -28,7 +28,7 @@ function button:PLAYER_LOGIN()
 			local spell, r, g, b = ScanTooltip(self, spells)

 			local bag, slot = GetMouseFocus():GetParent(), GetMouseFocus()
-			if(spell) then
+			if(spell and GetContainerItemLink(bag:GetID(), slot:GetID()) == link) then
 				button:SetAttribute('macrotext', string.format('/cast %s\n/use %s %s', spell, slot:GetParent():GetID(), slot:GetID()))
 				button:GetNormalTexture():SetVertexColor(r, g, b)
 				button:SetAllPoints(slot)