From 68d561f561a356499aa5a8b718898dcbfda17401 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Fri, 15 Nov 2013 19:56:34 +0000 Subject: [PATCH] There are no more toggled spells in WoW. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1168 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleBestAction.lua | 9 --------- OvaleCooldown.lua | 6 +----- OvaleFuture.lua | 23 +++++++++-------------- OvaleScore.lua | 4 +--- 4 files changed, 11 insertions(+), 31 deletions(-) diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua index fa10f92..2f81bb9 100644 --- a/OvaleBestAction.lua +++ b/OvaleBestAction.lua @@ -110,10 +110,6 @@ local function ComputeAction(element) element.castTime = nil end end - if si and si.toggle and actionIsCurrent then - Ovale:Logf("Action %s (toggle) is the current action", action) - return timeSpan - end else element.castTime = 0 end @@ -813,11 +809,6 @@ function OvaleBestAction:GetActionInfo(element) actionIsCurrent = API_IsCurrentAction(action) end - local cd = state:GetCD(spellId) - if cd and cd.toggled then - actionIsCurrent = 1 - end - return actionTexture, actionInRange, actionCooldownStart, actionCooldownDuration, actionUsable, actionShortcut, actionIsCurrent, actionEnable, spellId, target, element.params.nored end diff --git a/OvaleCooldown.lua b/OvaleCooldown.lua index 15a52e9..79fba2e 100644 --- a/OvaleCooldown.lua +++ b/OvaleCooldown.lua @@ -99,7 +99,6 @@ function OvaleCooldown:ResetState(state) cd.start = nil cd.duration = nil cd.enable = 0 - cd.toggled = nil end end @@ -116,6 +115,7 @@ function OvaleCooldown:ApplySpellOnPlayer(state, spellId, startCast, endCast, ne if cd then cd.start = startCast cd.duration = si.cd or 0 + cd.enable = 1 -- Test for no cooldown. if nocd then @@ -154,10 +154,6 @@ function OvaleCooldown:ApplySpellOnPlayer(state, spellId, startCast, endCast, ne end end - cd.enable = 1 - if si.toggle then - cd.toggled = 1 - end Ovale:Logf("Spell %d cooldown info: start=%f, duration=%f", spellId, cd.start, cd.duration) end end diff --git a/OvaleFuture.lua b/OvaleFuture.lua index 490c059..3513746 100644 --- a/OvaleFuture.lua +++ b/OvaleFuture.lua @@ -454,24 +454,19 @@ end function OvaleFuture:ApplyInFlightSpells() local now = OvaleState.now local index = 0 - local spellcast, si while true do index = index + 1 if index > #self_activeSpellcast then return end - spellcast = self_activeSpellcast[index] - si = OvaleData.spellInfo[spellcast.spellId] - -- skip over spells that are toggles for other spells - if not (si and si.toggle) then - Ovale:Logf("now = %f, spellId = %d, endCast = %f", now, spellcast.spellId, spellcast.stop) - if now - spellcast.stop < 5 then - OvaleState:ApplySpell(spellcast.spellId, spellcast.start, spellcast.stop, spellcast.stop, spellcast.nocd, spellcast.target, spellcast) - else - tremove(self_activeSpellcast, index) - self_pool:Release(spellcast) - -- Decrement current index since item was removed and rest of items shifted up. - index = index - 1 - end + local spellcast = self_activeSpellcast[index] + Ovale:Logf("now = %f, spellId = %d, endCast = %f", now, spellcast.spellId, spellcast.stop) + if now - spellcast.stop < 5 then + OvaleState:ApplySpell(spellcast.spellId, spellcast.start, spellcast.stop, spellcast.stop, spellcast.nocd, spellcast.target, spellcast) + else + tremove(self_activeSpellcast, index) + self_pool:Release(spellcast) + -- Decrement current index since item was removed and rest of items shifted up. + index = index - 1 end end end diff --git a/OvaleScore.lua b/OvaleScore.lua index 4e72bde..c266472 100644 --- a/OvaleScore.lua +++ b/OvaleScore.lua @@ -33,7 +33,6 @@ local OvaleScore = Ovale:NewModule("OvaleScore", "AceEvent-3.0") Ovale.OvaleScore = OvaleScore -- -local OvaleData = Ovale.OvaleData local OvaleGUID = Ovale.OvaleGUID local pairs = pairs @@ -115,8 +114,7 @@ function OvaleScore:AddSpell(spellId) end function OvaleScore:ScoreSpell(spellId) - local si = OvaleData.spellInfo[spellId] - if Ovale.enCombat and self_scoredSpell[spellId] and not (si and si.toggle) then + if Ovale.enCombat and self_scoredSpell[spellId] then local scored = Ovale.frame:GetScore(spellId) Ovale:Logf("Scored %s", scored) if scored then -- 1.7.9.5