diff options
Diffstat (limited to 'crates/fparkan-runtime/src/player_motion.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/player_motion.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/fparkan-runtime/src/player_motion.rs b/crates/fparkan-runtime/src/player_motion.rs index 525bc7b3..73129d87 100644 --- a/crates/fparkan-runtime/src/player_motion.rs +++ b/crates/fparkan-runtime/src/player_motion.rs @@ -27,7 +27,7 @@ pub(super) fn drowns(engine: &Engine, cockpit: StartingCockpit, step: PlayerMoti // shortcut: bound stair steps and drops until the native hero collider is wired. const STEP_UP: f32 = 0.85; const STEP_DOWN: f32 = 2.0; -const FLOOR_CLEARANCE: f32 = 0.02; +pub(super) const FLOOR_CLEARANCE: f32 = 0.02; const WATER_SURFACE: u32 = 0x0002_0000; // shortcut: sample the temporary floor probe at most 0.16 units apart until native collision is wired. const WALK_COLLISION_DISTANCE: f32 = 0.16; @@ -620,9 +620,14 @@ pub(super) fn commit_motion_state( mission.hero_look = look; } } - if let (Some(boarding), Some(velocity)) = (&mut mission.boarding, step.flight_velocity) { - if boarding.cockpit.handle == cockpit.handle { + if let Some(boarding) = &mut mission.boarding { + if boarding.cockpit.handle != cockpit.handle { + return; + } + if let Some(velocity) = step.flight_velocity { boarding.flight_velocity = if blocked { [0.0; 3] } else { velocity }; + } else if !blocked && step.sweep.is_some() { + boarding.on_building_floor = step.on_building_floor(); } } } |
