benilla-re systems structs docs

AttachEntityToGround

function · terrain · primitive

Address
0x6a8a20 · 487 bytes, up to 0x6a8c06
Signature
void __thiscall (void *this)
Meaning
Probes down from an entity against terrain and map objects, attaches it to the nearer and stores its ground id
Confidence
verified, proof one
Finding
terrain/mapentities#ground-id-outcomes
Test
terrain::cmapdoodaddef_ground_attach_difftest

Finding: Ground id outcomes in terrain: map entities

0x6a8a20 ends by storing a ground id at +0xdc of the entity, when [+8] & 0x20 is set. The id starts at −1. A map object hit gives the face's terrain type (0x6a26c0), which is 0 (Dirt) for a material that carries 0: only −1 is the silent value. It stays −1 when the winning group has no face the material trace accepts or the group is not loaded. A terrain hit gives the dominant layer's terrain type, and −1 when 0x69b1c0 fails. 0x6706d0 hands on every id but −1. A unit copies it to +0xc60: 0x5fa730 falls back to −1 with no entity or no id, 0x5fba95 keeps the old value on failure.

The derivation is in the doc.

Callers 1

Callees 8

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