mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
Switch nameplateN indexing from a compacting vector (append on ADDED, erase + shift-down on REMOVED) to retail-exact slot assignment: a plate keeps its slot for its whole lifetime, a removal frees the slot, and the next new plate reuses the lowest free one. Survivors are never renumbered when another plate is removed - matching modern WoW, where a middle plate vanishing leaves the others' tokens unchanged and its slot goes vacant until reused. g_orderedGUIDs -> g_slots (sparse; free slots hold GUID 0, trailing empties trimmed). GetGUIDByIndex returns 0 for a free or out-of-range slot; new GetSlotCount exposes the high-water mark. The reverse token walk in Unit::Identity now scans 1..GetSlotCount() and skips gaps instead of stopping at the first 0. The per-plate observer lifecycle is unchanged (keyed on GUID: register on ADD, unregister on REMOVE). Verified in-game: 3 plates in slots 1/2/3, removing the middle one leaves slots 1 and 3 occupied and 2 vacant - no renumber.