diff --git a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs index 5dba154a14..cbd41ad6b1 100644 --- a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs +++ b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs @@ -37,18 +37,19 @@ namespace OpenRA.Mods.Common.Lint // Removals can never define children if (t.Key.StartsWith("-", StringComparison.Ordinal) && t.Value.Nodes.Any()) { - emitError("{0} has child nodes, which is not valid for removals.".F(t.Key)); + emitError("{0} defines child nodes, which are not valid for removals.".F(t.Location)); continue; } + var traitName = NormalizeName(t.Key); + // Inherits can never define children - if (NormalizeName(t.Key) == "Inherits" && t.Value.Nodes.Any()) + if (traitName == "Inherits" && t.Value.Nodes.Any()) { emitError("{0} defines child nodes, which are not valid for Inherits.".F(t.Location)); continue; } - var traitName = NormalizeName(t.Key); var traitInfo = modData.ObjectCreator.FindType(traitName + "Info"); foreach (var field in t.Value.Nodes) {