Ignore trait property requirements for abstract actor types
This commit is contained in:
@@ -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,7 +50,15 @@ 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@"))
|
||||||
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)
|
catch (YamlException e)
|
||||||
|
|||||||
Reference in New Issue
Block a user