From 1b2ae9b4d41a681b250619ef7a02f0473ec20aff Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 6 Sep 2014 00:54:56 +0200 Subject: [PATCH] Upgrade rules for WithDeathAnimation and Crushable renaming --- OpenRA.Utility/UpgradeRules.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs index e5109c0c9c..112fcce697 100644 --- a/OpenRA.Utility/UpgradeRules.cs +++ b/OpenRA.Utility/UpgradeRules.cs @@ -527,6 +527,28 @@ namespace OpenRA.Utility node.Key = "ValidTargets"; } + // Added WithDeathAnimation + if (engineVersion < 20140913) + { + var spawnsCorpseRemoval = node.Value.Nodes.FirstOrDefault(n => n.Key == "SpawnsCorpse"); + + if (depth == 0 && node.Value.Nodes.Any(n => n.Key.StartsWith("RenderInfantry")) && spawnsCorpseRemoval == null) + node.Value.Nodes.Add(new MiniYamlNode("WithDeathAnimation", new MiniYaml(""))); + + if (depth == 2 && node.Key == "SpawnsCorpse" && parentKey == "RenderInfantry") + node.Value.Nodes.Remove(spawnsCorpseRemoval); + + // CrushableInfantry renamed to Crushable + if (depth == 1) + { + if (node.Key == "CrushableInfantry") + node.Key = "Crushable"; + + if (node.Key == "-CrushableInfantry") + node.Key = "-Crushable"; + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } }