Просмотр исходного кода

Fixed ConfigFile breaking preloader patcher

ManlyMarco 4 лет назад
Родитель
Сommit
a0d0d363db
2 измененных файлов с 4 добавлено и 4 удалено
  1. 3 3
      BepInEx/Configuration/ConfigFile.cs
  2. 1 1
      BepInEx/Contract/BaseUnityPlugin.cs

+ 3 - 3
BepInEx/Configuration/ConfigFile.cs

@@ -62,10 +62,10 @@ namespace BepInEx.Configuration
 		/// </summary>
 		/// <param name="configPath">Full path to a file that contains settings. The file will be created as needed.</param>
 		/// <param name="saveOnInit">If the config file/directory doesn't exist, create it immediately.</param>
-		/// <param name="owner">The plugin that owns this setting.</param>
-		public ConfigFile(string configPath, bool saveOnInit, BaseUnityPlugin owner = null)
+		/// <param name="ownerMetadata">Information about the plugin that owns this setting file.</param>
+		public ConfigFile(string configPath, bool saveOnInit, BepInPlugin ownerMetadata = null)
 		{
-			_ownerMetadata = owner?.Info.Metadata;
+			_ownerMetadata = ownerMetadata;
 
 			if (configPath == null) throw new ArgumentNullException(nameof(configPath));
 			configPath = Path.GetFullPath(configPath);

+ 1 - 1
BepInEx/Contract/BaseUnityPlugin.cs

@@ -48,7 +48,7 @@ namespace BepInEx
 
 			Logger = Logging.Logger.CreateLogSource(metadata.Name);
 
-			Config = new ConfigFile(Utility.CombinePaths(Paths.ConfigPath, metadata.GUID + ".cfg"), false, this);
+			Config = new ConfigFile(Utility.CombinePaths(Paths.ConfigPath, metadata.GUID + ".cfg"), false, metadata);
 		}
 	}
 }