Skip to content

Commit

Permalink
🐛 Ensure mod dependencies are always loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrijnbeek committed Jan 2, 2024
1 parent ecd94be commit 9331576
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Bearded.TD/Content/ContentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,14 @@ public IModReference ReferenceMod(ModMetadata mod)

private ModForLoading findModForLoading(ModMetadata metadata)
{
if (modsForLoading.TryGetValue(metadata, out var mod))
return modsForLoading.TryGetValue(metadata, out var mod) ? mod : queueModForLoading(metadata);
}

private ModForLoading queueModForLoading(ModMetadata metadata)
{
foreach (var dep in metadata.Dependencies.Select(d => FindMetadata(d.Id)))
{
return mod;
findModForLoading(dep);
}

var m = new ModForLoading(metadata);
Expand Down

0 comments on commit 9331576

Please sign in to comment.