CMovement::ApplyStatusIfDue
function · collision · primitive
- Address
0x618c30· 613 bytes, up to0x618e94- 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:
| step | effect | at |
|---|---|---|
| 1 | a spline at +0xa4 forces the apply | 0x618c43 |
| 2 | flag bit 31 clear: +0xac = status stamp, +0xa8 = eventTime, set bit 31 | 0x618c54, 0x618c6a |
| 3 | eventTime before the update time: eventTime = update time | 0x618c81 |
| 4 | w = stamp − +0xac; w > 0 stores the stamp in +0xac, else w = 0 | 0x618cb6, 0x618cb8 |
| 5 | *skew = w − (eventTime − +0xa8) | 0x618ccf |
| 6 | m = 0x618b50(w, eventTime − +0xa8) | 0x618cd1 |
| 7 | forced: +0xa8 = eventTime + *skew, unclamped; apply | 0x618d67 |
| 8 | flags & 0x20ff = 0 and an empty queue: rebase (next entry) | 0x618ce4, 0x618cf3 |
| 9 | *skew = clamp(*skew, −500, 1000) | 0x618d49 |
| 10 | +0xa8 = eventTime + *skew | 0x618dcc |
| 11 | update time − +0xa8 ≥ 0: apply; else return 0 | 0x618dd2 |
The derivation is in the doc.
Callers 4
- CMovement::UpdateStatusWithPayload collision
- CMovement::UpdateStatus collision
- CMovement::UpdateFacingStatus collision
- CMovement::ApplyObjectUpdate collision
Callees 12
- CGUnit_C::OnMoverStepped objectlayer
- CGUnit_C::OnLand objectlayer
- HasMoveEvents collision
- RecycleMoveEventQueue collision
- CMovement::SetTransportFromStatus collision
- CMovement::RecordLateness collision
- CMovement::AdvanceLateStart collision
- MovementLogStub collision
- MovementGetGlobals collision
- CMovementData::CalcDirection collision
- CMovement::ReadStatusPosition collision
- CMovement::ReadStatusFall collision
Calls and jumps by a bare address, from tables/calls.tsv.