From 6c603976d4e368708935ab80e152b495a5c5e47a Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sun, 1 Nov 2026 08:41:00 +0400 Subject: chore(render): report unexpanded ambient effects --- crates/fparkan-fx/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'crates') diff --git a/crates/fparkan-fx/src/lib.rs b/crates/fparkan-fx/src/lib.rs index af7408a..8a567de 100644 --- a/crates/fparkan-fx/src/lib.rs +++ b/crates/fparkan-fx/src/lib.rs @@ -67,6 +67,12 @@ pub struct FxHeader { pub scale: [f32; 3], } +/// Effect.dll RVA 0x5C60 reads an owner/provider for modes 4 through 17, including mode 14. +#[must_use] +pub const fn fx_time_mode_requires_owner_state(mode: u32) -> bool { + matches!(mode, 4..=17) +} + /// FX opcode. #[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)] pub enum FxOpcode { @@ -623,6 +629,16 @@ mod tests { use std::collections::BTreeMap; use std::path::{Path, PathBuf}; + #[test] + fn phase_sources_distinguish_elapsed_damage_and_progress_modes() { + for mode in [0, 1, 2, 3, 18, u32::MAX] { + assert!(!fx_time_mode_requires_owner_state(mode)); + } + for mode in [4, 5, 9, 13, 14, 15, 16, 17] { + assert!(fx_time_mode_requires_owner_state(mode)); + } + } + #[test] fn decodes_synthetic_opcodes_and_refs() { let mut bytes = header(2); -- cgit v1.2.3