From 99abb6bf77c259a1afb629f418f5aad64e20de75 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 19:40:24 +0400 Subject: fix(player): require working Control device for boarding --- crates/fparkan-runtime/src/boarding.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src/boarding.rs') diff --git a/crates/fparkan-runtime/src/boarding.rs b/crates/fparkan-runtime/src/boarding.rs index 257b81f7..ec786a21 100644 --- a/crates/fparkan-runtime/src/boarding.rs +++ b/crates/fparkan-runtime/src/boarding.rs @@ -1,5 +1,6 @@ use super::{ - component_cockpit, projectile::unit_sphere, starting_cockpit, Engine, EngineError, + component_cockpit, control_device_provider_value, projectile::unit_sphere, starting_cockpit, + Engine, EngineError, MissionControlDeviceTableState, MissionControlDeviceTableStatus, StartingCockpit, SurfaceQuery, TransformState, }; use fparkan_world::{ @@ -52,6 +53,13 @@ pub fn board_friendly_warbot(engine: &mut Engine) -> Result Result bool { + let MissionControlDeviceTableStatus::Available(devices) = &table.status else { + return false; + }; + devices + .iter() + .find(|device| device.descriptor.tag == 1) + .is_some_and(|device| { + control_device_provider_value(table, device).is_ok_and(|value| value > 0.0) + }) +} + /// Leaves the vehicle and restores the hero's cockpit. /// /// # Errors -- cgit v1.2.3