]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix linter error (#20334)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Tue, 19 Sep 2023 09:08:34 +0000 (21:08 +1200)
committerGitHub <noreply@github.com>
Tue, 19 Sep 2023 09:08:34 +0000 (19:08 +1000)
Content.YAMLLinter/Program.cs

index 4ba7b9c12c2da21c2f8c718314336df7c27e1936..b7b70bd1188c643eff61ffb7faa20064b4508bd1 100644 (file)
@@ -77,7 +77,26 @@ namespace Content.YAMLLinter
 
             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);
             });