Ticket #3208: TechnologyReplace.patch

File TechnologyReplace.patch, 751 bytes (added by Niek, 9 years ago)

Patch that allows technologies to mark other technologies as 'researched' using the example json block

  • binaries/data/mods/public/simulation/components/TechnologyManager.js

     
    337337        }
    338338    }
    339339
     340    if (template.replaces && template.replaces.length > 0)
     341    {
     342        for (var i of template.replaces) {
     343            if (!i || i == "")
     344                return;
     345
     346            if (this.IsTechnologyResearched(i))
     347                continue;
     348
     349            var template = this.GetTechnologyTemplate(i);
     350            this.researchedTechs[i] = template;
     351        }
     352    }
     353
    340354    this.UpdateAutoResearch();
    341355
    342356    var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player);