diff options
Diffstat (limited to 'crates/fparkan-runtime/src/player_motion.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/player_motion.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/fparkan-runtime/src/player_motion.rs b/crates/fparkan-runtime/src/player_motion.rs index 73129d87..be910936 100644 --- a/crates/fparkan-runtime/src/player_motion.rs +++ b/crates/fparkan-runtime/src/player_motion.rs @@ -429,7 +429,16 @@ fn plan_player_steps( let boarded = mission .boarding .filter(|boarding| boarding.cockpit.handle == cockpit.handle); - let flight = boarded.filter(|boarding| boarding.can_fly).map(|boarding| { + let driving = boarded.filter(|boarding| boarding.controls_chassis()); + if boarded.is_some() && driving.is_none() { + input.movement = [0.0; 2]; + input.climb = 0.0; + if !input.look_around { + input.mouse_x = 0.0; + input.mouse_y = 0.0; + } + } + let flight = driving.filter(|boarding| boarding.can_fly).map(|boarding| { let profile = mission .control_device_tables .iter() @@ -443,7 +452,7 @@ fn plan_player_steps( } }); let flying = flight.is_some(); - let chassis_ground = boarded.and_then(|boarding| boarding.ground); + let chassis_ground = driving.and_then(|boarding| boarding.ground); let hero_profile = if mission.local_hero == Some(cockpit.handle) { mission .control_device_tables |
