Skip to content

Commit

Permalink
Fix linter error (#20334)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr authored Sep 19, 2023
1 parent b8697d8 commit 39af74e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Content.YAMLLinter/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,26 @@ private static async Task<int> Main(string[] _)

await instance.WaitPost(() =>
{
var engineErrors = protoMan.ValidateDirectory(new ResPath("/EnginePrototypes"), out var engPrototypes);
yamlErrors = protoMan.ValidateDirectory(new ResPath("/Prototypes"), out var prototypes);

// Merge engine & content prototypes
foreach (var (kind, instances) in engPrototypes)
{
if (prototypes.TryGetValue(kind, out var existing))
existing.UnionWith(instances);
else
prototypes[kind] = instances;
}

foreach (var (kind, set) in engineErrors)
{
if (yamlErrors.TryGetValue(kind, out var existing))
existing.UnionWith(set);
else
yamlErrors[kind] = set;
}

fieldErrors = protoMan.ValidateFields(prototypes);
});

Expand Down

0 comments on commit 39af74e

Please sign in to comment.