Convert Pluggable to conditions.

This commit is contained in:
Paul Chote
2016-12-03 18:33:25 +00:00
parent 5719e62c2c
commit b5ee30345b
4 changed files with 37 additions and 18 deletions

View File

@@ -644,6 +644,21 @@ namespace OpenRA.Mods.Common.UtilityCommands
if (!node.Value.Nodes.Any(n => n.Key == "AttackingCondition"))
node.Value.Nodes.Add(new MiniYamlNode("AttackingCondition", "attacking"));
}
if (node.Key.StartsWith("Pluggable", StringComparison.Ordinal))
{
var upgrades = node.Value.Nodes.FirstOrDefault(n => n.Key == "Upgrades");
if (upgrades != null)
{
upgrades.Key = "Conditions";
foreach (var n in upgrades.Value.Nodes)
{
var conditions = FieldLoader.GetValue<string[]>("", n.Value.Value);
if (conditions.Length > 1)
Console.WriteLine("Unable to automatically migrate multiple Pluggable upgrades to a condition. This must be corrected manually");
}
}
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);