Skip to content

Commit

Permalink
CastBarLatency: Fix GetSpellCooldown usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nebularg committed Aug 20, 2024
1 parent 1d88d8e commit 8be7076
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Modules/CastBarLatency/CastBarLatency.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ function PitBull4_CastBarLatency:UNIT_SPELLCAST_START(event, unit, _, spell_id)
-- Try to determine GCD
local gcd_time = 0
if show_gcd and spell_id then
local _, duration = GetSpellCooldown(spell_id)
local info, duration = GetSpellCooldown(spell_id)
if type(info) == "table" then
duration = info.duration
end
if duration and duration > 0 and duration <= MAX_GCD_TIME then
gcd_time = duration
end
Expand Down Expand Up @@ -108,7 +111,10 @@ function PitBull4_CastBarLatency:UNIT_SPELLCAST_CHANNEL_START(event, unit, _, sp
-- Try to determine GCD
local gcd_time = 0
if show_gcd and spell_id then
local _, duration = GetSpellCooldown(spell_id)
local info, duration = GetSpellCooldown(spell_id)
if type(info) == "table" then
duration = info.duration
end
if duration and duration > 0 and duration <= MAX_GCD_TIME then
gcd_time = duration
end
Expand Down

0 comments on commit 8be7076

Please sign in to comment.