Browse Source

Fix disabled processing to correctly not load disabled plugins

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

+ 6
- 3
IPA.Loader/Loader/PluginLoader.cs View File

@ -792,7 +792,7 @@ namespace IPA.Loader
meta = plugin.Meta; meta = plugin.Meta;
if (!disabled) if (!disabled)
{ {
Resolve(plugin.Meta, out disabled, out ignored);
Resolve(plugin.Meta, ref disabled, out ignored);
} }
loadedPlugins.Add(id, (plugin.Meta, disabled, ignored)); loadedPlugins.Add(id, (plugin.Meta, disabled, ignored));
return true; return true;
@ -800,11 +800,10 @@ namespace IPA.Loader
return false; return false;
} }
void Resolve(PluginMetadata plugin, out bool disabled, out bool ignored)
void Resolve(PluginMetadata plugin, ref bool disabled, out bool ignored)
{ {
// if this method is being called, this is the first and only time that it has been called for this plugin. // if this method is being called, this is the first and only time that it has been called for this plugin.
disabled = false;
ignored = false; ignored = false;
// perform file existence check before attempting to load dependencies // perform file existence check before attempting to load dependencies
@ -877,6 +876,10 @@ namespace IPA.Loader
return; return;
} }
// exit early if we've decided we need to be disabled
if (disabled)
return;
// handle LoadsAfter populated by Features processing // handle LoadsAfter populated by Features processing
foreach (var loadAfter in plugin.LoadsAfter) foreach (var loadAfter in plugin.LoadsAfter)
{ {


Loading…
Cancel
Save