diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 13:38:56 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 13:38:56 +0300 |
| commit | 05da53f0344416a5f14211a73f1f48d72c88b954 (patch) | |
| tree | d27d22f56a1bd185447b27223c79c9f97f7cc165 /apps/fparkan-game/src/player_fire.rs | |
| parent | 787279a1f514fbbaf09ca9dd6e5015bdce36635b (diff) | |
| download | fparkan-05da53f0344416a5f14211a73f1f48d72c88b954.tar.xz fparkan-05da53f0344416a5f14211a73f1f48d72c88b954.zip | |
feat(ui): drive a strategic warbot with an automatic gunner
Diffstat (limited to 'apps/fparkan-game/src/player_fire.rs')
| -rw-r--r-- | apps/fparkan-game/src/player_fire.rs | 13 |
1 files changed, 10 insertions, 3 deletions
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) |
