diff --git a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs index 0f0a96dc77..be4f37e54e 100644 --- a/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs +++ b/OpenRA.Mods.Common/Lint/CheckUnknownTraitFields.cs @@ -32,10 +32,15 @@ namespace OpenRA.Mods.Common.Lint { foreach (var t in actor.Value.Nodes) { - // Removals can never define children - if (t.Key.StartsWith("-", StringComparison.Ordinal) && t.Value.Nodes.Any()) + // Removals can never define children or values + if (t.Key.StartsWith("-", StringComparison.Ordinal)) { - emitError("{0} defines child nodes, which are not valid for removals.".F(t.Location)); + if (t.Value.Nodes.Any()) + emitError("{0} {1} defines child nodes, which are not valid for removals.".F(t.Location, t.Key)); + + if (!string.IsNullOrEmpty(t.Value.Value)) + emitError("{0} {1} defines a value, which is not valid for removals.".F(t.Location, t.Key)); + continue; } diff --git a/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs b/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs index 3f3e7c1657..12b6e6b981 100644 --- a/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs +++ b/OpenRA.Mods.Common/Lint/CheckUnknownWeaponFields.cs @@ -34,10 +34,15 @@ namespace OpenRA.Mods.Common.Lint { foreach (var field in weapon.Value.Nodes) { - // Removals can never define children - if (field.Key.StartsWith("-", StringComparison.Ordinal) && field.Value.Nodes.Any()) + // Removals can never define children or values + if (field.Key.StartsWith("-", StringComparison.Ordinal)) { - emitError("{0} has child nodes, which is not valid for removals.".F(field.Key)); + if (field.Value.Nodes.Any()) + emitError("{0} {1} defines child nodes, which is not valid for removals.".F(field.Location, field.Key)); + + if (!string.IsNullOrEmpty(field.Value.Value)) + emitError("{0} {1} defines a value, which is not valid for removals.".F(field.Location, field.Key)); + continue; }