Merge pull request #12615 from pchote/fix-yaml-merging-again
Fix yaml merging (again).
This commit is contained in:
@@ -68,6 +68,9 @@ namespace OpenRA.GameRules
|
||||
|
||||
public WeaponInfo(string name, MiniYaml content)
|
||||
{
|
||||
// Resolve any weapon-level yaml inheritance or removals
|
||||
// HACK: The "Defaults" sequence syntax prevents us from doing this generally during yaml parsing
|
||||
content.Nodes = MiniYaml.Merge(new[] { content.Nodes });
|
||||
FieldLoader.Load(this, content);
|
||||
}
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace OpenRA
|
||||
|
||||
foreach (var n in node.Nodes)
|
||||
{
|
||||
if (n.Key == "Inherits" || n.Key.StartsWith("Inherits@"))
|
||||
if (n.Key == "Inherits" || n.Key.StartsWith("Inherits@", StringComparison.Ordinal))
|
||||
{
|
||||
MiniYaml parent;
|
||||
if (!tree.TryGetValue(n.Value.Value, out parent))
|
||||
@@ -317,7 +317,7 @@ namespace OpenRA
|
||||
foreach (var r in ResolveInherits(n.Key, parent, tree, inherited))
|
||||
MergeIntoResolved(r, resolved, tree, inherited);
|
||||
}
|
||||
else if (n.Key.StartsWith("-"))
|
||||
else if (n.Key.StartsWith("-", StringComparison.Ordinal))
|
||||
{
|
||||
var removed = n.Key.Substring(1);
|
||||
if (resolved.RemoveAll(r => r.Key == removed) == 0)
|
||||
|
||||
Reference in New Issue
Block a user