Quantcast

Fix role icons rseting to default

Darthpred [08-27-16 - 08:26]
Fix role icons rseting to default
Filename
ElvUI_SLE/modules/unitframes/roleIcons.lua
diff --git a/ElvUI_SLE/modules/unitframes/roleIcons.lua b/ElvUI_SLE/modules/unitframes/roleIcons.lua
index 9c6c6c6..f231ad2 100644
--- a/ElvUI_SLE/modules/unitframes/roleIcons.lua
+++ b/ElvUI_SLE/modules/unitframes/roleIcons.lua
@@ -61,8 +61,11 @@ function SUF:SetRoleIcons()
 			local group = T.select(i, header:GetChildren())
 			for j = 1, group:GetNumChildren() do
 			local unitbutton = T.select(j, group:GetChildren())
-				if unitbutton.LFDRole and unitbutton.LFDRole.Override then
+				if unitbutton.LFDRole and unitbutton.LFDRole.Override and not unitbutton.LFDRole.sleRoleSetup then
 					unitbutton.LFDRole.Override = SUF.UpdateRoleIcon
+					unitbutton:UnregisterEvent("UNIT_CONNECTION")
+					unitbutton:RegisterEvent("UNIT_CONNECTION", SUF.UpdateRoleIcon)
+					unitbutton.LFDRole.sleRoleSetup = true
 				end
 			end
 		end