Skip to content

Commit

Permalink
Make Skyrim's Update.esm implicitly active
Browse files Browse the repository at this point in the history
But not early-loading.
  • Loading branch information
Ortham committed Sep 25, 2023
1 parent 2191d69 commit 4c3073f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/game_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct GameSettings {
additional_plugins_directories: Vec<PathBuf>,
}

const SKYRIM_HARDCODED_PLUGINS: &[&str] = &["Skyrim.esm", "Update.esm"];
const SKYRIM_HARDCODED_PLUGINS: &[&str] = &["Skyrim.esm"];

const SKYRIM_SE_HARDCODED_PLUGINS: &[&str] = &[
"Skyrim.esm",
Expand Down Expand Up @@ -519,6 +519,10 @@ fn implicitly_active_plugins(
let nam_plugins = find_nam_plugins(&game_path.join("Data"))?;

plugin_names.extend(nam_plugins);
} else if game_id == GameId::Skyrim {
// Update.esm is always active, but loads after all other masters if it is not made to load
// earlier (e.g. by listing in plugins.txt or by being a master of another master).
plugin_names.push("Update.esm".to_string());
}

// Remove duplicates, keeping only the first instance of each plugin.
Expand Down Expand Up @@ -891,7 +895,7 @@ mod tests {
#[test]
fn early_loading_plugins_should_be_mapped_from_game_id() {
let mut settings = game_with_generic_paths(GameId::Skyrim);
let mut plugins = vec!["Skyrim.esm", "Update.esm"];
let mut plugins = vec!["Skyrim.esm"];
assert_eq!(plugins, settings.early_loading_plugins());

settings = game_with_generic_paths(GameId::SkyrimSE);
Expand Down Expand Up @@ -1096,6 +1100,14 @@ mod tests {
assert_eq!(expected_plugins, plugins);
}

#[test]
fn implicitly_active_plugins_should_include_update_esm_for_skyrim() {
let settings = game_with_generic_paths(GameId::Skyrim);
let plugins = settings.implicitly_active_plugins();

assert!(plugins.contains(&"Update.esm".to_string()));
}

#[test]
fn implicitly_active_plugins_should_include_plugins_with_nam_files_for_games_other_than_fallout_nv(
) {
Expand Down

0 comments on commit 4c3073f

Please sign in to comment.