aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/clan_combat_groups.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-runtime/src/clan_combat_groups.rs')
-rw-r--r--crates/fparkan-runtime/src/clan_combat_groups.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/fparkan-runtime/src/clan_combat_groups.rs b/crates/fparkan-runtime/src/clan_combat_groups.rs
index 71d8a2a5..50c86e16 100644
--- a/crates/fparkan-runtime/src/clan_combat_groups.rs
+++ b/crates/fparkan-runtime/src/clan_combat_groups.rs
@@ -147,11 +147,12 @@ impl CombatGroup {
drafts: &[MissionObjectDraft],
order: Handler15Invocation,
) -> Result<(), String> {
- let (0, kind @ (3 | 4), 3) = (order.word_0, order.word_1, order.word_2) else {
+ let kind = order.word_1;
+ if order.word_0 != 0 || !matches!((kind, order.word_2), (3, 2 | 3) | (4, 3)) {
return Err(
- "Handler(28) requires a replacing patrol or attack order on group 0".into(),
+ "Handler(28) requires a supported patrol or attack order on group 0".into(),
);
- };
+ }
let target = GroupTarget::resolve(world, mission, order.target)
.ok_or("Handler(28) target is unavailable")?;
for &unit in &self.members {
@@ -186,7 +187,11 @@ impl CombatGroup {
};
for &unit in &self.members {
if let Some((handle, index)) = attack {
- patrol.set_attack_target(world, unit, handle, index, point);
+ if order.word_2 == 2 {
+ patrol.prepend_attack(world, unit, handle, index);
+ } else {
+ patrol.set_attack_target(world, unit, handle, index, point);
+ }
} else {
let radius = match order.word_3 {
0 | u32::MAX => 60.0,