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:
Oliver Hamlet
2016-04-29 08:25:14 +01:00
parent 0a544bb99c
commit 8fe5ef5561
+17
View File
@@ -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.