Quantcast

Fix enemy/friend bindings when used with default/hovercast.

James Whitehead II [10-22-10 - 10:49]
Fix enemy/friend bindings when used with default/hovercast.

Thanks to JTrent82 for the thorough bug report that helped me track this
one down.
Filename
Clique.lua
diff --git a/Clique.lua b/Clique.lua
index 6de2578..33f9fcd 100755
--- a/Clique.lua
+++ b/Clique.lua
@@ -335,11 +335,25 @@ function addon:GetClickAttributes(global)
             -- then in the remapping.

             if entry.sets.friend then
+                if global then
+                    -- A modified binding that uses friend/enemy must have the unmodified
+                    -- 'unit' attribute set, in order to do the friend/enemy lookup. Add
+                    -- that here.
+                    bits[#bits + 1] = ATTR(prefix, "unit", suffix, "mouseover")
+                    rembits[#rembits + 1] = REMATTR(prefix, "unit", suffix)
+                end
                 local newbutton = "friend" .. suffix
                 bits[#bits + 1] = ATTR(prefix, "helpbutton", suffix, newbutton)
                 rembits[#rembits + 1] = REMATTR(prefix, "helpbutton", suffix)
                 suffix = newbutton
             elseif entry.sets.enemy then
+                if global then
+                    -- A modified binding that uses friend/enemy must have the unmodified
+                    -- 'unit' attribute set, in order to do the friend/enemy lookup. Add
+                    -- that here.
+                    bits[#bits + 1] = ATTR(prefix, "unit", suffix, "mouseover")
+                    rembits[#rembits + 1] = REMATTR(prefix, "unit", suffix)
+                end
                 local newbutton = "enemy" .. suffix
                 bits[#bits + 1] = ATTR(prefix, "harmbutton", suffix, newbutton)
                 rembits[#rembits + 1] = REMATTR(prefix, "harmbutton", suffix)