diff --git a/src/backend/graph.cpp b/src/backend/graph.cpp index c53bb1e8..c13b89e6 100644 --- a/src/backend/graph.cpp +++ b/src/backend/graph.cpp @@ -266,7 +266,6 @@ namespace loot { void AddOverlapEdges(PluginGraph& graph, const vertex_map_t& v_index_map) { loot::vertex_it vit, vitend; - // Add edges between plugins that conflict. for (boost::tie(vit, vitend) = boost::vertices(graph); vit != vitend; ++vit) { BOOST_LOG_TRIVIAL(trace) << "Adding overlap edges to vertex for \"" << graph[*vit].Name() << "\"."; @@ -291,7 +290,7 @@ namespace loot { parentVertex = *vit2; vertex = *vit; } - else if (boost::locale::to_lower(graph[*vit].Name()) < boost::locale::to_lower(graph[*vit2].Name())) { //There needs to be an edge between the two, but direction cannot be decided using overlap size. Just use names. + else if (graph[*vit].Name() < graph[*vit2].Name()) { //There needs to be an edge between the two, but direction cannot be decided using overlap size. Just use names. parentVertex = *vit; vertex = *vit2; } @@ -309,35 +308,6 @@ namespace loot { } } } - - // LOOT for Humans - add edges so that if nothing else, the plugins get sorted alphabetically. Meatbags find that appealing. - for (boost::tie(vit, vitend) = boost::vertices(graph); vit != vitend; ++vit) { - BOOST_LOG_TRIVIAL(trace) << "Adding lexicographical edges to vertex for \"" << graph[*vit].Name() << "\"."; - - loot::vertex_it vit2, vitend2; - for (boost::tie(vit2, vitend2) = boost::vertices(graph); vit2 != vitend2; ++vit2) { - if (vit == vit2 || boost::edge(*vit, *vit2, graph).second || boost::edge(*vit2, *vit, graph).second) - //Vertices are the same or are already linked. - continue; - - vertex_t vertex, parentVertex; - if (boost::locale::to_lower(graph[*vit].Name()) < boost::locale::to_lower(graph[*vit2].Name())) { - parentVertex = *vit; - vertex = *vit2; - } - else { - parentVertex = *vit2; - vertex = *vit; - } - - //BOOST_LOG_TRIVIAL(trace) << "Checking edge validity between \"" << graph[*vit].Name() << "\" and \"" << graph[*vit2].Name() << "\"."; - if (!EdgeCreatesCycle(parentVertex, vertex, graph, v_index_map)) { //No edge going the other way, OK to add this edge. - BOOST_LOG_TRIVIAL(trace) << "Adding edge from \"" << graph[parentVertex].Name() << "\" to \"" << graph[vertex].Name() << "\"."; - - boost::add_edge(parentVertex, vertex, graph); - } - } - } } std::list Sort(PluginGraph& graph) { diff --git a/src/tests/api/api.h b/src/tests/api/api.h index 93f81d03..e77b07f9 100644 --- a/src/tests/api/api.h +++ b/src/tests/api/api.h @@ -402,6 +402,9 @@ TEST_F(SkyrimAPIOperationsTest, SortPlugins) { "Blank - Different Plugin Dependent.esp", "Blank - Master Dependent.esp", "Blank - Plugin Dependent.esp", + "Blank - Different Master Dependent.esp", + "Blank - Different.esp", + "Blank - Different Plugin Dependent.esp" }; std::list actualOrder; for (size_t i = 0; i < numPlugins; ++i) {