Browse Source

Soft dependencies now work as expected

Bepis 6 years ago
parent
commit
2747c463a0
1 changed files with 6 additions and 0 deletions
  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);
             }