diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 18:48:15 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 18:48:15 +0300 |
| commit | 55c4aa3ad801b0599fab9e4f669898d02f38c627 (patch) | |
| tree | 1bf0ee4ee308406142815f2e8f738914b1b7e540 /crates/fparkan-runtime/src/boarding.rs | |
| parent | 99abb6bf77c259a1afb629f418f5aad64e20de75 (diff) | |
| download | fparkan-55c4aa3ad801b0599fab9e4f669898d02f38c627.tar.xz fparkan-55c4aa3ad801b0599fab9e4f669898d02f38c627.zip | |
fix(player): read flight capability from chassis profile
Diffstat (limited to 'crates/fparkan-runtime/src/boarding.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/boarding.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/fparkan-runtime/src/boarding.rs b/crates/fparkan-runtime/src/boarding.rs index ec786a21..9a1479f8 100644 --- a/crates/fparkan-runtime/src/boarding.rs +++ b/crates/fparkan-runtime/src/boarding.rs @@ -13,6 +13,7 @@ pub(super) const WARBOT_CLASS: u32 = 0x0100_8000; pub(super) struct Boarding { pub(super) cockpit: StartingCockpit, pub(super) hero: StartingCockpit, + pub(super) can_fly: bool, } /// The vehicle cockpit while the player is aboard. @@ -83,6 +84,7 @@ pub fn board_friendly_warbot(engine: &mut Engine) -> Result<Option<StartingCockp let Some((_, cockpit, position)) = candidate else { return Ok(None); }; + let can_fly = crate::player_motion::warbot_can_fly(engine, cockpit.object_index); set_transform( &mut engine.world, hero.handle, @@ -92,7 +94,11 @@ pub fn board_friendly_warbot(engine: &mut Engine) -> Result<Option<StartingCockp }, )?; if let Some(mission) = &mut engine.loaded { - mission.boarding = Some(Boarding { cockpit, hero }); + mission.boarding = Some(Boarding { + cockpit, + hero, + can_fly, + }); mission.player_pitch_bits = 0; } Ok(Some(cockpit)) @@ -122,6 +128,7 @@ pub fn disembark_warbot(engine: &mut Engine) -> Result<Option<StartingCockpit>, let Some(Boarding { cockpit: vehicle, hero, + .. }) = mission.boarding else { return Ok(None); |
