mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
The name-query callback (0x5FB86E) and the creature-cache reply (0x6046C1) call CGUnit_C::ReleaseNamePlate (0x608A10) so the plate is rebuilt with the name, and the next tick takes a plate again through AllocNamePlate (0x6087F0). The free list is FIFO: release links the frame in at the tail and alloc takes s_freeNamePlates[2], the head. So unless the list was empty, the unit gets a different CGNamePlateFrame. The per-tick diff compared GUIDs only. The GUID was in both snapshots, so no event fired, and an addon that keys its state by frame kept the old, hidden frame. A binding is now the (GUID, frame) pair. A unit on a new frame gets NAME_PLATE_UNIT_REMOVED for the old binding, then NAME_PLATE_UNIT_ADDED for the new one. The REMOVED pass now runs before the ADDED pass, so the old binding's slot is free before the new one is assigned. A re-acquire that hands back the same frame still fires nothing. During REMOVED, GetNamePlateForUnit / GetNamePlateForGUID now return the frame being removed before they read unit+0xE60. After a rebind, that field already names the new frame, and the getters would have given the handler the wrong plate.