فهرست منبع

Soft dependencies now work as expected

Bepis 6 سال پیش
والد
کامیت
2747c463a0
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      BepInEx/TypeLoader.cs

+ 6 - 0
BepInEx/TypeLoader.cs

@@ -82,7 +82,13 @@ namespace BepInEx
                 Type dependencyType = AllPlugins.FirstOrDefault(x => GetMetadata(x)?.GUID == dependency.DependencyGUID);
 
                 if (dependencyType == null)
+                {
+                    if ((dependency.Flags & BepInDependency.DependencyFlags.SoftDependency) != 0)
+                        continue; //skip on soft dependencies
+
                     throw new MissingDependencyException("Cannot find dependency type.");
+                }
+                    
 
                 dependencyTypes.Add(dependencyType);
             }