Browse Source

Fixed issue where loadAfter mods that failed to initialize would prevent the mods supposed to load after them from loading

pull/44/head
Anairkoen Schno 4 years ago
parent
commit
8bbacbb456
2 changed files with 14 additions and 4 deletions
  1. +13
    -4
      IPA.Loader/Loader/PluginLoader.cs
  2. +1
    -0
      IPA.Loader/Loader/PluginMetadata.cs

+ 13
- 4
IPA.Loader/Loader/PluginLoader.cs View File

@ -573,11 +573,15 @@ namespace IPA.Loader
inserted = inserted || InsertInto(sr.Dependencies, meta);
if (meta.Id != null)
if (sr.Manifest.Dependencies.ContainsKey(meta.Id) || sr.Manifest.LoadAfter.Contains(meta.Id))
{
if (sr.Manifest.Dependencies.ContainsKey(meta.Id))
inserted = inserted || sr.Dependencies.Add(meta);
else if (sr.Manifest.LoadAfter.Contains(meta.Id))
inserted = inserted || sr.LoadsAfter.Add(meta);
}
if (sr.Id != null)
if (meta.Manifest.LoadBefore.Contains(sr.Id))
inserted = inserted || sr.Dependencies.Add(meta);
inserted = inserted || sr.LoadsAfter.Add(meta);
}
if (isRoot)
@ -587,11 +591,15 @@ namespace IPA.Loader
InsertInto(meta.Dependencies, sr);
if (sr.Id != null)
if (meta.Manifest.Dependencies.ContainsKey(sr.Id) || meta.Manifest.LoadAfter.Contains(sr.Id))
{
if (meta.Manifest.Dependencies.ContainsKey(sr.Id))
meta.Dependencies.Add(sr);
else if (meta.Manifest.LoadAfter.Contains(sr.Id))
meta.LoadsAfter.Add(sr);
}
if (meta.Id != null)
if (sr.Manifest.LoadBefore.Contains(meta.Id))
meta.Dependencies.Add(sr);
meta.LoadsAfter.Add(sr);
}
root.Add(meta);
@ -610,6 +618,7 @@ namespace IPA.Loader
if (!into.Contains(st))
{
DeTree(into, st.Dependencies);
DeTree(into, st.LoadsAfter);
into.Add(st);
}
}


+ 1
- 0
IPA.Loader/Loader/PluginMetadata.cs View File

@ -116,6 +116,7 @@ namespace IPA.Loader
private PluginManifest manifest;
internal HashSet<PluginMetadata> Dependencies { get; } = new HashSet<PluginMetadata>();
internal HashSet<PluginMetadata> LoadsAfter { get; } = new HashSet<PluginMetadata>();
internal PluginManifest Manifest
{


Loading…
Cancel
Save