Browse Source

Ensure consistent plugin load order by guid

ghorsington 5 years ago
parent
commit
7f7b6e4f03
1 changed files with 2 additions and 1 deletions
  1. 2 1
      BepInEx/Bootstrap/Chainloader.cs

+ 2 - 1
BepInEx/Bootstrap/Chainloader.cs

@@ -231,7 +231,8 @@ namespace BepInEx.Bootstrap
 
 				Logger.LogInfo($"{pluginInfos.Count} plugins to load");
 
-				var dependencyDict = new Dictionary<string, IEnumerable<string>>();
+				// We use a sorted dictionary to ensure consistent load order
+				var dependencyDict = new SortedDictionary<string, IEnumerable<string>>(StringComparer.InvariantCultureIgnoreCase);
 				var pluginsByGUID = new Dictionary<string, PluginInfo>();
 
 				foreach (var pluginInfoGroup in pluginInfos.GroupBy(info => info.Metadata.GUID))