mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
ClassicAPI fires its own unit events (UNIT_AURA_DELTA, the remote UNIT_SPELLCAST_*, the power, group-member, distance, incoming-resurrection and targetable events) once per token through Unit::Identity::TokensForGUID. That took the engine's tokens from its reverse map FUN_UNIT_TOKENS_FROM_GUID (0x00515C50) and then added its own short list: focus and nameplateN. The engine's unit events get their ClassicAPI tokens from a second list in Unit::TokenEvents, which also has markN, softenemy and softfriend. So a soft enemy got UNIT_HEALTH but never UNIT_SPELLCAST_START. That list is now the public Unit::TokenEvents::TokensOf, capped at the caller's room and empty before the player object exists, as before. TokensForGUID appends it to the engine's tokens, so both kinds of event reach the same tokens, and a new token goes in one place. nameplateN now comes before focus, the order TokensOf already used. API.md's soft enemy and soft friend section now says that their tokens fire unit events, as the focus, nameplateN and markN sections do.