benilla-re systems structs docs

ProjectWorldPosition

function · ui · primitive

Address
0x4a7360 · 478 bytes, up to 0x4a753d
Meaning
Normalises a world position to the displayed map for a map id
Confidence
verified, proof one
Finding
ui/worldmap#unit-and-corpse-positions
Test
ui::geo_4a7360

Finding: Unit and corpse positions in ui: the world map

0x4a7360(&(x, y), mapId, &u, &v) normalises a world position. In the world view a WorldMapContinent row for the map id gives the position from its scale; otherwise the displayed row (the continent's child, its own row, or the direct area) must belong to that map id and gives u = 1 - (y - right) / (left - right) and v = 1 - (x - bottom) / (top - bottom), each 0 for a zero numerator or divisor, and both 0 if either leaves 0 to 1. GetPlayerMapPosition(unit) pushes u and v for the player or a group member, else 0 and 0. GetCorpseMapPosition() projects the cached corpse position under its display map id.

The derivation is in the doc.

Callers 8

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.