Ver código fonte

Tweak version check

ManlyMarco 5 anos atrás
pai
commit
181f0c2caa
1 arquivos alterados com 5 adições e 6 exclusões
  1. 5 6
      BepInEx/Bootstrap/Chainloader.cs

+ 5 - 6
BepInEx/Bootstrap/Chainloader.cs

@@ -198,14 +198,13 @@ namespace BepInEx.Bootstrap
 			return true;
 		}
 
-		private static bool PluginTargetsNewerBepin(PluginInfo pluginInfo)
+		private static bool PluginTargetsWrongBepin(PluginInfo pluginInfo)
 		{
 			var pluginTarget = pluginInfo.TargettedBepInExVersion;
 			// X.X.X.x - compare normally. x.x.x.X - nightly build number, ignore
-			if (pluginTarget.Major < CurrentAssemblyVersion.Major) return false;
-			if (pluginTarget.Major > CurrentAssemblyVersion.Major) return true;
-			if (pluginTarget.Minor < CurrentAssemblyVersion.Minor) return false;
+			if (pluginTarget.Major != CurrentAssemblyVersion.Major) return true;
 			if (pluginTarget.Minor > CurrentAssemblyVersion.Minor) return true;
+			if (pluginTarget.Minor < CurrentAssemblyVersion.Minor) return false;
 			return pluginTarget.Build > CurrentAssemblyVersion.Build;
 		}
 
@@ -290,9 +289,9 @@ namespace BepInEx.Bootstrap
 						DependencyErrors.Add(message);
 						Logger.LogError(message);
 					}
-					else if (PluginTargetsNewerBepin(pluginInfo))
+					else if (PluginTargetsWrongBepin(pluginInfo))
 					{
-						string message = $@"Plugin [{pluginInfo.Metadata.Name}] targets a newer version of BepInEx ({pluginInfo.TargettedBepInExVersion}) and might not work until you update";
+						string message = $@"Plugin [{pluginInfo.Metadata.Name}] targets a wrong version of BepInEx ({pluginInfo.TargettedBepInExVersion}) and might not work until you update";
 						DependencyErrors.Add(message);
 						Logger.LogWarning(message);
 					}