Skip to content

Commit fcc49f5

Browse files
authored
Merge pull request #163 from SubnauticaModding/FixDependencyLoading
Proper recursive dependency checks
2 parents ef19ab9 + f1dc01e commit fcc49f5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

QModManager/Patching/ManifestValidator.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void ValidateManifest(QMod mod)
2929
if (mod.PatchMethods.Count > 0)
3030
return;
3131

32-
Logger.Debug($"Validating mod in '{mod.SubDirectory}'");
32+
Logger.Debug($"Validating mod '{mod.Id}'");
3333
if (string.IsNullOrEmpty(mod.Id) ||
3434
string.IsNullOrEmpty(mod.DisplayName) ||
3535
string.IsNullOrEmpty(mod.Author))
@@ -155,6 +155,16 @@ public void CheckRequiredMods(QMod mod)
155155
}
156156

157157
mod.RequiredMods = requiredMods.Values;
158+
if (Logger.DebugLogsEnabled && requiredMods.Count > 0)
159+
{
160+
string msg = $"{mod.Id} has required mods: ";
161+
foreach (var required in requiredMods.Values)
162+
{
163+
msg += $"{required.Id} ";
164+
}
165+
166+
Logger.Debug(msg);
167+
}
158168
}
159169

160170
internal ModStatus FindPatchMethods(QMod qMod)

QModManager/Patching/QModFactory.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ private void ValidateDependencies(List<QMod> modsToLoad, QMod mod)
141141
continue;
142142
}
143143

144+
if (dependencyQMod.HasDependencies)
145+
{
146+
ValidateDependencies(modsToLoad, dependencyQMod);
147+
}
148+
144149
if (dependencyQMod.LoadedAssembly == null)
145150
{
146151
// Dependency hasn't been validated yet

0 commit comments

Comments
 (0)