Skip to content

Commit

Permalink
Ignore ModuleMissing* validation if Id is not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Nov 14, 2024
1 parent 485a6ec commit c9f98e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Bannerlord.ModuleManager/ModuleUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ private static IEnumerable<ModuleIssueV2> ValidateModuleDependenciesEx(
// Check that all dependencies are present
foreach (var metadata in targetModule.DependenciesToLoadDistinct())
{
// Ignore the check if the Id is incorrect
if (string.IsNullOrWhiteSpace(metadata.Id)) continue;

// Ignore the check for Optional
if (metadata.IsOptional) continue;

Expand Down Expand Up @@ -597,7 +600,8 @@ public static IEnumerable<ModuleIssueV2> ValidateLoadOrderEx(

if (metadataIdx == -1)
{
if (!metadata.IsOptional)
// If the dependency lacks an Id, it's not valid
if (!string.IsNullOrWhiteSpace(metadata.Id) && !metadata.IsOptional)
{
if (metadata.Version != ApplicationVersion.Empty)
yield return new ModuleMissingExactVersionDependencyIssue(targetModule, metadata);
Expand Down

0 comments on commit c9f98e9

Please sign in to comment.