Add a bot type identifier.

This commit is contained in:
Paul Chote
2017-05-28 21:04:58 +00:00
parent e88754cd4a
commit b0906e1836
13 changed files with 71 additions and 21 deletions

View File

@@ -808,6 +808,19 @@ namespace OpenRA.Mods.Common.UtilityCommands
}
}
// Bots must now specify an internal type as well as their display name
if (engineVersion < 20170707)
{
if (node.Key.StartsWith("HackyAI", StringComparison.Ordinal) || node.Key.StartsWith("DummyAI", StringComparison.Ordinal))
{
var nameNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "Name");
// Just duplicate the name to avoid incompatibility with maps
if (nameNode != null)
node.Value.Nodes.Add(new MiniYamlNode("Type", nameNode.Value.Value));
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
}