Rewrite yaml merging block removal.

Fixes #2922, #6818.
This commit is contained in:
Paul Chote
2015-04-21 19:30:43 +12:00
parent b4fa704fbd
commit 0a43b3da72
2 changed files with 33 additions and 26 deletions

View File

@@ -37,8 +37,7 @@ namespace OpenRA
Name = name;
foreach (var t in mergedNode)
if (t.Key != "Inherits" && !t.Key.StartsWith("-"))
Traits.Add(LoadTraitInfo(t.Key.Split('@')[0], t.Value));
Traits.Add(LoadTraitInfo(t.Key.Split('@')[0], t.Value));
}
catch (YamlException e)
{
@@ -69,8 +68,7 @@ namespace OpenRA
{
var result = MiniYaml.MergeStrict(node, MergeWithParent(parent, allUnits));
// strip the '-'
result.Nodes.RemoveAll(a => a.Key.StartsWith("-"));
result.Nodes.RemoveAll(a => a.Key == "Inherits");
return result;
}