complain about junk values like the recent volkov breakage

This commit is contained in:
Chris Forbes
2012-09-04 10:55:26 +12:00
parent d970195394
commit 3d8dc80f03

View File

@@ -70,6 +70,9 @@ namespace OpenRA
static ITraitInfo LoadTraitInfo(string traitName, MiniYaml my)
{
if (!string.IsNullOrEmpty(my.Value))
throw new YamlException("Junk value `{0}` on trait node {1}"
.F(my.Value, traitName));
var info = Game.CreateObject<ITraitInfo>(traitName + "Info");
FieldLoader.Load(info, my);
return info;