From 1f048b64ac819638597fe489dc20b923e370089d Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 25 Jan 2015 14:33:40 +0100 Subject: [PATCH] Add upgrade rule for PlayMusicOnMapLoad removal --- OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 7723a408df..05f0abce1b 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -695,6 +695,18 @@ namespace OpenRA.Mods.Common.UtilityCommands if (depth == 1 && node.Key == "MustBeDestroyed") node.Value.Nodes.Add(new MiniYamlNode("RequiredForShortGame", "true")); + // Remove PlayMusicOnMapLoad + if (engineVersion < 20150125) + { + if (depth == 0 && node.Value.Nodes.Exists(n => n.Key == "PlayMusicOnMapLoad")) + { + node.Value.Nodes.RemoveAll(n => n.Key == "PlayMusicOnMapLoad"); + Console.WriteLine("The 'PlayMusicOnMapLoad' trait has been removed."); + Console.WriteLine("Please use the Lua API function 'PlayMusic' instead."); + Console.WriteLine("See http://wiki.openra.net/Lua-API for details."); + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } }