diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 19:50:32 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 19:50:32 +0300 |
| commit | c38fb66d2b2dfed3a7eb748914a3e2d9f9871768 (patch) | |
| tree | cdd717b14f6fc42847a11f536b452e0ff8eec075 /crates/fparkan-runtime/src/clan_script_init.rs | |
| parent | 0e8d4df52cb11185cc9962f5cab0077246605a8b (diff) | |
| download | fparkan-c38fb66d2b2dfed3a7eb748914a3e2d9f9871768.tar.xz fparkan-c38fb66d2b2dfed3a7eb748914a3e2d9f9871768.zip | |
feat(ai): queue scenario move orders for mobile units
Runs the stock order sequence in mission 16. Both mobile headquarters receive five destinations in script order. Movement uses existing terrain routing until the native Go task is wired.
Diffstat (limited to 'crates/fparkan-runtime/src/clan_script_init.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/clan_script_init.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/clan_script_init.rs b/crates/fparkan-runtime/src/clan_script_init.rs index 891cc5a3..ee205baa 100644 --- a/crates/fparkan-runtime/src/clan_script_init.rs +++ b/crates/fparkan-runtime/src/clan_script_init.rs @@ -5,6 +5,11 @@ use fparkan_script::{ pub(super) enum InitOrder { Patrol(ScriptPatrol), + Move { + id: u32, + destination: [u32; 2], + append: bool, + }, Shutdown(u32), Reserve { clan: usize, @@ -41,6 +46,15 @@ pub(super) fn unit_order( let order = declarations .resolve_handler15_with_values(instruction, values) .ok()?; + if let (2, insertion @ (1 | 3), Handler15TargetPayload::ByPlace { first, second }) = + (order.word_1, order.word_2, order.target) + { + return Some(InitOrder::Move { + id: order.word_0, + destination: [first, second], + append: insertion == 1, + }); + } if matches!( (order.word_1, order.word_2, order.target), (0x13, 3, Handler15TargetPayload::None) |
