From cdaf9336a380b6fd58e16128d0e40ce205f12f1b Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun, 25 Oct 2026 11:31:56 -0500 Subject: [PATCH] nameplates: skip destroyed plates on PLAYER_LOGOUT Leaving the world destroys the units before PLAYER_LOGOUT fires, so some plates in the registry are already dead: their overlay buttons dropped their events and lost their methods, and UnregisterAllEvents errored as a nil method. Only silence the plates that are still alive. --- modules/nameplates.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 9cc0a340..37d466f9 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -524,9 +524,11 @@ nameplates:RegisterUnitEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE", "target", "focu end -- The plates hold their own unit subscriptions now, so silencing this -- frame alone would leave them dispatching through logout -- exactly what - -- this branch exists to prevent. + -- this branch exists to prevent. Leaving the world destroys the units + -- before PLAYER_LOGOUT fires, and a destroyed plate already dropped its + -- events and lost its methods, so only the live ones need silencing. for plate in pairs(registry) do - if plate.nameplate then + if plate.nameplate and plate.nameplate.UnregisterAllEvents then plate.nameplate:UnregisterAllEvents() plate.nameplate:SetScript("OnEvent", nil) end