From d502b296bbbc8e9b833dd96cf5dbed68ac111cdd Mon Sep 17 00:00:00 2001 From: reaperrr Date: Mon, 1 May 2017 13:02:14 +0200 Subject: [PATCH] Upgrade rule for DeployAnimation removal --- .../UtilityCommands/UpgradeRules.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 715662e669..8faff636f3 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -663,6 +663,22 @@ namespace OpenRA.Mods.Common.UtilityCommands } } + // Removed GrantConditionOnDeploy.DeployAnimation and made WithMakeAnimation compatible instead + if (engineVersion < 20170510) + { + var grantCondOnDeploy = node.Value.Nodes.FirstOrDefault(n => n.Key == "GrantConditionOnDeploy"); + if (grantCondOnDeploy != null) + { + var deployAnimNode = grantCondOnDeploy.Value.Nodes.FirstOrDefault(n => n.Key == "DeployAnimation"); + if (deployAnimNode != null) + { + grantCondOnDeploy.Value.Nodes.Remove(deployAnimNode); + Console.WriteLine("DeployAnimation was removed from GrantConditionOnDeploy."); + Console.WriteLine("Use WithMakeAnimation instead if a deploy animation is needed."); + } + } + } + UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); }