benilla-re systems structs docs

CreateWorldCallbackObject

function · terrain · primitive

Address
0x670db0 · 599 bytes, up to 0x671006
Signature
MapEntity * __fastcall (CM2Model *model, void *callback, void *callbackArg, uint64_t guid, uint32_t extra, uint32_t flags)
Meaning
Takes a map entity node, stores the model at +0x88 and installs 0x672a20 on a nonzero model
Confidence
verified, proof one
Finding
terrain/lights#unit-model-light-callback
Test
terrain::create_doodad_color_difftest, terrain::create_entity_node_difftest

Finding: Unit model light callback in terrain: map lights

0x670db0 stores the model it is handed at +0x88 with a reference and installs 0x672a20 with the node only on a nonzero model; 0x613e10 hands it the mount +0xdc, else the body +0xd8. The callback on a unit's or player's model:

eventcallback
create or reactivate (0x613e10) with a modelinstalled (0x670fda)
body set with no mount (0x613cf0), mount set or cleared (0x613d80), with a nodeold model cleared (0x671704), new installed (0x671726)
each frame in the entity draw list (0x683dd0)installed again (0x683e74)
node destroyedcleared (0x69d78c, 0x69f13a)
mounted (0x607a00)moved from the body to the mount (0x613df9)

A mount has no node of its own: mounting moves the unit's node onto it. The mount is created with flags 0, so the body parented to it builds no record and draws with the mount's (models Instance lighting): the rider commits nothing itself and is lit by the unit's +0xa4.

The derivation is in the doc.

Callers 2

Callees 4

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