mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-03 20:20:01 +00:00
libcast: make post-hook update last cast texture
we now set lastcasttex from the texture returned by libspell.GetSpellInfo in "CastSpellByName" post-hook
This commit is contained in:
+7
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user