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