Skip to content

Commit

Permalink
Fix spell cooldown bars in 11.x
Browse files Browse the repository at this point in the history
GetSpellCooldown used to return 1 for "has duration", but the new native version returns true. Fun.

Additionally, it looks like the events triggering UpdateCustomBarEvent() are passing a nil argument that the mod thought was supposed to be the affected unit. So I also fixed that, though I don't know if that's an 11.x thing or not.

https://www.wowace.com/projects/ice-hud/issues/363
  • Loading branch information
parnic committed Jul 27, 2024
1 parent 6c1c68a commit 66f4492
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

v1.15.3:

- Fix custom cooldown bars not working in 11.x (wowace issue #363)

v1.15.2:

- Re-enable right-click context menus on 11.x.
Expand Down
6 changes: 3 additions & 3 deletions modules/CustomCDBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@ function IceCustomCDBar.prototype:GetCooldownDuration(buffName)
local localRemaining = nil
local localStart, localDuration, hasCooldown = GetSpellCooldown(buffName)

if (hasCooldown == 1) then
if hasCooldown then
-- the item has a potential cooldown
if (localDuration <= 1.5) then
if localDuration <= 1.5 then
return nil, nil
end

Expand Down Expand Up @@ -734,7 +734,7 @@ function IceCustomCDBar.prototype:UpdateItemUnitInventoryChanged(event, unit)
end

function IceCustomCDBar.prototype:UpdateCustomBarEvent(event, unit)
if unit ~= self.unit then
if unit and unit ~= self.unit then
return
end
if not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
Expand Down
4 changes: 4 additions & 0 deletions this_version.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

v1.15.3:

- Fix custom cooldown bars not working in 11.x (wowace issue #363)

v1.15.2:

- Re-enable right-click context menus on 11.x.
Expand Down

0 comments on commit 66f4492

Please sign in to comment.