Upgrade rule for Health.Shape to HitShape.Type
This commit is contained in:
@@ -679,6 +679,28 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
}
|
||||
}
|
||||
|
||||
// Added HitShape trait
|
||||
if (engineVersion < 20170531)
|
||||
{
|
||||
var hitShapeNode = new MiniYamlNode("HitShape", "");
|
||||
|
||||
// Moved and renamed Health.Shape to HitShape.Type
|
||||
var health = node.Value.Nodes.FirstOrDefault(n => n.Key == "Health");
|
||||
if (health != null)
|
||||
{
|
||||
var shape = health.Value.Nodes.FirstOrDefault(n => n.Key == "Shape");
|
||||
if (shape != null)
|
||||
{
|
||||
RenameNodeKey(shape, "Type");
|
||||
hitShapeNode.Value.Nodes.Add(shape);
|
||||
node.Value.Nodes.Add(hitShapeNode);
|
||||
health.Value.Nodes.Remove(shape);
|
||||
}
|
||||
else
|
||||
node.Value.Nodes.Add(hitShapeNode);
|
||||
}
|
||||
}
|
||||
|
||||
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user