diff --git a/docs/LOOT Metadata Syntax.html b/docs/LOOT Metadata Syntax.html
index 60daf070..0a069f4c 100644
--- a/docs/LOOT Metadata Syntax.html
+++ b/docs/LOOT Metadata Syntax.html
@@ -297,7 +297,13 @@ nav: 0
name | string | ✓ | Can be an exact plugin filename or a regular expression plugin filename. If the period that precedes the file extension has been escaped (eg. \.esp, \.esm), the string is treated as a regular expression, otherwise it is treated as an exact filename.
|
enabled | boolean | ✗ | Enables or disables use of the plugin object. Used for user rules, but no reason to use it in the masterlist. If unspecified, defaults to true.
- |
priority | integer | ✗ | Modifies plugin position relative to others that change one or more of the same records, but which are otherwise unrelated (ie. neither plugin lists the other as a master, requirement, or in its after list). An exception is made for plugins that contain only a header record: these plugins have their priorities compared against all unrelated plugins. A plugin with a higher priority value will load after a plugin with a lower priority value. Value can be anything in the range -2000000000 to 2000000000, and if unspecified defaults to 0.
+ |
priority | integer | ✗ | Modifies plugin position relative to others that change one or more of the same records, but which are otherwise unrelated (ie. neither plugin lists the other as a master, requirement, or in its after list). Plugins that don't change any of the same records are not compared, unless:
+
+ - One of the plugins is a "dummy" plugin, containing only a header record.
+
- One of the plugins has a priority greater than or equal to 1,000,000. In this case, only the modulo (ie. remainder when divided) with 1,000,000 is used when comparing plugin priority values &endash; the rest is only used to signify that the plugin should be compared against all others.
+
+ For example, priority: 153000352 and priority: 352 have equal values when compared, but a plugin with the first priority will be compared against all others, while a (non-dummy) plugin with the second priority will be compared against only those it conflicts with.
+ A plugin with a higher priority value will load after a plugin with a lower priority value. Value can be anything in the range -2000000000 to 2000000000, and if unspecified defaults to 0.
|
after | file list | ✗ | An unordered list of plugins that this plugin must load after, but which are not dependencies. Used for resolving specific compatibility issues and by user rules for specifying custom plugin positions.
|
req | file list | ✗ | An unordered list of files that this plugin requires to be present. This plugin will load after any plugins listed. If any of these files are missing, an error message will be displayed. Intended for use specifying implicit dependencies, as LOOT will detect a plugin's explicit masters itself.
|
inc | file list | ✗ | An unordered list of files that this plugin is incompatible with. If any of these files are present, an error message will be displayed.
diff --git a/src/backend/graph.cpp b/src/backend/graph.cpp
index 87e77005..40cf9ff7 100644
--- a/src/backend/graph.cpp
+++ b/src/backend/graph.cpp
@@ -188,14 +188,30 @@ namespace loot {
loot::vertex_it vit2, vitend2;
for (boost::tie(vit2, vitend2) = boost::vertices(graph); vit2 != vitend2; ++vit2) {
- if (graph[*vit].Priority() == graph[*vit2].Priority() || (!graph[*vit].FormIDs().empty() && !graph[*vit2].FormIDs().empty() && !graph[*vit].DoFormIDsOverlap(graph[*vit2]))) {
+ if (graph[*vit].Priority() == graph[*vit2].Priority()
+ || (graph[*vit].Priority() < 1000000 && graph[*vit2].Priority() < 1000000
+ && !graph[*vit].FormIDs().empty() && !graph[*vit2].FormIDs().empty() && !graph[*vit].DoFormIDsOverlap(graph[*vit2])
+ )
+ ) {
continue;
}
BOOST_LOG_TRIVIAL(trace) << "Checking priority difference between \"" << graph[*vit].Name() << "\" and \"" << graph[*vit2].Name() << "\".";
vertex_t vertex, parentVertex;
- if (graph[*vit].Priority() < graph[*vit2].Priority()) {
+ //Modulo is not consistently defined for negative numbers, so figure it out explicitly.
+ int p1 = graph[*vit].Priority();
+ int p2 = graph[*vit2].Priority();
+ if (p1 < 0)
+ p1 = -((-p1) % 1000000);
+ else
+ p1 = p1 % 1000000;
+ if (p2 < 0)
+ p2 = -((-p2) % 1000000);
+ else
+ p2 = p2 % 1000000;
+
+ if (p1 < p2) {
parentVertex = *vit;
vertex = *vit2;
} else {
|