Fix error when using an invalid spell with a custom bar on 11.x

This commit is contained in:
Parnic
2024-08-14 11:34:54 -05:00
parent 73891bca4b
commit 30ec3750c1
6 changed files with 36 additions and 4 deletions

View File

@ -1,5 +1,9 @@
# Changelog
v1.15.5:
- Fix error when using an invalid spell with a custom bar on 11.x
v1.15.4:
- Update TOC for TWW

View File

@ -20,10 +20,16 @@ end
local GetSpellInfo = GetSpellInfo
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
GetSpellInfo = function(id)
if not id then
return nil
end
local info = C_Spell.GetSpellInfo(id)
if info then
return info.name, nil, info.iconID
end
end
end
IceCustomBar.prototype.auraDuration = -1
IceCustomBar.prototype.auraEndTime = -1

View File

@ -30,10 +30,16 @@ end
local GetSpellInfo = GetSpellInfo
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
GetSpellInfo = function(id)
if not id then
return nil
end
local info = C_Spell.GetSpellInfo(id)
if info then
return info.name, nil, info.iconID
end
end
end
local GetSpellCooldown = GetSpellCooldown
if not GetSpellCooldown and C_Spell then

View File

@ -10,10 +10,16 @@ local DefaultAuraIcon = "Interface\\Icons\\Spell_Frost_Frost"
local GetSpellInfo = GetSpellInfo
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
GetSpellInfo = function(id)
if not id then
return nil
end
local info = C_Spell.GetSpellInfo(id)
if info then
return info.name, nil, info.iconID
end
end
end
function IceCustomCounterBar.prototype:init()
IceCustomCounterBar.super.prototype.init(self, "CustomCounterBar")

View File

@ -9,10 +9,16 @@ end
local GetSpellInfo = GetSpellInfo
if not GetSpellInfo and C_Spell and C_Spell.GetSpellInfo then
GetSpellInfo = function(id)
if not id then
return nil
end
local info = C_Spell.GetSpellInfo(id)
if info then
return info.name, nil, info.iconID, info.castTime
end
end
end
local GetSpellCooldown = GetSpellCooldown
if not GetSpellCooldown and C_Spell then

View File

@ -1,5 +1,9 @@
# Changelog
v1.15.5:
- Fix error when using an invalid spell with a custom bar on 11.x
v1.15.4:
- Update TOC for TWW