aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-14 22:44:04 +0300
committerValentin Popov <valentin@popov.link>2026-11-14 22:44:04 +0300
commitd43524a8e40bb923d9275e17d3dc586701f08bbf (patch)
treecf60379bbb567ebb31d2089d39c23ae42af3f2eb /crates/fparkan-runtime/src/lib.rs
parent947be441148cea94b2a847268b885cc20d36b2aa (diff)
downloadfparkan-d43524a8e40bb923d9275e17d3dc586701f08bbf.tar.xz
fparkan-d43524a8e40bb923d9275e17d3dc586701f08bbf.zip
feat(ai): build the clan transport from the AI catalog
Let a scripted transport order survive a busy factory and use the unique eligible design from the clan technology table. The AI reserves its transport independently of the player scheme list. Two Fortresses released sml_cargo.dat from the stock start in the FParkan window and the licensed regression covers both factories. The x86 DLL chooser confirmed class, readiness, and fastest selection. Transport routes and live timing parity remain open.
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
-rw-r--r--crates/fparkan-runtime/src/lib.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs
index 6f2f6439..d93a5e5a 100644
--- a/crates/fparkan-runtime/src/lib.rs
+++ b/crates/fparkan-runtime/src/lib.rs
@@ -50,6 +50,7 @@ mod clan_combat_strength;
mod clan_problem_conditions;
mod clan_script_init;
mod clan_targeting;
+mod clan_transport_schemes;
mod mesh_collision;
mod mining;
mod mission_events;
@@ -1879,7 +1880,7 @@ fn load_mission_with_options(
} else {
Arc::from(&[][..])
};
- let build_schemes = if let Some(scheme) = build_scheme {
+ let mut build_schemes = if let Some(scheme) = build_scheme {
vec![scheme.clone()]
} else if options.start_autodemo && request.mode == MissionMode::SingleMission {
production::mission_prebuilds(&config)?
@@ -1933,6 +1934,18 @@ fn load_mission_with_options(
}
})?;
let mut loaded_scripts = load_mission_scripts(&vfs, &mission, options.asset_scope)?;
+ let player_scheme_count = build_schemes.len();
+ let transport_schemes = if options.start_autodemo && request.mode == MissionMode::SingleMission
+ {
+ clan_transport_schemes::available(vfs.as_ref(), &mission, &loaded_scripts.bundles)
+ } else {
+ Vec::new()
+ };
+ for (_, path) in &transport_schemes {
+ if !build_schemes.contains(path) {
+ build_schemes.push(path.clone());
+ }
+ }
let research_trf_tables = if options.asset_scope == MissionAssetScope::Full
&& startup_input.is_some_and(|input| input.research_creation_gate)
{
@@ -2649,6 +2662,8 @@ fn load_mission_with_options(
Some(production::Production::new(
reserve_start,
build_schemes,
+ player_scheme_count,
+ transport_schemes,
reserve_controls,
&object_drafts[..mine_reserve_start],
)?),