v1.6 - spell charges fix
Pawel [04-01-16 - 22:16]
diff --git a/TDDps.toc b/TDDps.toc
index 1c438a2..3f50a04 100644
--- a/TDDps.toc
+++ b/TDDps.toc
@@ -1,6 +1,6 @@
## Title: TDDps
## Notes: Rotation helper framework.
-## Version: 1.5
+## Version: 1.6
## Author: Kaminaris
## Interface: 60200
## SavedVariables: TDDps_Options
diff --git a/TDHelper.lua b/TDHelper.lua
index 55f4dbd..15f6fe3 100644
--- a/TDHelper.lua
+++ b/TDHelper.lua
@@ -116,9 +116,17 @@ end
----------------------------------------------
-- Stacked spell CD, charges and max charges
----------------------------------------------
-function TD_SpellCharges(spell)
+function TD_SpellCharges(spell, timeShift)
local currentCharges, maxCharges, cooldownStart, cooldownDuration = GetSpellCharges(spell);
- local cd = cooldownDuration - (GetTime() - cooldownStart);
+ if currentCharges == nil then
+ local cd = TD_Cooldown(spell, timeShift);
+ if cd <= 0 then
+ return 0, 1, 0;
+ else
+ return cd, 0, 1;
+ end
+ end
+ local cd = cooldownDuration - (GetTime() - cooldownStart) - (timeShift or 0);
if cd > cooldownDuration then
cd = 0;
end