From 3459fcaad10524505fc330fbec7342f5bd205836 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Tue, 26 Nov 2013 14:04:48 +0000 Subject: [PATCH] Only reach Eclipse state if the spellcast got us there. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1207 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleEclipse.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/OvaleEclipse.lua b/OvaleEclipse.lua index 3e7ff6f..ff41757 100644 --- a/OvaleEclipse.lua +++ b/OvaleEclipse.lua @@ -179,18 +179,18 @@ function OvaleEclipse:ApplySpellAfterCast(state, spellId, targetGUID, startCast, -- Only adjust Eclipse energy if the spell moves the Eclipse bar in the right direction. if (direction <= 0 and energy < 0) or (direction >= 0 and energy > 0) then eclipse = eclipse + energy - end - -- Clamp Eclipse energy to min/max values and note that an Eclipse state will be reached after the spellcast. - if eclipse <= -100 then - eclipse = -100 - direction = 1 - state:AddAuraToGUID(self_guid, LUNAR_ECLIPSE, "HELPFUL", true, endCast, math.huge) - -- Reaching Lunar Eclipse resets the cooldown of Starfall. - state:ResetSpellCooldown(LUNAR_ECLIPSE, endCast) - elseif eclipse >= 100 then - eclipse = 100 - direction = -1 - state:AddAuraToGUID(self_guid, SOLAR_ECLIPSE, "HELPFUL", true, endCast, math.huge) + -- Clamp Eclipse energy to min/max values and note that an Eclipse state will be reached after the spellcast. + if eclipse <= -100 then + eclipse = -100 + direction = 1 + state:AddAuraToGUID(self_guid, LUNAR_ECLIPSE, "HELPFUL", true, endCast, math.huge) + -- Reaching Lunar Eclipse resets the cooldown of Starfall. + state:ResetSpellCooldown(STARFALL, endCast) + elseif eclipse >= 100 then + eclipse = 100 + direction = -1 + state:AddAuraToGUID(self_guid, SOLAR_ECLIPSE, "HELPFUL", true, endCast, math.huge) + end end end state.eclipse = eclipse -- 1.7.9.5