physics: send MSG_MOVE_START/STOP_ASCEND and START_DESCEND during flight

When flyingActive_, detect Space/X key transitions and emit proper flight
vertical movement opcodes so the server (and other players) see the
correct ascending/descending animation state:

- MSG_MOVE_START_ASCEND  (Space pressed while flying)  → sets ASCENDING flag
- MSG_MOVE_STOP_ASCEND   (Space released while flying) → clears ASCENDING flag
- MSG_MOVE_START_DESCEND (X pressed while flying)      → clears ASCENDING flag
- MSG_MOVE_STOP_ASCEND   (X released while flying)     → clears vertical state

Track wasAscending_/wasDescending_ member state to detect transitions.
Also clear lingering vertical state when leaving flight mode.
This commit is contained in:
Kelsi 2026-03-10 14:32:30 -07:00
parent a9ddfe70c2
commit 132598fc88
3 changed files with 43 additions and 0 deletions

View file

@ -256,6 +256,8 @@ private:
bool wasTurningRight = false;
bool wasJumping = false;
bool wasFalling = false;
bool wasAscending_ = false; // Space held while flyingActive_
bool wasDescending_ = false; // X held while flyingActive_
bool moveForwardActive = false;
bool moveBackwardActive = false;
bool strafeLeftActive = false;