Improve error message for children of removals.
This commit is contained in:
@@ -37,18 +37,19 @@ namespace OpenRA.Mods.Common.Lint
|
|||||||
// Removals can never define children
|
// Removals can never define children
|
||||||
if (t.Key.StartsWith("-", StringComparison.Ordinal) && t.Value.Nodes.Any())
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var traitName = NormalizeName(t.Key);
|
||||||
|
|
||||||
// Inherits can never define children
|
// 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));
|
emitError("{0} defines child nodes, which are not valid for Inherits.".F(t.Location));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var traitName = NormalizeName(t.Key);
|
|
||||||
var traitInfo = modData.ObjectCreator.FindType(traitName + "Info");
|
var traitInfo = modData.ObjectCreator.FindType(traitName + "Info");
|
||||||
foreach (var field in t.Value.Nodes)
|
foreach (var field in t.Value.Nodes)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user