From 7dd027fd5130daf532cd2214a6d9689293bb2c86 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 13:07:11 +0400 Subject: feat(ui): assign search and destroy from the warbot panel Show the native search status immediately without opening the map. Verify from the stock Two Fortresses start that the selected marker moves with the internal route hidden and that Stand cancels the search. --- crates/fparkan-runtime/src/unit_combat.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/fparkan-runtime/src/unit_combat.rs') diff --git a/crates/fparkan-runtime/src/unit_combat.rs b/crates/fparkan-runtime/src/unit_combat.rs index f46b46bf..59c9ec64 100644 --- a/crates/fparkan-runtime/src/unit_combat.rs +++ b/crates/fparkan-runtime/src/unit_combat.rs @@ -460,6 +460,9 @@ impl AutoDemoCombat { return None; } let idle_clock = fire_clock_ms.filter(|_| unit.uses_default_targeting(patrol)); + let search = patrol + .filter(|_| !use_weapon_range) + .and_then(|patrol| patrol.search_target(handle)); let search_distance = if use_weapon_range && idle_clock.is_none() { self.maximum_firing_distance(unit) } else { @@ -470,6 +473,7 @@ impl AutoDemoCombat { .filter_map(|&(enemy, other, to, radius, target_position)| { let enemy = enemy.handle; if enemy == handle + || search.is_some_and(|target| target != Some(enemy)) || limit .is_some_and(|limit| !limit.allows_target(enemy, target_position)) || self.hostile.get(clan)?.get(other) != Some(&true) -- cgit v1.2.3