Fix swing timer not resetting on resisted/missed spells

The swing timer now correctly resets when your spell is resisted or misses. Previously, a resisted Moonfire (for example) would not reset the swing timer bar even though the server had already reset your actual swing — causing the bar to desync until the next auto-attack.
This commit is contained in:
Meow
2026-03-05 04:09:56 +01:00
parent c0bd8cb4cf
commit 48c5d50f51
2 changed files with 59 additions and 40 deletions
+8 -7
View File
@@ -1273,6 +1273,14 @@ if hasNampower then
end
end
-- Fire registered SPELL_GO_SELF hooks BEFORE miss guard
-- (Swingtimer needs to see ALL casts, even misses, for swing reset)
if event == "SPELL_GO_SELF" and pfUI.libdebuff_spell_go_hooks then
for _, fn in pairs(pfUI.libdebuff_spell_go_hooks) do
fn(spellId, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
end
end
if numMissed > 0 or numHit == 0 then return end
local spellName = GetSpellRecField and GetSpellRecField(spellId, "name")
@@ -1317,13 +1325,6 @@ if hasNampower then
end
end
-- Fire registered SPELL_GO_SELF hooks (only for own casts)
if event == "SPELL_GO_SELF" and pfUI.libdebuff_spell_go_hooks then
for _, fn in pairs(pfUI.libdebuff_spell_go_hooks) do
fn(spellId, arg1, arg2, arg3, arg4, arg5, arg6, arg7)
end
end
-- Fire registered SPELL_GO_OTHER hooks
if event == "SPELL_GO_OTHER" and pfUI.libdebuff_spell_go_other_hooks then
for _, fn in pairs(pfUI.libdebuff_spell_go_other_hooks) do