Quantcast

Update cooldown state on all spellcast events.

Johnny C. Lam [05-15-14 - 23:19]
Update cooldown state on all spellcast events.

Blizzard gives spells a "GCD" cooldown while they're being cast before the
real cooldown kicks in afterwards.  Update the cooldown state on all
spellcast events to catch this "GCD" cooldown.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1455 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleCooldown.lua
diff --git a/OvaleCooldown.lua b/OvaleCooldown.lua
index 6a98618..d41cbc1 100644
--- a/OvaleCooldown.lua
+++ b/OvaleCooldown.lua
@@ -45,6 +45,10 @@ end
 function OvaleCooldown:OnEnable()
 	self:RegisterEvent("SPELL_UPDATE_CHARGES", "Update")
 	self:RegisterEvent("SPELL_UPDATE_USABLE", "Update")
+	self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START", "Update")
+	self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP", "Update")
+	self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED", "Update")
+	self:RegisterEvent("UNIT_SPELLCAST_START", "Update")
 	self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", "Update")
 	OvaleState:RegisterState(self, self.statePrototype)
 end
@@ -53,6 +57,10 @@ function OvaleCooldown:OnDisable()
 	OvaleState:UnregisterState(self)
 	self:UnregisterEvent("SPELL_UPDATE_CHARGES")
 	self:UnregisterEvent("SPELL_UPDATE_USABLE")
+	self:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_START")
+	self:UnregisterEvent("UNIT_SPELLCAST_CHANNEL_STOP")
+	self:UnregisterEvent("UNIT_SPELLCAST_INTERRUPTED")
+	self:UnregisterEvent("UNIT_SPELLCAST_START")
 	self:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED")
 end