Browse Source

Prevent skipping plugin on unresolved soft dependency
Rebase of 4311115

Bepis 4 years ago
parent
commit
df841d04dd
1 changed files with 6 additions and 3 deletions
  1. 6 3
      BepInEx.Core/Bootstrap/BaseChainloader.cs

+ 6 - 3
BepInEx.Core/Bootstrap/BaseChainloader.cs

@@ -162,18 +162,21 @@ namespace BepInEx.Bootstrap
 					var missingDependencies = new List<BepInDependency>();
 					foreach (var dependency in plugin.Dependencies)
 					{
+						bool IsHardDependency(BepInDependency dep)
+							=> (dep.Flags & BepInDependency.DependencyFlags.HardDependency) != 0;
+
 						// If the dependency wasn't already processed, it's missing altogether
 						bool dependencyExists = processedPlugins.TryGetValue(dependency.DependencyGUID, out var pluginVersion);
 						if (!dependencyExists || pluginVersion < dependency.MinimumVersion)
 						{
 							// If the dependency is hard, collect it into a list to show
-							if ((dependency.Flags & BepInDependency.DependencyFlags.HardDependency) != 0)
+							if (IsHardDependency(dependency))
 								missingDependencies.Add(dependency);
 							continue;
 						}
 
-						// If the dependency is invalid (e.g. has missing dependencies), report that to the user
-						if (invalidPlugins.Contains(dependency.DependencyGUID))
+						// If the dependency is a hard and is invalid (e.g. has missing dependencies), report that to the user
+						if (invalidPlugins.Contains(dependency.DependencyGUID) && IsHardDependency(dependency))
 						{
 							dependsOnInvalidPlugin = true;
 							break;