From 05da53f0344416a5f14211a73f1f48d72c88b954 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 14:38:56 +0400 Subject: feat(ui): drive a strategic warbot with an automatic gunner --- apps/fparkan-game/src/player_fire.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 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 aa861fc5..1a0a0788 100644 --- a/apps/fparkan-game/src/player_fire.rs +++ b/apps/fparkan-game/src/player_fire.rs @@ -4,11 +4,17 @@ use super::{ }; use fparkan_runtime::{ - loaded_mission_assets, projectile_sight_target, turret_sight_points, FiringEffectInstance, - PlayerWeaponWarning, + loaded_mission_assets, projectile_sight_target, remote_auto_gunner_weapons, + turret_sight_points, FiringEffectInstance, PlayerWeaponWarning, PlayerWeapons, }; impl StaticVulkanApp { + pub(super) fn auto_gunner_weapons(&self) -> Option<&PlayerWeapons> { + self.mission_engine + .as_ref() + .and_then(remote_auto_gunner_weapons) + } + pub(super) fn sample_player_fire( &mut self, clock_ms: u32, @@ -21,7 +27,8 @@ impl StaticVulkanApp { let Some(cockpit) = self.cockpit else { return (Vec::new(), Vec::new()); }; - if self.mission_frame.is_none() + if self.auto_gunner_weapons().is_some() + || self.mission_frame.is_none() || !self .player_weapon_layouts .contains_key(&cockpit.object_index) -- cgit v1.2.3