Don't treat any OpenMW plugin as a master

Master-flagged plugins are not forced to load before other plugins in OpenMW.
This commit is contained in:
Oliver Hamlet
2025-02-01 18:33:30 +00:00
parent d7f5455cd0
commit 7bf005118e
+11 -1
View File
@@ -127,7 +127,8 @@ fn evaluate_is_master(state: &State, file_path: &Path) -> Result<bool, Error> {
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"));