From 0e11f80cc7d1fcf53e7eb798956fad5c109e5476 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Tue, 26 Nov 2013 14:04:54 +0000 Subject: [PATCH] Fix arguments passed to state:GetCD(). git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1208 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleCooldown.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/OvaleCooldown.lua b/OvaleCooldown.lua index 6d0ed57..5856643 100644 --- a/OvaleCooldown.lua +++ b/OvaleCooldown.lua @@ -185,7 +185,7 @@ do -- Return the cooldown for the spell in the simulator. statePrototype.GetSpellCooldown = function(state, spellId) local start, duration, enable - local cd = state:GetCD(state, spellId) + local cd = state:GetCD(spellId) if cd and cd.start then start = cd.start duration = cd.duration @@ -199,10 +199,15 @@ do -- Force the cooldown of a spell to reset at the specified time. statePrototype.ResetSpellCooldown = function(state, spellId, atTime) if atTime >= state.currentTime then - local cd = state:GetCD(state, spellId) - cd.start = state.currentTime - cd.duration = atTime - state.currentTime - cd.enable = 1 + local start, duration, enable = state:GetSpellCooldown(spellId) + if start + duration > state.currentTime then + local cd = state:GetCD(spellId) + if cd then + cd.start = state.currentTime + cd.duration = atTime - state.currentTime + cd.enable = 1 + end + end end end end -- 1.7.9.5