From b8727b6e33fa00f9902807fe4d224d881e43e95b Mon Sep 17 00:00:00 2001 From: Buds Date: Fri, 19 Jul 2024 02:51:33 +0200 Subject: [PATCH] fix GetSpellCooldown on tww --- main.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 0f83a57..29e9c27 100644 --- a/main.lua +++ b/main.lua @@ -27,6 +27,13 @@ local GetSpellCharges = GetSpellCharges or function(id) return chargeInfo.currentCharges, chargeInfo.maxCharges, chargeInfo.cooldownStartTime, chargeInfo.cooldownDuration, chargeInfo.chargeModRate end +local GetSpellCooldown = GetSpellCooldown or function(spellID) + local spellCooldownInfo = C_Spell.GetSpellCooldown(spellID); + if spellCooldownInfo then + return spellCooldownInfo.startTime, spellCooldownInfo.duration, spellCooldownInfo.isEnabled, spellCooldownInfo.modRate; + end +end + local BOOKTYPE_SPELL = "spell"; local GetSpellBookItemName = GetSpellBookItemName or function(index, bookType) @@ -268,7 +275,10 @@ local function GetSpellCooldownUnified(id) local basecd = GetSpellBaseCooldown(id); local enabled; startTime, duration, enabled = GetSpellCooldown(id); - if (enabled == 0) then + if type(enabled) == "number" then + enabled = enabled == 1 and true or false + end + if not enabled then startTime, duration = 0, 0 end