Fix crash when Inherits has child nodes.

This commit is contained in:
Paul Chote
2018-10-31 17:32:23 +00:00
committed by abcdefg30
parent f968b169ad
commit f05e3e871f

View File

@@ -41,6 +41,13 @@ namespace OpenRA.Mods.Common.Lint
continue;
}
// Inherits can never define children
if (NormalizeName(t.Key) == "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)