benilla-re systems structs docs

s_corpseRangeSquared

global · ui

Address
0xb4e2ac · 4 bytes, up to 0xb4e2af
Type
float
Meaning
Holds 1600.0, the squared range of the corpse range events
Confidence
verified, proof one
Finding
ui/deathui#corpse-range-events

Finding: Corpse range events in ui: death, the corpse run and resurrection

Each frame the world frame update calls 0x492130 (0x4818c5, in the unconditional tail of 0x481790). With a cached corpse and the active player it takes the squared 3D distance from the player to the cached position, summed as (dz² + dx²) + dy² (0x492188 to 0x492194), and compares it with 0xb4e2ac; inside or equal is range 1. 0x4920f0(state) signals only on a change: CORPSE_OUT_OF_RANGE for 0, and for 1 CORPSE_IN_RANGE when the cached map ids are equal, else CORPSE_IN_INSTANCE.

The derivation is in the doc.