Fix issue with hidden techs after researching it

This was SVN commit r18242.
This commit is contained in:
sanderd17 2016-05-27 08:37:44 +00:00
parent 67149137c8
commit f422b67eb0
2 changed files with 6 additions and 9 deletions

View File

@ -786,7 +786,7 @@ g_SelectionPanels.Research = {
{
let entState = GetEntityState(ent);
if (entState.production && entState.production.technologies.length)
return entState.production.technologies.map( tech => ({
return entState.production.technologies.map(tech => ({
"tech": tech,
"techCostMultiplier": entState.production.techCostMultiplier
}));
@ -802,6 +802,11 @@ g_SelectionPanels.Research = {
},
"addData": function(data)
{
if (!data.item.tech)
{
g_SelectionPanels.Research.hideItem(data.i, data.rowLength);
return false;
}
data.entType = data.item.tech.pair ? [data.item.tech.top, data.item.tech.bottom] : [data.item.tech];
data.template = data.entType.map(GetTechnologyData);
// abort if no template found for any of the techs

View File

@ -63,14 +63,6 @@ function setupUnitPanel(guiName, unitEntState, playerState)
{
var item = items[i];
// If a tech has been researched it leaves an empty slot
if (!item)
{
if (g_SelectionPanels[guiName].hideItem)
g_SelectionPanels[guiName].hideItem(i, rowLength);
continue;
}
// STANDARD DATA
// add standard data
var data = {