Skip to content

Commit

Permalink
Fixed an issue where mods in the "Dependencies" section of the mod.js…
Browse files Browse the repository at this point in the history
…on weren't being considered by the validator or the factory's ValidateDependencies method.
  • Loading branch information
toebeann committed Jul 23, 2020
1 parent c456371 commit 2eb96fa
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions QModManager/Patching/ManifestValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void ValidateManifest(QMod mod)

if (ProhibitedModIDs.TryGetValue(mod.Id, out ModStatus reason))
{
mod.Status = reason;
mod.Status = reason;
return;
}

Expand All @@ -62,10 +62,10 @@ public void ValidateManifest(QMod mod)
mod.SupportedGame = QModGame.Subnautica;
break;
default:
{
mod.Status = ModStatus.FailedIdentifyingGame;
return;
}
{
mod.Status = ModStatus.FailedIdentifyingGame;
return;
}
}

try
Expand Down Expand Up @@ -125,7 +125,7 @@ public void CheckRequiredMods(QMod mod)
foreach (string item in mod.LoadAfter)
mod.LoadAfterPreferences.Add(item);

if (mod.VersionDependencies.Count > 0)
if (mod.VersionDependencies.Count > 0 || mod.RequiredDependencies.Count > 0)
{
var versionedDependencies = new List<RequiredQMod>(mod.VersionDependencies.Count);
foreach (KeyValuePair<string, string> item in mod.VersionDependencies)
Expand All @@ -148,6 +148,14 @@ public void CheckRequiredMods(QMod mod)
mod.RequiredDependencies.Add(item.Key);
}

foreach (var id in mod.RequiredDependencies)
{
if (!versionedDependencies.Any(x => x.Id == id))
{
versionedDependencies.Add(new RequiredQMod(id));
}
}

mod.RequiredMods = versionedDependencies;
}
}
Expand Down

0 comments on commit 2eb96fa

Please sign in to comment.