Place the check GetSpellCooldown() of "CastSpell" inside CastCustom(). All three post-hook functions have to be aligned to use the new CastCustom() which will accept 3 arguments: (id, bookType, rawSpellName)
Remove the 'for i=1,120 do ...' completely from "CastSpellByName" considering that it's not really serving us right (it doesn't really detect macro-based casts) and it's incredibly taxing on resources
We can now simplify:
for custom, func in pairs(libcast.customcast) do [...]
Into a simple table-lookup:
local func = libcast.customcast[strlower(rawSpellName)] -- the rawSpellName is the spell without the rank so we are cool
if not func then return end
func(true)
Place the check GetSpellCooldown() of "CastSpell" inside CastCustom(). All three post-hook functions have to be aligned to use the new CastCustom() which will accept 3 arguments: (id, bookType, rawSpellName)
Remove the 'for i=1,120 do ...' completely from "CastSpellByName" considering that it's not really serving us right (it doesn't really detect macro-based casts) and it's incredibly taxing on resources
We can now simplify:
Into a simple table-lookup:
This issue builds on top of #1294 and #1296