Upgrade rule for Wall -> BlocksBullets + Crushable transition

This commit is contained in:
reaperrr
2014-09-14 00:59:58 +02:00
parent 8c1ab03623
commit 0116bf169a

View File

@@ -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);
}
}