aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/clan_problem_conditions.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-01 08:27:02 +0300
committerValentin Popov <valentin@popov.link>2026-12-01 08:27:02 +0300
commit590c8f39b935f34fc6a4f9c033520c2c0359253d (patch)
treea21ce927fa1593f8931c90bf38c33cc9bf60cccf /crates/fparkan-runtime/src/clan_problem_conditions.rs
parent8dcaf3d7e5be5ddb8bae3cd9ced3032875c861ae (diff)
downloadfparkan-590c8f39b935f34fc6a4f9c033520c2c0359253d.tar.xz
fparkan-590c8f39b935f34fc6a4f9c033520c2c0359253d.zip
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.
Diffstat (limited to 'crates/fparkan-runtime/src/clan_problem_conditions.rs')
-rw-r--r--crates/fparkan-runtime/src/clan_problem_conditions.rs5
1 files changed, 4 insertions, 1 deletions
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)
+ })
})
}),
}