mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 16:10:36 +00:00
UnitClassBase and UnitRaceBase now follow stock Script_UnitClass (0x00518350) and Script_UnitRace (0x00518200) branch for branch. "player" reads the selected-character record; any other token goes through GetGUIDFromName + ClntObjMgrObjectPtr(TYPEMASK_UNIT) and reads the held object's descriptor byte (+0x79 class, +0x78 race). The NameCache record (+0x140 / +0x138, null callback) is peeked only when no object is held. Before, the NameCache was also peeked when a held object's byte was 0. That never changed a result (creatures are not in the NameCache) but resolved the token twice and did not match the engine's branch. The comments and API.md also claimed creatures return nil, that class IDs run 1-9, and that UnitClass has a third return. None of that is true: creatures go through the same ChrClasses/ChrRaces lookup as in UnitClass/UnitRace, Druid is 11, and stock returns exactly two values.