From 0116bf169aac23cd0829e69345092979cf8c8948 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 14 Sep 2014 00:59:58 +0200 Subject: [PATCH] Upgrade rule for Wall -> BlocksBullets + Crushable transition --- OpenRA.Utility/UpgradeRules.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs index 692033723b..6917c32c10 100644 --- a/OpenRA.Utility/UpgradeRules.cs +++ b/OpenRA.Utility/UpgradeRules.cs @@ -547,6 +547,22 @@ namespace OpenRA.Utility } } + // Replaced Wall with Crushable + BlocksBullets + if (engineVersion < 20140914) + { + if (depth == 0) + { + var actorTraits = node.Value.Nodes; + var wall = actorTraits.FirstOrDefault(t => t.Key == "Wall"); + if (wall != null) + node.Value.Nodes.Add(new MiniYamlNode("BlocksBullets", new MiniYaml(""))); + + var blocksBullets = actorTraits.FirstOrDefault(t => t.Key == "BlocksBullets"); + if (depth == 1 && node.Key == "Wall" && blocksBullets != null) + node.Key = "Crushable"; + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } }