From bbb162190f2889b65c257b6296b438311f88867f Mon Sep 17 00:00:00 2001 From: penev92 Date: Sun, 5 Jul 2015 23:49:26 +0300 Subject: [PATCH] Add an upgrade rule --- OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index f2d2f23de9..c2bfb4cf15 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -1861,7 +1861,21 @@ namespace OpenRA.Mods.Common.UtilityCommands internal static void UpgradePlayers(int engineVersion, ref List nodes, MiniYamlNode parent, int depth) { foreach (var node in nodes) + { + // Rename PlayerReference.Race and LockRace to Faction and LockFaction + if (engineVersion < 20150706) + { + var race = node.Value.Nodes.FirstOrDefault(x => x.Key == "Race"); + if (race != null) + race.Key = "Faction"; + + var lockRace = node.Value.Nodes.FirstOrDefault(x => x.Key == "LockRace"); + if (lockRace != null) + lockRace.Key = "LockFaction"; + } + UpgradePlayers(engineVersion, ref node.Value.Nodes, node, depth + 1); + } } internal static void UpgradeActors(int engineVersion, ref List nodes, MiniYamlNode parent, int depth)