Start cooldowns in the simulator at the right time for channeled spells.
Johnny C. Lam [11-15-13 - 19:58]
Start cooldowns in the simulator at the right time for channeled spells.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1180 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleCooldown.lua b/OvaleCooldown.lua
index 30e9815..01ba924 100644
--- a/OvaleCooldown.lua
+++ b/OvaleCooldown.lua
@@ -108,7 +108,7 @@ function OvaleCooldown:ApplySpellAfterCast(state, spellId, startCast, endCast, n
if si then
local cd = state:GetCD(spellId)
if cd then
- cd.start = startCast
+ cd.start = isChanneled and startCast or endCast
cd.duration = si.cd or 0
cd.enable = 1
diff --git a/OvaleRunes.lua b/OvaleRunes.lua
index 3bd1ef1..32feb8a 100644
--- a/OvaleRunes.lua
+++ b/OvaleRunes.lua
@@ -201,7 +201,8 @@ function OvaleRunes:ApplySpellAfterCast(state, spellId, startCast, endCast, next
for i, name in ipairs(RUNE_NAME) do
local count = si[name] or 0
while count > 0 do
- state:ConsumeRune(endCast, name)
+ local attime = isChanneled and startCast or endCast
+ state:ConsumeRune(atTime, name)
count = count - 1
end
end