diff --git a/libs/libcast.lua b/libs/libcast.lua index 1d3239a1..ff8aa1ae 100644 --- a/libs/libcast.lua +++ b/libs/libcast.lua @@ -400,13 +400,17 @@ hooksecurefunc("CastSpell", function(id, bookType) end end, true) -hooksecurefunc("CastSpellByName", function(spell, target) - _, lastrank = libspell.GetSpellInfo(spell) +hooksecurefunc("CastSpellByName", function(spellCasted, target) + local spellName, rank, texture, _, _, _, cachedId = libspell.GetSpellInfo(spellCasted) + if not spellName or not cachedId then return end -- ignore if the spell is not found + + lastrank = rank + lastcasttex = texture for i=1,120 do -- detect if any cast is ongoing if IsCurrentAction(i) then - CastCustom(spell) + CastCustom(spellCasted) return end end