From 1f2047f04eef44a074c02498ade51043634a5a83 Mon Sep 17 00:00:00 2001 From: leper Date: Sun, 25 Nov 2012 21:01:03 +0000 Subject: [PATCH] Consider the unit's build time in the calculation. This was SVN commit r12889. --- binaries/data/mods/public/gui/session/utility_functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binaries/data/mods/public/gui/session/utility_functions.js b/binaries/data/mods/public/gui/session/utility_functions.js index 61ccd6030f..1d609f7975 100644 --- a/binaries/data/mods/public/gui/session/utility_functions.js +++ b/binaries/data/mods/public/gui/session/utility_functions.js @@ -269,7 +269,7 @@ function getEntityCostComponentsTooltipString(template, trainNum, entity) trainNum = 1; for (var r in template.cost) totalCosts[r] = Math.floor(template.cost[r] * trainNum); - totalCosts.time = entity ? Math.ceil(Engine.GuiInterfaceCall("GetBatchTime", {"entity": entity, "batchSize": trainNum})) : template.cost.time; + totalCosts.time = Math.ceil(template.cost.time * (entity ? Engine.GuiInterfaceCall("GetBatchTime", {"entity": entity, "batchSize": trainNum}) : 1)); var costs = []; if (totalCosts.food) costs.push(getCostComponentDisplayName("food") + " " + totalCosts.food);