From 52b308750f0310c4d82a818cfb3f049e8ed721bc Mon Sep 17 00:00:00 2001 From: Stan Date: Thu, 11 May 2023 09:24:19 +0000 Subject: [PATCH] Fix a bug with the AI after 91509290d6 This was SVN commit r27641. --- binaries/data/mods/public/simulation/helpers/Commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binaries/data/mods/public/simulation/helpers/Commands.js b/binaries/data/mods/public/simulation/helpers/Commands.js index 646fe2c5ac..0ec5384157 100644 --- a/binaries/data/mods/public/simulation/helpers/Commands.js +++ b/binaries/data/mods/public/simulation/helpers/Commands.js @@ -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);