mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Silently apply unchanged TES5 & FO4 sorted load orders
This fixes #562, in which plugins which weren't listed in loadorder.txt/plugins.txt were not having their inferred load order positions made explicit, which could cause confusion if another utility or the game inferred a different load order for them.
This commit is contained in:
@@ -912,6 +912,23 @@ namespace loot {
|
||||
PluginSorter sorter;
|
||||
list<Plugin> plugins = sorter.Sort(_lootState.CurrentGame(), _lootState.getLanguage().Code());
|
||||
|
||||
// If TESV or FO4, check if load order has been changed.
|
||||
if ((_lootState.CurrentGame().Id() == Game::tes5 || _lootState.CurrentGame().Id() == Game::fo4)
|
||||
&& equal(begin(plugins), end(plugins), begin(_lootState.CurrentGame().GetLoadOrder()))) {
|
||||
// Load order has not been changed, set it without asking for
|
||||
// user input because there are no changes to accept and some
|
||||
// plugins' positions may only be inferred and not written to
|
||||
// loadorder.txt/plugins.txt.
|
||||
std::list<std::string> newLoadOrder;
|
||||
std::transform(begin(plugins),
|
||||
end(plugins),
|
||||
back_inserter(newLoadOrder),
|
||||
[](const Plugin& plugin) {
|
||||
return plugin.Name();
|
||||
});
|
||||
_lootState.CurrentGame().SetLoadOrder(newLoadOrder);
|
||||
}
|
||||
|
||||
YAML::Node node;
|
||||
|
||||
// Store global messages in case they have changed.
|
||||
|
||||
Reference in New Issue
Block a user