Fix a bug with the AI after 91509290d6

This was SVN commit r27641.
This commit is contained in:
Stan committed 2023-05-11 09:24:19 +00:00
1 parent ede58a2065
commit 52b308750f
1 file changed
+1 -1
@@ -350,7 +350,7 @@ var g_Commands = {
// TODO: the AI API does not take promotion technologies into account for the list
// of trainable units (taken directly from the unit template). Here is a temporary fix.
if (data.cmpPlayer.IsAI())
templateName = cmpTrainer.GetUpgradedTemplate(cmd.template);
templateName = GetUpgradedTemplate(player, cmd.template);
if (cmpTrainer.CanTrain(templateName))
Engine.QueryInterface(ent, IID_ProductionQueue)?.AddItem(templateName, "unit", +cmd.count, cmd.metadata, cmd.pushFront);