mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 14:00:48 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user