Allow each caller on MergeOrDefault to discard nodes.

Use filtering ActorInfo's to drop template actors.
This commit is contained in:
Peter Antal
2018-02-25 22:29:49 -08:00
committed by abcdefg30
parent 40d7b41e84
commit d2ff5b49fd
9 changed files with 24 additions and 26 deletions

View File

@@ -22,6 +22,8 @@ namespace OpenRA
/// </summary>
public class ActorInfo
{
public const string AbstractActorPrefix = "^";
/// <summary>
/// The actor name can be anything, but the sprites used in the Render*: traits default to this one.
/// If you add an ^ in front of the name, the engine will recognize this as a collection of traits
@@ -38,7 +40,6 @@ namespace OpenRA
{
Name = name;
var abstractActorType = name.StartsWith("^");
foreach (var t in node.Nodes)
{
try
@@ -47,8 +48,7 @@ namespace OpenRA
}
catch (FieldLoader.MissingFieldsException e)
{
if (!abstractActorType)
throw new YamlException(e.Message);
throw new YamlException(e.Message);
}
}