Page MenuHomeWildfire Games

Remove obsolete entity query in TechMan.'s ResearchTechnology-function.
Needs ReviewPublic

Authored by Freagarach on Tue, Feb 11, 9:04 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Removes variable ents, which was introduced in rP14588 (updated in rP19637), use removed in rP22767.
Also some var -> let.

Test Plan

Verify that

  • the variable was indeed unused.
  • all techs still apply.

Event Timeline

Freagarach created this revision.Tue, Feb 11, 9:04 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  39|  39| 	for (let key of this.unresearchedAutoResearchTechs)
|  40|  40| 	{
|  41|  41| 		let tech = TechnologyTemplates.Get(key);
|  42|    |-		if ((tech.autoResearch && this.CanResearch(key))
|  43|    |-			|| (tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|    |  42|+		if ((tech.autoResearch && this.CanResearch(key)) ||
|    |  43|+			(tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|  44|  44| 		{
|  45|  45| 			this.unresearchedAutoResearchTechs.delete(key);
|  46|  46| 			this.ResearchTechnology(key);
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  50|  50| };
|  51|  51| 
|  52|  52| // Checks an entity template to see if its technology requirements have been met
|  53|    |-TechnologyManager.prototype.CanProduce = function (templateName)
|    |  53|+TechnologyManager.prototype.CanProduce = function(templateName)
|  54|  54| {
|  55|  55| 	var cmpTempManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|  56|  56| 	var template = cmpTempManager.GetTemplate(templateName);

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 125| »   »   »   switch·(type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 140| »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/components/TechnologyManager.js
|  43| »   »   »   ||·(tech.top·&&·(this.IsTechnologyResearched(tech.top)·||·this.IsTechnologyResearched(tech.bottom))))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 185| »   »   var·cmpTemplateManager·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_TemplateManager);
|    | [NORMAL] JSHintBear:
|    | 'cmpTemplateManager' is already defined.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 186| »   »   var·template·=·cmpTemplateManager.GetCurrentTemplateName(msg.entity);
|    | [NORMAL] JSHintBear:
|    | 'template' is already defined.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 191| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(msg.entity,·IID_Identity);
|    | [NORMAL] JSHintBear:
|    | 'cmpIdentity' is already defined.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 194| »   »   »   »   var·classes·=·cmpIdentity.GetClassesList();
|    | [NORMAL] JSHintBear:
|    | 'classes' is already defined.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1746/display/redirect