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/lib.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/lib.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/lib.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index 04aa8858..3a7290f9 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -2446,6 +2446,7 @@ fn load_mission_with_options( matches!( order, clan_script_init::InitOrder::Patrol(_) + | clan_script_init::InitOrder::Move { .. } | clan_script_init::InitOrder::Shutdown(_) ) }) || loaded_scripts @@ -2540,6 +2541,30 @@ fn load_mission_with_options( clan_script_init::InitOrder::Reserve { clan, id, reserved } => { mission_events.set_reservation(&mission, &new_runtime_world, clan, id, reserved); } + clan_script_init::InitOrder::Move { + id, + destination, + append, + } => { + let Some(patrol) = &mut unit_patrol else { + continue; + }; + if let Some(handle) = script_patrol::unit_by_logic_id( + &mission, + &object_drafts, + &new_runtime_world, + id, + |class| class & autodemo::MOBILE_UNIT != 0 && class != HERO_UNIT_CLASS, + ) { + patrol.move_to( + &new_runtime_world, + handle, + destination.map(|axis| axis as f32), + append, + ); + eprintln!("sim_coverage script_move_approx=1 unit={} id={id} destination={destination:?} append={append}", handle.slot); + } + } clan_script_init::InitOrder::Shutdown(id) => { let Some(patrol) = &mut unit_patrol else { continue; |
