From afd75c7f552b671d9b8fac7fdd5e585f3b07cece Mon Sep 17 00:00:00 2001 From: reaperrr Date: Fri, 6 Nov 2015 15:09:42 +0100 Subject: [PATCH] Fix WithSpriteRotorOverlay upgrade rule to account for @ separator --- .../UtilityCommands/UpgradeRules.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 1391f9c9e8..c004e3e697 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -2201,11 +2201,22 @@ namespace OpenRA.Mods.Common.UtilityCommands if (engineVersion < 20151004) { - if (depth == 1 && node.Key == "WithRotor") + // Rename WithRotor to WithSpriteRotorOverlay + if (depth == 1 && node.Key.StartsWith("WithRotor")) + { + var parts = node.Key.Split('@'); node.Key = "WithSpriteRotorOverlay"; + if (parts.Length > 1) + node.Key += "@" + parts[1]; + } - if (depth == 1 && node.Key == "-WithRotor") + if (depth == 1 && node.Key.StartsWith("-WithRotor")) + { + var parts = node.Key.Split('@'); node.Key = "-WithSpriteRotorOverlay"; + if (parts.Length > 1) + node.Key += "@" + parts[1]; + } } if (engineVersion < 20151005)