aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-26 07:14:18 +0300
committerValentin Popov <valentin@popov.link>2026-11-26 07:14:18 +0300
commit00e8ddb1ca169e0bf38bde14eaa73969b9177d1a (patch)
tree0b36f51ce6a56c588135d1170eaa10be9210904c /crates/fparkan-runtime/src
parent161c3fad038c5fae15d49ba614bee37cbcdde6f6 (diff)
downloadfparkan-00e8ddb1ca169e0bf38bde14eaa73969b9177d1a.tar.xz
fparkan-00e8ddb1ca169e0bf38bde14eaa73969b9177d1a.zip
feat(audio): drive chassis engine loops from actual movement
Prepare the authored root-node CTL attachments and feed Control speed limits plus observed motion into FX modes 5 and 15. The stock AutoDemo window queues ground and flight engine loops from the starting scene.
Diffstat (limited to 'crates/fparkan-runtime/src')
-rw-r--r--crates/fparkan-runtime/src/lib.rs3
-rw-r--r--crates/fparkan-runtime/src/player_weapon.rs5
2 files changed, 5 insertions, 3 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs
index 4895135a..4efbc365 100644
--- a/crates/fparkan-runtime/src/lib.rs
+++ b/crates/fparkan-runtime/src/lib.rs
@@ -451,7 +451,7 @@ fn factory2_selected_fx_resources_are_representable<R: ResourceRepository>(
};
let selected_rows = rows
.iter()
- .filter(|row| Some(row.table_index) == control.initial_effect_group)
+ .filter(|row| row.opcode == 4 && Some(row.table_index) == control.initial_effect_group)
.collect::<Vec<_>>();
if selected_rows.len() != selected_opcode4_count {
return Ok(false);
@@ -8741,6 +8741,7 @@ mod tests {
PreparedControlEffectRow {
table_index,
row_index,
+ opcode: 4,
raw_condition: [0; 3],
point_offsets,
selector: 0,
diff --git a/crates/fparkan-runtime/src/player_weapon.rs b/crates/fparkan-runtime/src/player_weapon.rs
index 00ead0db..2ced63cd 100644
--- a/crates/fparkan-runtime/src/player_weapon.rs
+++ b/crates/fparkan-runtime/src/player_weapon.rs
@@ -345,7 +345,7 @@ fn firing_effect_row<'a>(
.find(|&&(table, node, _)| table == group && node as usize == muzzle.node_index)
{
rows.iter()
- .find(|row| row.table_index == group && row.selector == selector)
+ .find(|row| row.opcode == 4 && row.table_index == group && row.selector == selector)
} else {
// Separate gun meshes can have one firing record and an effect whose
// first control point is the same muzzle. Ambiguous rows stay unresolved.
@@ -359,7 +359,8 @@ fn firing_effect_row<'a>(
return None;
}
let mut candidates = rows.iter().filter(|row| {
- row.table_index == group
+ row.opcode == 4
+ && row.table_index == group
&& row.raw_condition == [0; 3]
&& row.point_offsets[0] == muzzle.raw_parameters[1]
});