From 39af74e0a306c41fd628d5461c49e1b330b92ba2 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Tue, 19 Sep 2023 21:08:34 +1200 Subject: [PATCH] Fix linter error (#20334) --- Content.YAMLLinter/Program.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Content.YAMLLinter/Program.cs b/Content.YAMLLinter/Program.cs index 4ba7b9c12c2..b7b70bd1188 100644 --- a/Content.YAMLLinter/Program.cs +++ b/Content.YAMLLinter/Program.cs @@ -77,7 +77,26 @@ private static async Task 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); });