mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Work on issue #112.
If two conflicting records had the same number of override form IDs, their order was dependent on the order in which they were in the graph, which is undefined, so I added a lexicographical comparison to resolve that. Testers reported that it didn't fix the issue though.
This commit is contained in:
+11
-2
@@ -224,10 +224,19 @@ namespace boss {
|
||||
continue;
|
||||
|
||||
vertex_t vertex, parentVertex;
|
||||
if (graph[*vit].NumOverrideFormIDs() >= graph[*vit2].NumOverrideFormIDs()) {
|
||||
if (graph[*vit].NumOverrideFormIDs() > graph[*vit2].NumOverrideFormIDs()) {
|
||||
parentVertex = *vit;
|
||||
vertex = *vit2;
|
||||
} else {
|
||||
}
|
||||
else if (graph[*vit].NumOverrideFormIDs() < graph[*vit2].NumOverrideFormIDs()) {
|
||||
parentVertex = *vit2;
|
||||
vertex = *vit;
|
||||
}
|
||||
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;
|
||||
}
|
||||
else {
|
||||
parentVertex = *vit2;
|
||||
vertex = *vit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user