Browse Source

Add check for files existing before attempting to load plugin

pull/94/head
Anairkoen Schno 3 years ago
parent
commit
c6f0e9bf52
Signed by: DaNike GPG Key ID: BEFB74D5F3FC4387
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      IPA.Loader/Loader/PluginLoader.cs

+ 16
- 0
IPA.Loader/Loader/PluginLoader.cs View File

@ -807,6 +807,22 @@ namespace IPA.Loader
disabled = false;
ignored = false;
// perform file existence check before attempting to load dependencies
foreach (var file in plugin.AssociatedFiles)
{
if (!file.Exists)
{
ignoredPlugins.Add(plugin, new IgnoreReason(Reason.MissingFiles)
{
ReasonText = $"File {Utils.GetRelativePath(file.FullName, UnityGame.InstallPath)} does not exist"
});
Logger.loader.Warn($"File {Utils.GetRelativePath(file.FullName, UnityGame.InstallPath)}" +
$" (declared by {plugin.Name}) does not exist! Mod installation is incomplete, not loading it.");
ignored = true;
return;
}
}
// TODO: bsipa dependency check
// first load dependencies
foreach (var dep in plugin.Manifest.Dependencies)


Loading…
Cancel
Save