From c38fb66d2b2dfed3a7eb748914a3e2d9f9871768 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 20:50:32 +0400 Subject: 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. --- crates/fparkan-runtime/src/lib.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'crates/fparkan-runtime/src/lib.rs') 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; -- cgit v1.2.3