From 590c8f39b935f34fc6a4f9c033520c2c0359253d Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 1 Dec 2026 09:27:02 +0400 Subject: fix(ai): prepend base defence attacks to unit orders The native task dispatcher inserts mode 2 at index zero without replacing the old list. Keep the interrupted order and queued tail, then run the base-defence wait after assigning the group in the stock mission. --- crates/fparkan-runtime/src/clan_problem_conditions.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src/clan_problem_conditions.rs') diff --git a/crates/fparkan-runtime/src/clan_problem_conditions.rs b/crates/fparkan-runtime/src/clan_problem_conditions.rs index a7c2c298..a3de9635 100644 --- a/crates/fparkan-runtime/src/clan_problem_conditions.rs +++ b/crates/fparkan-runtime/src/clan_problem_conditions.rs @@ -36,7 +36,10 @@ impl Condition { Self::TaskInactive(unit) => !live(unit) || !task_active(unit), Self::GroupIdle => group.is_none_or(|group| { group.members.iter().all(|&unit| { - !live(unit) || patrol.is_none_or(|patrol| !patrol.is_patrolling(unit)) + !live(unit) + || patrol.is_none_or(|patrol| { + !patrol.is_patrolling(unit) && !patrol.is_leaving_factory(unit) + }) }) }), } -- cgit v1.2.3