Index: binaries/data/mods/public/simulation/components/TechnologyManager.js =================================================================== --- binaries/data/mods/public/simulation/components/TechnologyManager.js +++ binaries/data/mods/public/simulation/components/TechnologyManager.js @@ -40,12 +40,13 @@ // Some technologies are automatically researched when their conditions are met. They have no cost and are // researched instantly. This allows civ bonuses and more complicated technologies. - this.autoResearchTech = {}; + // Only serialize names + this.autoResearchTech = new Set(); var allTechs = Engine.QueryInterface(SYSTEM_ENTITY, IID_DataTemplateManager).GetAllTechs(); for (var key in allTechs) { if (allTechs[key].autoResearch || allTechs[key].top) - this.autoResearchTech[key] = allTechs[key]; + this.autoResearchTech.add(key); } }; @@ -59,13 +60,13 @@ TechnologyManager.prototype.UpdateAutoResearch = function() { var cmpDataTempMan = Engine.QueryInterface(SYSTEM_ENTITY, IID_DataTemplateManager); - for (var key in this.autoResearchTech) + for (let key of this.autoResearchTech) { var tech = cmpDataTempMan.GetTechnologyTemplate(key); if ((tech.autoResearch && this.CanResearch(key)) || (tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom)))) { - delete this.autoResearchTech[key]; + this.autoResearchTech.delete(key);; this.ResearchTechnology(key); return; // We will have recursively handled any knock-on effects so can just return }