From 5615719d287c8160322a1128b70e1e334b16e44f Mon Sep 17 00:00:00 2001 From: reaperrr Date: Wed, 21 Oct 2015 08:31:10 +0200 Subject: [PATCH] Fix WithMuzzleOverlay upgrade rule to properly cover cases with @ separator --- OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 5e6e53879d..688b0680f2 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -2144,10 +2144,20 @@ namespace OpenRA.Mods.Common.UtilityCommands { // Rename WithMuzzleFlash to WithMuzzleOverlay if (depth == 1 && node.Key.StartsWith("WithMuzzleFlash")) - node.Key = node.Key.Replace("WithMuzzleFlash", "WithMuzzleOverlay"); + { + var parts = node.Key.Split('@'); + node.Key = "WithMuzzleOverlay"; + if (parts.Length > 1) + node.Key += "@" + parts[1]; + } if (depth == 1 && node.Key.StartsWith("-WithMuzzleFlash")) - node.Key = node.Key.Replace("-WithMuzzleFlash", "-WithMuzzleOverlay"); + { + var parts = node.Key.Split('@'); + node.Key = "-WithMuzzleOverlay"; + if (parts.Length > 1) + node.Key += "@" + parts[1]; + } } // WithSiloAnimation received own Sequence property, idle sequence is only 1 frame long now