Ticket #4251: 4251_fix_v4.patch
File 4251_fix_v4.patch, 2.6 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/selection_panels.js
g_SelectionPanels.Research = { 743 743 if (!state.production || !state.production.technologies) 744 744 continue; 745 745 // Remove the techs we already have in ret (with the same name and techCostMultiplier) 746 746 let filteredTechs = state.production.technologies.filter( 747 747 tech => tech != null && !ret.some( 748 item => item.tech == tech && Object.keys(item.techCostMultiplier).every( 749 k => item.techCostMultiplier[k] == state.production.techCostMultiplier[k] 750 ))); 748 item => 749 (item.tech == tech || 750 item.tech.pair && 751 tech.pair && 752 item.tech.bottom == tech.bottom && 753 item.tech.top == tech.top) && 754 Object.keys(item.techCostMultiplier).every( 755 k => item.techCostMultiplier[k] == state.production.techCostMultiplier[k]) 756 )); 751 757 752 758 if (filteredTechs.length + ret.length <= this.getMaxNumberOfItems() && 753 759 getNumberOfRightPanelButtons() <= this.getMaxNumberOfItems() * (filteredTechs.some(tech => !!tech.pair) ? 1 : 2)) 754 760 ret = ret.concat(filteredTechs.map(tech => ({ 755 761 "tech": tech, -
binaries/data/mods/public/simulation/components/ProductionQueue.js
ProductionQueue.prototype.AddBatch = fun 335 335 // Load the technology template 336 336 var cmpDataTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_DataTemplateManager); 337 337 var template = cmpDataTemplateManager.GetTechnologyTemplate(templateName); 338 338 if (!template) 339 339 return; 340 if (this.GetTechnologiesList().indexOf(templateName) == -1) 340 if (!this.GetTechnologiesList().some(tech => 341 tech && 342 (tech == templateName || 343 tech.pair && 344 (tech.top == templateName || tech.bottom == templateName)))) 341 345 { 342 warn("This entity cannot research " + JSON.stringify(templateName)); 346 error("This entity cannot research " + uneval(templateName) + 347 ". It can only research: " + uneval(this.GetTechnologiesList())); 343 348 return; 344 349 } 345 350 var cmpPlayer = QueryOwnerInterface(this.entity); 346 351 let techCostMultiplier = this.GetTechCostMultiplier(); 347 352 let time = techCostMultiplier.time * template.researchTime * cmpPlayer.GetCheatTimeMultiplier();