mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 05:50:50 +00:00
libcast: reuse spellname and texture from previous call
- introduce a guard-close in case the spell is phony - reuse the spell-name and texture returned by GetSpellInfo()
This commit is contained in:
+5
-3
@@ -389,11 +389,13 @@ hooksecurefunc("UseContainerItem", function(id, index)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
hooksecurefunc("CastSpell", function(id, bookType)
|
hooksecurefunc("CastSpell", function(id, bookType)
|
||||||
_, lastrank = libspell.GetSpellInfo(id, bookType)
|
local spellName, rank, texture, _, _, _, cachedId = libspell.GetSpellInfo(id, bookType)
|
||||||
lastcasttex = GetSpellTexture(id, bookType)
|
if not spellName or not cachedId then return end -- ignore if the spell is not found
|
||||||
|
|
||||||
|
lastrank = rank
|
||||||
|
lastcasttex = texture
|
||||||
|
|
||||||
if GetSpellCooldown(id, bookType) ~= 0 then
|
if GetSpellCooldown(id, bookType) ~= 0 then
|
||||||
local spellName = GetSpellName(id, bookType)
|
|
||||||
CastCustom(spellName)
|
CastCustom(spellName)
|
||||||
end
|
end
|
||||||
end, true)
|
end, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user