diff --git a/IPA.Loader/Loader/PluginLoader.cs b/IPA.Loader/Loader/PluginLoader.cs index e4992032..67c7b269 100644 --- a/IPA.Loader/Loader/PluginLoader.cs +++ b/IPA.Loader/Loader/PluginLoader.cs @@ -823,10 +823,12 @@ namespace IPA.Loader } } - // TODO: bsipa dependency check // first load dependencies + var dependsOnSelf = false; foreach (var dep in plugin.Manifest.Dependencies) { + if (dep.Key == SelfMeta.Id) + dependsOnSelf = true; if (!TryResolveId(dep.Key, out var depMeta, out var depDisabled, out var depIgnored)) { Logger.loader.Warn($"Dependency '{dep.Key}@{dep.Value}' for '{plugin.Id}' does not exist; ignoring '{plugin.Id}'"); @@ -862,6 +864,19 @@ namespace IPA.Loader _ = plugin.Dependencies.Add(depMeta); } + // make sure the plugin depends on the loader (assuming it actually needs to) + if (!dependsOnSelf && !plugin.IsSelf && !plugin.IsBare) + { + Logger.loader.Warn($"Plugin '{plugin.Id}' does not depend on any particular loader version; assuming its incompatible"); + ignoredPlugins.Add(plugin, new(Reason.Dependency) + { + ReasonText = "Does not depend on any loader version, so it is assumed to be incompatible", + RelatedTo = SelfMeta + }); + ignored = true; + return; + } + // handle LoadsAfter populated by Features processing foreach (var loadAfter in plugin.LoadsAfter) {