Skip to content

Commit

Permalink
fix GetSpellCooldown on tww
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbuds committed Jul 19, 2024
1 parent 06a8b50 commit b8727b6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit b8727b6

Please sign in to comment.