benilla-re systems structs docs

GetUnitMapPosition

function · ui · orchestration

Address
0x4a7870 · 233 bytes, up to 0x4a7958
Meaning
Returns a unit's normalised map position from its object or its group record
Confidence
verified, proof one
Finding
ui/worldmap#unit-and-corpse-positions

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 2

Callees 4

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