benilla-re systems structs docs

s_unitWatchLengthSelector

global · ui

Address
0x51bc98 · 175 bytes, up to 0x51bd46
Type
uint8_t[175]
Meaning
Holds a byte per unit field index that selects the watcher length arm
Confidence
verified, proof one
Finding
ui/unittokens#unit-field-events

Finding: Unit field events in ui: unit tokens and the unit functions' arguments

A change of a named unit field signals an event of the same name with the tokens of the unit. 0x51bbb0(object) registers, for each field index 0 to 0xb5 whose name in the event table 0xbe1198 is nonzero, one watcher on the unit with the callback 0x51bd50. The watch length is 4 bytes, except index 0, 2, 4 and 10 (8 bytes), 41 (0xd8, the aura array), 107 (0x30) and 167 and 174 (0x1c). A player also gets two watchers with fixed ids, callback 0x51bd90 for the player block at +0x28 (id 0x20a) and 0x51bd70 for +0x118 (id 0xba). 0x51bd50 signals event offset / 4 through 0x515e50. The fields and ids are tables/events.tsv ids 0 to 0xb5.

The derivation is in the doc.