proper overwrite of CooldownFrame_SetTimer function in E:RegisterCooldown

This commit is contained in:
Pinya
2018-07-22 16:48:47 +03:00
parent 221e158e23
commit 9ca79859fe
+3 -2
View File
@@ -115,16 +115,17 @@ function E:OnSetCooldown(start, duration, enable)
end end
end end
local cooldownHooked
local oldCooldownFrame_SetTimer = CooldownFrame_SetTimer local oldCooldownFrame_SetTimer = CooldownFrame_SetTimer
function E:RegisterCooldown(cooldown) function E:RegisterCooldown(cooldown)
if not E.private.cooldown.enable or cooldown.isHooked then return end if not E.private.cooldown.enable or cooldownHooked then return end
function CooldownFrame_SetTimer(this, start, duration, enable) function CooldownFrame_SetTimer(this, start, duration, enable)
oldCooldownFrame_SetTimer(this, start, duration, enable) oldCooldownFrame_SetTimer(this, start, duration, enable)
E.OnSetCooldown(this, start, duration, enable) E.OnSetCooldown(this, start, duration, enable)
end end
cooldown.isHooked = true cooldownHooked = true
end end
function E:UpdateCooldownSettings() function E:UpdateCooldownSettings()