From f277572f8d493c40eef402539bb2bc6c68626ff3 Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Sun, 10 Nov 2013 00:31:48 +0000 Subject: [PATCH] Rename static property OvaleState.attenteFinCast to OvaleState.nextCast. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1151 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleBestAction.lua | 8 ++++---- OvaleFrame.lua | 4 ++-- OvaleIcone.lua | 5 +++-- OvaleState.lua | 8 ++++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/OvaleBestAction.lua b/OvaleBestAction.lua index 1d5a61e..c1a11d6 100644 --- a/OvaleBestAction.lua +++ b/OvaleBestAction.lua @@ -125,14 +125,14 @@ local function ComputeAction(element) start = OvaleState.currentTime end - Ovale:Logf("start=%f attenteFinCast=%s [%d]", start, OvaleState.attenteFinCast, element.nodeId) + Ovale:Logf("start=%f nextCast=%s [%d]", start, OvaleState.nextCast, element.nodeId) -- If the action is available before the end of the current spellcast, then wait until we can first cast the action. - if start < OvaleState.attenteFinCast then + if start < OvaleState.nextCast then local si = OvaleState.currentSpellId and OvaleData.spellInfo[OvaleState.currentSpellId] if not (si and si.canStopChannelling) then -- not a channelled spell, or a channelled spell that cannot be interrupted - start = OvaleState.attenteFinCast + start = OvaleState.nextCast else -- This is a channelled spell that can be interrupted, so wait till the next tick. -- "canStopChannelling=N" means that there are N total ticks in the channelled spell. @@ -145,7 +145,7 @@ local function ComputeAction(element) scaling = 1 end numTicks = floor(si.canStopChannelling * scaling + 0.5) - local tick = (OvaleState.attenteFinCast - OvaleState.startCast) / numTicks + local tick = (OvaleState.nextCast - OvaleState.startCast) / numTicks local tickTime = OvaleState.startCast + tick Ovale:Logf("%s start=%f", spellId, start) for i = 1, numTicks do diff --git a/OvaleFrame.lua b/OvaleFrame.lua index 20ddf2d..1ea2b5e 100644 --- a/OvaleFrame.lua +++ b/OvaleFrame.lua @@ -218,8 +218,8 @@ do end end -- Dans le cas de canStopChannelling, on risque de demander d'interrompre le channelling courant, ce qui est stupide - if start and OvaleState.currentSpellId and OvaleState.attenteFinCast and spellId == OvaleState.currentSpellId and start actionCooldownStart + actionCooldownDuration + 0.01 and minAttente > OvaleState.now - and minAttente>OvaleState.attenteFinCast) then + if minAttente > actionCooldownStart + actionCooldownDuration + 0.01 + and minAttente > OvaleState.now + and minAttente > OvaleState.nextCast then self.icone:SetVertexColor(0.75,0.2,0.2) red = true else diff --git a/OvaleState.lua b/OvaleState.lua index efe2f55..c340c8e 100644 --- a/OvaleState.lua +++ b/OvaleState.lua @@ -62,7 +62,7 @@ OvaleState.powerRate = nil OvaleState.currentSpellId = nil OvaleState.now = nil OvaleState.currentTime = nil -OvaleState.attenteFinCast = nil +OvaleState.nextCast = nil OvaleState.startCast = nil OvaleState.endCast = nil OvaleState.gcd = 1.5 @@ -146,7 +146,7 @@ function OvaleState:Reset() self.currentTime = self.now Ovale:Logf("Reset state with current time = %f", self.currentTime) self.currentSpellId = nil - self.attenteFinCast = self.now + self.nextCast = self.now self:InvokeMethod("ResetState") @@ -191,7 +191,7 @@ function OvaleState:ApplySpell(spellId, startCast, endCast, nextCast, nocd, targ end -- Update the latest spell cast in the simulator. - self.attenteFinCast = nextCast + self.nextCast = nextCast self.currentSpellId = spellId self.startCast = startCast self.endCast = endCast @@ -206,7 +206,7 @@ function OvaleState:ApplySpell(spellId, startCast, endCast, nextCast, nocd, targ self.currentTime = self.now end - Ovale:Logf("Apply spell %d at %f currentTime=%f nextCast=%f endCast=%f targetGUID=%s", spellId, startCast, self.currentTime, self.attenteFinCast, endCast, targetGUID) + Ovale:Logf("Apply spell %d at %f currentTime=%f nextCast=%f endCast=%f targetGUID=%s", spellId, startCast, self.currentTime, self.nextCast, endCast, targetGUID) --[[ Apply the effects of the spellcast in three phases. -- 1.7.9.5