Consider the unit's build time in the calculation.

This was SVN commit r12889.
This commit is contained in:
leper
2012-11-25 21:01:03 +00:00
parent f6e1e15a5d
commit 1f2047f04e
@@ -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);