From c151491f59724bc223d94be1c663633d5858fb10 Mon Sep 17 00:00:00 2001 From: Pawel Date: Sat, 2 Apr 2016 00:16:53 +0200 Subject: [PATCH] v1.6 - spell charges fix --- TDDps.toc | 2 +- TDHelper.lua | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) 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 -- 1.7.9.5