Ignore trait property requirements for abstract actor types

This commit is contained in:
atlimit8
2015-07-11 16:48:21 -05:00
parent 1bcc07ce69
commit 429a9380e8

View File

@@ -36,6 +36,7 @@ namespace OpenRA
try
{
var allParents = new HashSet<string>();
var abstractActorType = name.StartsWith("^");
// Guard against circular inheritance
allParents.Add(name);
@@ -49,7 +50,15 @@ namespace OpenRA
throw new YamlException("Bogus trait removal: " + t.Key);
if (t.Key != "Inherits" && !t.Key.StartsWith("Inherits@"))
Traits.Add(LoadTraitInfo(t.Key.Split('@')[0], t.Value));
try
{
Traits.Add(LoadTraitInfo(t.Key.Split('@')[0], t.Value));
}
catch (FieldLoader.MissingFieldsException e)
{
if (!abstractActorType)
throw new YamlException(e.Message);
}
}
}
catch (YamlException e)