benilla-re systems structs docs

CMovement::ApplyStatusIfDue

function · collision · primitive

Address
0x618c30 · 613 bytes, up to 0x618e94
Signature
uint32_t __thiscall (CMovement *this, uint32_t eventTime, const void *status, int32_t *skew, uint32_t keepFall, uint32_t force)
Meaning
Gives a status a fire time on the replay clock and applies it when due, returning 1, else 0
Confidence
verified, proof one
Finding
collision/status#status-fire-time

Finding: Status fire time in collision: status

0x618c30 gives a status a fire time on the mover's replay clock and returns 1 when it applied the status, 0 when the caller must queue it at eventTime + *skew. The arithmetic is 32-bit two's complement in client milliseconds; the update time is the movement globals' +0x128. Steps, in order:

stepeffectat
1a spline at +0xa4 forces the apply0x618c43
2flag bit 31 clear: +0xac = status stamp, +0xa8 = eventTime, set bit 310x618c54, 0x618c6a
3eventTime before the update time: eventTime = update time0x618c81
4w = stamp − +0xac; w > 0 stores the stamp in +0xac, else w = 00x618cb6, 0x618cb8
5*skew = w − (eventTime − +0xa8)0x618ccf
6m = 0x618b50(w, eventTime − +0xa8)0x618cd1
7forced: +0xa8 = eventTime + *skew, unclamped; apply0x618d67
8flags & 0x20ff = 0 and an empty queue: rebase (next entry)0x618ce4, 0x618cf3
9*skew = clamp(*skew, −500, 1000)0x618d49
10+0xa8 = eventTime + *skew0x618dcc
11update time − +0xa8 ≥ 0: apply; else return 00x618dd2

The derivation is in the doc.

Callers 4

Callees 12

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