Fix WithMuzzleOverlay upgrade rule to properly cover cases with @ separator

This commit is contained in:
reaperrr
2015-10-21 08:31:10 +02:00
parent 8e6d5bd603
commit 5615719d28

View File

@@ -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