movement: track fallTime and jump fields in movement packets

Previously movementInfo.fallTime was always 0 and jumpVelocity/jumpSinAngle/
jumpCosAngle/jumpXYSpeed were never populated.  The server reads fallTime
unconditionally from every movement packet and uses it to compute fall damage
and anti-cheat heuristics; the jump fields are required when FALLING is set.

Changes:
- Add isFalling_ / fallStartMs_ to track fall state across packets
- MSG_MOVE_JUMP: set isFalling_=true, record fallStartMs_, populate jump fields
  (jumpVelocity=7.96, direction from facing angle, jumpXYSpeed from server
  run speed or walk speed when WALKING flag is set)
- MSG_MOVE_FALL_LAND: clear all fall/jump fields
- sendMovement: update movementInfo.fallTime = (time - fallStartMs_) each call
  so every heartbeat and position packet carries the correct elapsed fall time
- World entry: reset all fall/jump fields alongside the flag reset
This commit is contained in:
Kelsi 2026-03-10 12:36:56 -07:00
parent 70abb12398
commit 4cf73a6def
2 changed files with 53 additions and 0 deletions

View file

@ -1686,6 +1686,12 @@ private:
uint32_t lastMovementTimestampMs_ = 0;
bool serverMovementAllowed_ = true;
// Fall/jump tracking for movement packet correctness.
// fallTime must be the elapsed ms since the FALLING flag was set; the server
// uses it for fall-damage calculations and anti-cheat validation.
bool isFalling_ = false;
uint32_t fallStartMs_ = 0; // movementInfo.time value when FALLING started
// Inventory
Inventory inventory;