From 7bf005118e54dc3fa207496d65b7e569a6b27eb2 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 1 Feb 2025 18:31:45 +0000 Subject: [PATCH] Don't treat any OpenMW plugin as a master Master-flagged plugins are not forced to load before other plugins in OpenMW. --- src/function/eval.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/function/eval.rs b/src/function/eval.rs index e2bc1f4..6472303 100644 --- a/src/function/eval.rs +++ b/src/function/eval.rs @@ -127,7 +127,8 @@ fn evaluate_is_master(state: &State, file_path: &Path) -> Result { use esplugin::GameId; let game_id = match state.game_type { - GameType::Morrowind | GameType::OpenMW => GameId::Morrowind, + GameType::OpenMW => return Ok(false), + GameType::Morrowind => GameId::Morrowind, GameType::Oblivion => GameId::Oblivion, GameType::Skyrim => GameId::Skyrim, GameType::SkyrimSE | GameType::SkyrimVR => GameId::SkyrimSE, @@ -746,6 +747,15 @@ mod tests { assert!(function.eval(&state).unwrap()); } + #[test] + fn function_is_master_eval_should_be_false_if_the_path_is_an_openmw_master_flagged_plugin() { + let function = Function::IsMaster(PathBuf::from("Blank.esm")); + let mut state = state("tests/testing-plugins/Morrowind/Data Files"); + state.game_type = GameType::OpenMW; + + assert!(!function.eval(&state).unwrap()); + } + #[test] fn function_is_master_eval_should_be_false_if_the_path_does_not_exist() { let function = Function::IsMaster(PathBuf::from("missing.esp"));