diff --git a/src/function/eval.rs b/src/function/eval.rs index e1b0386..8d71e98 100644 --- a/src/function/eval.rs +++ b/src/function/eval.rs @@ -128,8 +128,7 @@ fn parse_plugin(state: &State, file_path: &Path) -> Option { use esplugin::GameId; let game_id = match state.game_type { - GameType::OpenMW => return None, - GameType::Morrowind => GameId::Morrowind, + GameType::Morrowind | GameType::OpenMW => GameId::Morrowind, GameType::Oblivion => GameId::Oblivion, GameType::Skyrim => GameId::Skyrim, GameType::SkyrimSE | GameType::SkyrimVR => GameId::SkyrimSE, @@ -150,7 +149,11 @@ fn parse_plugin(state: &State, file_path: &Path) -> Option { } fn evaluate_is_master(state: &State, file_path: &Path) -> bool { - parse_plugin(state, file_path).is_some_and(|plugin| plugin.is_master_file()) + if state.game_type == GameType::OpenMW { + false + } else { + parse_plugin(state, file_path).is_some_and(|plugin| plugin.is_master_file()) + } } #[expect(clippy::iter_over_hash_type)] @@ -526,6 +529,16 @@ mod tests { ); } + #[test] + fn parse_plugin_should_parse_openmw_plugins() { + let mut state = state(Path::new("./tests/testing-plugins/Morrowind/Data Files")); + state.game_type = GameType::OpenMW; + + let plugin = parse_plugin(&state, Path::new("Blank.esp")); + + assert!(plugin.is_some()); + } + #[test] fn function_file_path_eval_should_return_true_if_the_file_exists_relative_to_the_data_path() { let function = Function::FilePath(PathBuf::from("Cargo.toml"));