Move spell cooldown-related functions from OvaleData into OvaleCooldown.
Johnny C. Lam [04-06-14 - 18:44]
Move spell cooldown-related functions from OvaleData into OvaleCooldown.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1256 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleCooldown.lua b/OvaleCooldown.lua
index dfb37f3..3ff9c01 100644
--- a/OvaleCooldown.lua
+++ b/OvaleCooldown.lua
@@ -20,6 +20,7 @@ local OvalePaperDoll = nil
local OvaleStance = nil
local OvaleState = nil
+local API_GetSpellCooldown = GetSpellCooldown
local API_UnitHealth = UnitHealth
local API_UnitHealthMax = UnitHealthMax
local API_UnitClass = UnitClass
@@ -200,11 +201,13 @@ statePrototype.GetSpellCooldown = function(state, spellId)
local start, duration, enable
local cd = state:GetCD(spellId)
if cd and cd.start then
- start = cd.start
- duration = cd.duration
- enable = cd.enable
+ start, duration, enable = cd.start, cd.duration, cd.enable
else
- start, duration, enable = OvaleData:GetSpellCooldown(spellId)
+ start, duration, enable = API_GetSpellCooldown(spellId)
+ local si = OvaleData.spellInfo[spellId]
+ if si and si.forcecd then
+ start, duration = API_GetSpellCooldown(si.forcecd)
+ end
end
return start, duration, enable
end
diff --git a/OvaleData.lua b/OvaleData.lua
index 0874d3e..cbacdee 100644
--- a/OvaleData.lua
+++ b/OvaleData.lua
@@ -13,8 +13,6 @@ local OvaleData = Ovale:NewModule("OvaleData")
Ovale.OvaleData = OvaleData
--<private-static-properties>
-local API_GetSpellCooldown = GetSpellCooldown
-
-- Auras that are refreshed by spells that don't trigger a new snapshot.
self_buffNoSnapshotSpellList =
{
@@ -269,16 +267,6 @@ function OvaleData:GetSpellInfo(spellId)
end
end
---Compute the spell Cooldown
-function OvaleData:GetSpellCooldown(spellId)
- local start, duration, enable = API_GetSpellCooldown(spellId)
- local si = self.spellInfo[spellId]
- if si and si.forcecd then
- start, duration = API_GetSpellCooldown(si.forcecd)
- end
- return start, duration, enable
-end
-
--Compute the damage of the given spell.
function OvaleData:GetDamage(spellId, attackpower, spellpower, mainHandWeaponDamage, offHandWeaponDamage, combo)
local si = self.spellInfo[spellId]