From 98569dc5e8ee01b19ee82852a807f6a2b911dae4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 14:59:29 +0400 Subject: feat(ui): watch a warbot on autopilot from its cockpit --- apps/fparkan-game/src/player_fire.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'apps/fparkan-game/src/player_fire.rs') diff --git a/apps/fparkan-game/src/player_fire.rs b/apps/fparkan-game/src/player_fire.rs index 1a0a0788..96123e2d 100644 --- a/apps/fparkan-game/src/player_fire.rs +++ b/apps/fparkan-game/src/player_fire.rs @@ -4,15 +4,16 @@ use super::{ }; use fparkan_runtime::{ - loaded_mission_assets, projectile_sight_target, remote_auto_gunner_weapons, - turret_sight_points, FiringEffectInstance, PlayerWeaponWarning, PlayerWeapons, + loaded_mission_assets, projectile_sight_target, remote_warbot_control, turret_sight_points, + FiringEffectInstance, PlayerWeaponWarning, RemoteWarbotControl, }; impl StaticVulkanApp { - pub(super) fn auto_gunner_weapons(&self) -> Option<&PlayerWeapons> { + pub(super) fn uses_automatic_weapons(&self) -> bool { self.mission_engine .as_ref() - .and_then(remote_auto_gunner_weapons) + .and_then(remote_warbot_control) + .is_some_and(|mode| mode != RemoteWarbotControl::Manual) } pub(super) fn sample_player_fire( @@ -27,7 +28,7 @@ impl StaticVulkanApp { let Some(cockpit) = self.cockpit else { return (Vec::new(), Vec::new()); }; - if self.auto_gunner_weapons().is_some() + if self.uses_automatic_weapons() || self.mission_frame.is_none() || !self .player_weapon_layouts -- cgit v1.2.3