diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 13:42:46 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 13:42:46 +0300 |
| commit | 12be4b4e75bf089dd4710c6a0bb6ba4c42bd4c66 (patch) | |
| tree | 829e53c28356eb2d002b277ca0b37a5c0e7e183f /crates/fparkan-runtime/src/boarding.rs | |
| parent | b201e339c804aba7b9ef023833b7aee4fab96d96 (diff) | |
| download | fparkan-12be4b4e75bf089dd4710c6a0bb6ba4c42bd4c66.tar.xz fparkan-12be4b4e75bf089dd4710c6a0bb6ba4c42bd4c66.zip | |
feat(player): drive boarded ground warbots with chassis limits
Check the stock Two Fortresses bunker exit, approach and boarding in the game window. Forward input uses the live cap and a chassis with a zero lateral cap holds its position on sideways input.
Diffstat (limited to 'crates/fparkan-runtime/src/boarding.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/boarding.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/boarding.rs b/crates/fparkan-runtime/src/boarding.rs index e2c4eeb0..7992aaf7 100644 --- a/crates/fparkan-runtime/src/boarding.rs +++ b/crates/fparkan-runtime/src/boarding.rs @@ -15,6 +15,7 @@ pub(super) struct Boarding { pub(super) cockpit: StartingCockpit, pub(super) hero: StartingCockpit, pub(super) can_fly: bool, + pub(super) ground: Option<crate::ground_support::GroundSupport>, } /// The vehicle cockpit while the player is aboard. @@ -115,6 +116,14 @@ pub fn board_friendly_warbot( return Ok(None); }; let can_fly = crate::player_motion::warbot_can_fly(engine, cockpit.object_index); + let ground = (!can_fly) + .then(|| { + crate::ground_support::GroundSupport::prepare( + &mission.mission_assets, + cockpit.object_index, + ) + }) + .flatten(); set_transform( &mut engine.world, hero.handle, @@ -128,6 +137,7 @@ pub fn board_friendly_warbot( cockpit, hero, can_fly, + ground, }); mission.player_pitch_bits = 0; } |
