Procházet zdrojové kódy

Ensure consistent plugin load order by guid

ghorsington před 5 roky
rodič
revize
7f7b6e4f03
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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))