aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/clan_script_init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-runtime/src/clan_script_init.rs')
-rw-r--r--crates/fparkan-runtime/src/clan_script_init.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/clan_script_init.rs b/crates/fparkan-runtime/src/clan_script_init.rs
index a827df14..891cc5a3 100644
--- a/crates/fparkan-runtime/src/clan_script_init.rs
+++ b/crates/fparkan-runtime/src/clan_script_init.rs
@@ -66,6 +66,12 @@ pub(super) fn stubbed_handler(
{
Some(68)
}
+ // shortcut: resume Init until the AI consumer of this setting is wired.
+ ([69, u32::MAX, u32::MAX, u32::MAX, 6, 1, u32::MAX], [index])
+ if matches!(values.get(*index as usize), Some(VarSetDefault::Dword(_))) =>
+ {
+ Some(69)
+ }
_ => None,
}
}
@@ -102,6 +108,22 @@ mod tests {
}
#[test]
+ fn ai_setting_stub_requires_a_dword_operand_and_no_result() {
+ let mut instruction = ScriptInstruction {
+ header_words: [69, u32::MAX, u32::MAX, u32::MAX, 6, 1, u32::MAX],
+ references: vec![0],
+ };
+ let values = [VarSetDefault::Dword(15)];
+ assert_eq!(stubbed_handler(&instruction, &values), Some(69));
+ assert_eq!(
+ stubbed_handler(&instruction, &[VarSetDefault::FloatBits(0)]),
+ None
+ );
+ instruction.header_words[1] = 0;
+ assert_eq!(stubbed_handler(&instruction, &values), None);
+ }
+
+ #[test]
fn reservation_reads_logical_id_and_treats_every_nonzero_flag_as_set() {
let instruction = ScriptInstruction {
header_words: [51, u32::MAX, u32::MAX, u32::MAX, 6, 2, u32::MAX],