Page MenuHomeWildfire Games

Allow to use multiple technologies as requirements for unit training and construction
Needs ReviewPublic

Authored by Angen on Fri, Jan 4, 9:23 PM.

Details

Reviewers
smiley
Summary

Allow to use multiple technologies as requirements for unit training and construction.

Track of important files:
globalscripts/Templates.js
gui/common/tooltips.js
gui/session/selection_panels.js

components/GuiInterface.js
components/Identity.js
components/TechnologyManager.js

ai/common-api/entity.js
ai/common-api/gamestate.js
ai/petra/queueplanBuilding.js

Test Plan

Test, that any building, unit has just correct technology requirements. For example there is not town_phase and village_phase. (best way through playing)

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 6786
Build 11160: Vulcan BuildJenkins
Build 11159: arc lint + arc unit

Event Timeline

Angen created this revision.Fri, Jan 4, 9:23 PM
Owners added subscribers: Restricted Owners Package, Restricted Owners Package.Fri, Jan 4, 9:23 PM
Angen updated this revision to Diff 7251.Fri, Jan 4, 9:49 PM

Make getRequiredTechnologyTooltip nicer and update AI.

Angen updated this revision to Diff 7253.Fri, Jan 4, 10:00 PM

missing renaming

Vulcan added a subscriber: Vulcan.Fri, Jan 4, 10:55 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
| 100| 100| 	this.visibleClassesList = GetVisibleIdentityClasses(this.template);
| 101| 101| };
| 102| 102| 
| 103|    |-Identity.prototype.Deserialize = function ()
|    | 103|+Identity.prototype.Deserialize = function()
| 104| 104| {
| 105| 105| 	this.Init();
| 106| 106| };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  10|  10| 
|  11|  11| 	var ret = {};
|  12|  12| 	for (var i in this)
|  13|    |-	{
|    |  13|+	
|  14|  14| 		if (this.hasOwnProperty(i))
|  15|  15| 			ret[i] = this[i];
|  16|    |-	}
|    |  16|+	
|  17|  17| 	ret.modificationCache = {};
|  18|  18| 	return ret;
|  19|  19| };
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  64|  64| 	for (let key of this.unresearchedAutoResearchTechs)
|  65|  65| 	{
|  66|  66| 		let tech = TechnologyTemplates.Get(key);
|  67|    |-		if ((tech.autoResearch && this.CanResearch(key))
|  68|    |-			|| (tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|    |  67|+		if ((tech.autoResearch && this.CanResearch(key)) ||
|    |  68|+			(tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|  69|  69| 		{
|  70|  70| 			this.unresearchedAutoResearchTechs.delete(key);
|  71|  71| 			this.ResearchTechnology(key);
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  75|  75| };
|  76|  76| 
|  77|  77| // Checks an entity template to see if its technology requirements have been met
|  78|    |-TechnologyManager.prototype.CanProduce = function (templateName)
|    |  78|+TechnologyManager.prototype.CanProduce = function(templateName)
|  79|  79| {
|  80|  80| 	let cmpTempManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|  81|  81| 	let template = cmpTempManager.GetTemplate(templateName);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  98|  98| 
|  99|  99| TechnologyManager.prototype.AreTechnologiesResearched = function(techs)
| 100| 100| {
| 101|    |-	for (let tech of techs) {
|    | 101|+	for (let tech of techs) 
| 102| 102| 		if (!this.researchedTechs.has(tech))
| 103| 103| 			return false;
| 104|    |-	}
|    | 104|+	
| 105| 105| 	return true;
| 106| 106| }
| 107| 107| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 103| 103| 			return false;
| 104| 104| 	}
| 105| 105| 	return true;
| 106|    |-}
|    | 106|+};
| 107| 107| 
| 108| 108| TechnologyManager.prototype.IsTechnologyStarted = function(tech)
| 109| 109| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 202| 202| 		var classes = cmpIdentity.GetClassesList();
| 203| 203| 		// don't use foundations for the class counts but check if techs apply (e.g. health increase)
| 204| 204| 		if (!Engine.QueryInterface(msg.entity, IID_Foundation))
| 205|    |-		{
|    | 205|+		
| 206| 206| 			for (let cls of classes)
| 207| 207| 			{
| 208| 208| 				this.classCounts[cls] = this.classCounts[cls] || 0;
| 212| 212| 				this.typeCountsByClass[cls][template] = this.typeCountsByClass[cls][template] || 0;
| 213| 213| 				this.typeCountsByClass[cls][template] += 1;
| 214| 214| 			}
| 215|    |-		}
|    | 215|+		
| 216| 216| 
| 217| 217| 		// Newly created entity, check if any researched techs might apply
| 218| 218| 		// (only do this for new entities because even if an entity is converted or captured,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 295| 295| 	}
| 296| 296| 
| 297| 297| 	if (template.replaces && template.replaces.length > 0)
| 298|    |-	{
|    | 298|+	
| 299| 299| 		for (var i of template.replaces)
| 300| 300| 		{
| 301| 301| 			if (!i || this.IsTechnologyResearched(i))
| 313| 313| 					cmpPlayerEntityLimits.UpdateLimitsFromTech(i);
| 314| 314| 			}
| 315| 315| 		}
| 316|    |-	}
|    | 316|+	
| 317| 317| 
| 318| 318| 	this.UpdateAutoResearch();
| 319| 319| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 331| 331| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 332| 332| 
| 333| 333| 	// always send research finished message
| 334|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 334|+	Engine.PostMessage(this.entity, MT_ResearchFinished, { "player": playerID, "tech": tech});
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 331| 331| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 332| 332| 
| 333| 333| 	// always send research finished message
| 334|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 334|+	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech });
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
| 338|    |-		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
|    | 338|+		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component] });
| 339| 339| 		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
| 340| 340| 	}
| 341| 341| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
| 338| 338| 		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
| 339|    |-		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
|    | 339|+		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component] });
| 340| 340| 	}
| 341| 341| 
| 342| 342| 	if (tech.startsWith("phase") && !template.autoResearch)
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 458| 458|  */
| 459| 459| TechnologyManager.prototype.GetResearcher = function(tech)
| 460| 460| {
| 461|    |-	return this.researchQueued.get(tech)
|    | 461|+	return this.researchQueued.get(tech);
| 462| 462| };
| 463| 463| 
| 464| 464| /**

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 101| »   for·(let·tech·of·techs)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 229| ·»   »   »   »   »   if·(DoesModificationApply(modif,·classes))
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/TechnologyManager.js
|  68| »   »   »   ||·(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
| 106| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 238| »   »   »   for·(var·component·in·modifiedComponents)
|    | [NORMAL] JSHintBear:
|    | 'component' is already defined.

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

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

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 461| »   return·this.researchQueued.get(tech)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 393| 393| function getRepairTimeTooltip(entState)
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396|    |-			"label": headerFont(translate("Number of repairers:")),
|    | 396|+		"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397|    |-			"details": entState.repairable.numBuilders
|    | 397|+		"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398|    |-		}) + "\n" + (entState.repairable.numBuilders ?
|    | 398|+	}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
| 401| 401| 			"Add another worker to speed up the repairs by %(second)s seconds.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 415| 415| function getBuildTimeTooltip(entState)
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418|    |-			"label": headerFont(translate("Number of builders:")),
|    | 418|+		"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419|    |-			"details": entState.foundation.numBuilders
|    | 419|+		"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420|    |-		}) + "\n" + (entState.foundation.numBuilders ?
|    | 420|+	}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
| 423| 423| 			"Add another worker to speed up the construction by %(second)s seconds.",
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 626| 626| 		return "";
| 627| 627| 
| 628| 628| 	let names = "";
| 629|    |-	for (let requiredTechnology of requiredTechnologies) {
|    | 629|+	for (let requiredTechnology of requiredTechnologies) 
| 630| 630| 		if (names == "")
| 631| 631| 			names = getEntityNames(GetTechnologyData(requiredTechnology, civ));
| 632| 632| 		else
| 633| 633| 			names = names + ", "+ getEntityNames(GetTechnologyData(requiredTechnology, civ));
| 634|    |-	}
|    | 634|+	
| 635| 635| 	return sprintf(translate("Requires %(technologies)s"), {
| 636| 636| 		"technologies": names
| 637| 637| 	});

binaries/data/mods/public/gui/common/tooltips.js
| 629| »   for·(let·requiredTechnology·of·requiredTechnologies)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  33|  33| 		{
|  34|  34| 			let args = string.split("/");
|  35|  35| 			for (let arg of args)
|  36|    |-			{
|    |  36|+			
|  37|  37| 				if (value[arg])
|  38|  38| 					value = value[arg];
|  39|  39| 				else
|  41|  41| 					value = undefined;
|  42|  42| 					break;
|  43|  43| 				}
|  44|    |-			}
|    |  44|+			
|  45|  45| 			this._tpCache.set(string, value);
|  46|  46| 		}
|  47|  47| 		return this._tpCache.get(string);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  80|  80| 		return true;
|  81|  81| 	},
|  82|  82| 
|  83|    |-	"requiredTechs": function() { 
|    |  83|+	"requiredTechs": function() {
|  84|  84| 		let requiredTechnologies = this.get("Identity/RequiredTechnologies");
|  85|  85| 		if (requiredTechnologies && requiredTechnologies._string)
|  86|  86| 			return requiredTechnologies._string.split(/\s+/);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
| 314| 314| 			return undefined;
| 315| 315| 
| 316| 316| 		if (this.get("Attack/" + type + "/Bonuses"))
| 317|    |-		{
|    | 317|+		
| 318| 318| 			for (let b in this.get("Attack/" + type + "/Bonuses"))
| 319| 319| 			{
| 320| 320| 				let bonusClasses = this.get("Attack/" + type + "/Bonuses/" + b + "/Classes");
| 324| 324| 					if (bcl == againstClass)
| 325| 325| 						return +this.get("Attack/" + type + "/Bonuses/" + b + "/Multiplier");
| 326| 326| 			}
| 327|    |-		}
|    | 327|+		
| 328| 328| 		return 1;
| 329| 329| 	},
| 330| 330| 

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 101| »   »   for·(let·techRequired·of·techsRequired)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 804| »   »   if·(this.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 821| »   »   if·(this.position()·!==·undefined·&&·unitToFleeFrom.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 226| 226| 		{
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229|    |-					"name": aura.auraName,
|    | 229|+				"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230|    |-					"description": aura.auraDescription || null,
|    | 230|+				"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231|    |-					"radius": aura.radius || null
|    | 231|+				"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
| 234| 234| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232|    |-				};
|    | 232|+			};
| 233| 233| 		}
| 234| 234| 	}
| 235| 235| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 389| 389| 		ret.icon = template.Identity.Icon;
| 390| 390| 		ret.tooltip = template.Identity.Tooltip;
| 391| 391| 		ret.requiredTechnologies = [];
| 392|    |-		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) {
|    | 392|+		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) 
| 393| 393| 			ret.requiredTechnologies = template.Identity.RequiredTechnologies._string.split(/\s+/);
| 394|    |-		}
|    | 394|+		
| 395| 395| 		ret.visibleIdentityClasses = GetVisibleIdentityClasses(template.Identity);
| 396| 396| 		ret.nativeCiv = template.Identity.Civ;
| 397| 397| 	}

binaries/data/mods/public/globalscripts/Templates.js
| 392| »   »   if·(template.Identity.RequiredTechnologies·&&·template.Identity.RequiredTechnologies._string)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 452| 452| 				continue;
| 453| 453| 
| 454| 454| 			if (state.pack.progress == 0)
| 455|    |-			{
|    | 455|+			
| 456| 456| 				if (state.pack.packed)
| 457| 457| 					checks.unpackButton = true;
| 458| 458| 				else
| 459| 459| 					checks.packButton = true;
| 460|    |-			}
|    | 460|+			
| 461| 461| 			else if (state.pack.packed)
| 462| 462| 				checks.unpackCancelButton = true;
| 463| 463| 			else
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 763| 763| 				addResearchToQueue(data.item.researchFacilityId, t);
| 764| 764| 			})(tech);
| 765| 765| 
| 766|    |-			button.onPressRight = (t => function () {
|    | 766|+			button.onPressRight = (t => function() {
| 767| 767| 				showTemplateDetails(
| 768| 768| 					t,
| 769| 769| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 941| 941| 			"player": data.player
| 942| 942| 		});
| 943| 943| 
| 944|    |-		let unitIds = data.unitEntStates.map(status => status.id)
|    | 944|+		let unitIds = data.unitEntStates.map(status => status.id);
| 945| 945| 		let [buildingsCountToTrainFullBatch, fullBatchSize, remainderBatch] =
| 946| 946| 			getTrainingStatus(unitIds, data.item, data.playerState);
| 947| 947| 

binaries/data/mods/public/gui/session/selection_panels.js
|  48| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  59| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 731| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 944| »   »   let·unitIds·=·data.unitEntStates.map(status·=>·status.id)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|  97|  97| 	else if (pos.xx === undefined || pos.x == pos.xx && pos.z == pos.zz)
|  98|  98| 		builder.construct(this.type, pos.x, pos.z, pos.angle, this.metadata);
|  99|  99| 	else // try with the lowest, move towards us unless we're same
| 100|    |-	{
|    | 100|+	
| 101| 101| 		for (let step = 0; step <= 1; step += 0.2)
| 102| 102| 			builder.construct(this.type, step*pos.x + (1-step)*pos.xx, step*pos.z + (1-step)*pos.zz,
| 103| 103| 				pos.angle, this.metadata);
| 104|    |-	}
|    | 104|+	
| 105| 105| 	this.onStart(gameState);
| 106| 106| 	Engine.ProfileStop();
| 107| 107| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 131| 131| 	}
| 132| 132| 
| 133| 133| 	if (!this.position)
| 134|    |-	{
|    | 134|+	
| 135| 135| 		if (template.hasClass("CivCentre"))
| 136| 136| 		{
| 137| 137| 			let pos;
| 177| 177| 			else if (!pos)
| 178| 178| 				return false;
| 179| 179| 		}
| 180|    |-	}
|    | 180|+	
| 181| 181| 
| 182| 182| 	// Compute each tile's closeness to friendly structures:
| 183| 183| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 204| 204| 					placement.set(j, 45);
| 205| 205| 		}
| 206| 206| 		else
| 207|    |-		{
|    | 207|+		
| 208| 208| 			for (let j = 0; j < placement.map.length; ++j)
| 209| 209| 				if (HQ.basesMap.map[j] != 0)
| 210| 210| 					placement.set(j, 45);
| 211|    |-		}
|    | 211|+		
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214| 214| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 211| 211| 		}
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214|    |-		{
|    | 214|+		
| 215| 215| 			gameState.getOwnStructures().forEach(function(ent) {
| 216| 216| 				let pos = ent.position();
| 217| 217| 				let x = Math.round(pos[0] / cellSize);
| 245| 245| 				else if (template.genericName() == "Rotary Mill" && ent.hasClass("Field"))
| 246| 246| 					placement.addInfluence(x, z, 60/cellSize, 40);
| 247| 247| 			});
| 248|    |-		}
|    | 248|+		
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250| 250| 		{
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 219| 219| 
| 220| 220| 				let struct = m.getBuiltEntity(gameState, ent);
| 221| 221| 				if (struct.resourceDropsiteTypes() && struct.resourceDropsiteTypes().indexOf("food") != -1)
| 222|    |-				{
|    | 222|+				
| 223| 223| 					if (template.hasClass("Field") || template.hasClass("Corral"))
| 224| 224| 						placement.addInfluence(x, z, 80/cellSize, 50);
| 225| 225| 					else // If this is not a field add a negative influence because we want to leave this area for fields
| 226| 226| 						placement.addInfluence(x, z, 80/cellSize, -20);
| 227|    |-				}
|    | 227|+				
| 228| 228| 				else if (template.hasClass("House"))
| 229| 229| 				{
| 230| 230| 					if (ent.hasClass("House"))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 247| 247| 			});
| 248| 248| 		}
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250|    |-		{
|    | 250|+		
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
| 252| 252| 			{
| 253| 253| 				let value = placement.map[j] - gameState.sharedScript.resourceMaps.wood.map[j]/3;
| 255| 255| 					value /= 2;	// we need space around farmstead, so disfavor map border
| 256| 256| 				placement.set(j, value);
| 257| 257| 			}
| 258|    |-		}
|    | 258|+		
| 259| 259| 	}
| 260| 260| 
| 261| 261| 	// Requires to be inside our territory, and inside our base territory if required
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 268| 268| 	{
| 269| 269| 		let base = this.metadata.base;
| 270| 270| 		for (let j = 0; j < placement.map.length; ++j)
| 271|    |-		{
|    | 271|+		
| 272| 272| 			if (HQ.basesMap.map[j] != base)
| 273| 273| 				placement.map[j] = 0;
| 274| 274| 			else if (placement.map[j] > 0)
| 283| 283| 				if (HQ.isNearInvadingArmy([x, z]))
| 284| 284| 					placement.map[j] = 0;
| 285| 285| 			}
| 286|    |-		}
|    | 286|+		
| 287| 287| 	}
| 288| 288| 	else
| 289| 289| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 286| 286| 		}
| 287| 287| 	}
| 288| 288| 	else
| 289|    |-	{
|    | 289|+	
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291| 291| 		{
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308| 308| 		}
| 309|    |-	}
|    | 309|+	
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
| 312| 312| 	// Find target building's approximate obstruction radius, and expand by a bit to make sure we're not too close,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 288| 288| 	else
| 289| 289| 	{
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291|    |-		{
|    | 291|+		
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 293| 293| 				placement.map[j] = 0;
| 294| 294| 			else if (placement.map[j] > 0)
| 305| 305| 				else if (favoredBase && HQ.basesMap.map[j] == favoredBase)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308|    |-		}
|    | 308|+		
| 309| 309| 	}
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 650| 650| 		{
| 651| 651| 			let count = 0;
| 652| 652| 			for (let j = 0; j < length-1; ++j)
| 653|    |-			{
|    | 653|+			
| 654| 654| 				if ((waterPoints[(i + j) % length]+1) % numPoints == waterPoints[(i + j + 1) % length])
| 655| 655| 					++count;
| 656| 656| 				else
| 657| 657| 					break;
| 658|    |-			}
|    | 658|+			
| 659| 659| 			consec[i] = count;
| 660| 660| 		}
| 661| 661| 		let start = 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 661| 661| 		let start = 0;
| 662| 662| 		let count = 0;
| 663| 663| 		for (let c in consec)
| 664|    |-		{
|    | 664|+		
| 665| 665| 			if (consec[c] > count)
| 666| 666| 			{
| 667| 667| 				start = c;
| 668| 668| 				count = consec[c];
| 669| 669| 			}
| 670|    |-		}
|    | 670|+		
| 671| 671| 
| 672| 672| 		// If we've found a shoreline, stop searching
| 673| 673| 		if (count != numPoints-1)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87, -0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50, -0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0, -1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50, -0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87, -0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 857| 857| 			let dxmax = size - dy;
| 858| 858| 			let ky = iy + dy;
| 859| 859| 			if (ky >= 0 && ky < w)
| 860|    |-			{
|    | 860|+			
| 861| 861| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 862| 862| 				{
| 863| 863| 					let kx = ix + dx;
| 868| 868| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 869| 869| 					nbcell += weight;
| 870| 870| 				}
| 871|    |-			}
|    | 871|+			
| 872| 872| 			if (dy == 0)
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
| 875| 875| 			if (ky >= 0 && ky < w)
| 876|    |-			{
|    | 876|+			
| 877| 877| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 878| 878| 				{
| 879| 879| 					let kx = ix + dx;
| 884| 884| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 885| 885| 					nbcell += weight;
| 886| 886| 				}
| 887|    |-			}
|    | 887|+			
| 888| 888| 		}
| 889| 889| 	}
| 890| 890| 	return nbcell ? total / nbcell : 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 804| 804| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 805| 805| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 806| 806| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 807|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 807|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 808| 808| 	}
| 809| 809| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 810| 810| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1323|1323| 		}
|1324|1324| 	}
|1325|1325| 	else
|1326|    |-	{
|    |1326|+	
|1327|1327| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1328|1328| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1329|1329| 		// wall piece.
|1344|1344| 			"pos": start.pos,
|1345|1345| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1346|1346| 		});
|1347|    |-	}
|    |1347|+	
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|1350| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1347|1347| 	}
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|    |-	{
|    |1350|+	
|1351|1351| 		// Analogous to the starting side case above
|1352|1352| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1353|1353| 		{
|1385|1385| 				"pos": end.pos,
|1386|1386| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1387|1387| 			});
|1388|    |-	}
|    |1388|+	
|1389|1389| 
|1390|1390| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1391|1391| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1563|1563| 
|1564|1564| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1565|1565| 		if (cmpVisual)
|1566|    |-		{
|    |1566|+		
|1567|1567| 			if (!allPiecesValid || !canAfford)
|1568|1568| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1569|1569| 			else
|1570|1570| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1571|    |-		}
|    |1571|+		
|1572|1572| 
|1573|1573| 		++entPool.numUsed;
|1574|1574| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1637|1637| 			{
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|    |-						"x": pos.x,
|    |1640|+					"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|    |-						"z": pos.z,
|    |1641|+					"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|    |-						"angle": cmpPosition.GetRotation().y,
|    |1642|+					"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|    |-						"ent": ent
|    |1643|+					"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|1646|1646| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1785|1785| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1786|1786| 	}
|1787|1787| 	else if (data.target === secondMarket)
|1788|    |-	{
|    |1788|+	
|1789|1789| 		result = {
|1790|1790| 			"type": "is second",
|1791|1791| 			"gain": cmpEntityTrader.GetGoods().amount,
|1792|1792| 		};
|1793|    |-	}
|    |1793|+	
|1794|1794| 	else if (!firstMarket)
|1795|1795| 	{
|1796|1796| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1792|1792| 		};
|1793|1793| 	}
|1794|1794| 	else if (!firstMarket)
|1795|    |-	{
|    |1795|+	
|1796|1796| 		result = { "type": "set first" };
|1797|    |-	}
|    |1797|+	
|1798|1798| 	else if (!secondMarket)
|1799|1799| 	{
|1800|1800| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1796|1796| 		result = { "type": "set first" };
|1797|1797| 	}
|1798|1798| 	else if (!secondMarket)
|1799|    |-	{
|    |1799|+	
|1800|1800| 		result = {
|1801|1801| 			"type": "set second",
|1802|1802| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1803|1803| 		};
|1804|    |-	}
|    |1804|+	
|1805|1805| 	else
|1806|1806| 	{
|1807|1807| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1803|1803| 		};
|1804|1804| 	}
|1805|1805| 	else
|1806|    |-	{
|    |1806|+	
|1807|1807| 		// Else both markets are not null and target is different from them
|1808|1808| 		result = { "type": "set first" };
|1809|    |-	}
|    |1809|+	
|1810|1810| 	return result;
|1811|1811| };
|1812|1812| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/911/

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  10|  10| 
|  11|  11| 	var ret = {};
|  12|  12| 	for (var i in this)
|  13|    |-	{
|    |  13|+	
|  14|  14| 		if (this.hasOwnProperty(i))
|  15|  15| 			ret[i] = this[i];
|  16|    |-	}
|    |  16|+	
|  17|  17| 	ret.modificationCache = {};
|  18|  18| 	return ret;
|  19|  19| };
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  64|  64| 	for (let key of this.unresearchedAutoResearchTechs)
|  65|  65| 	{
|  66|  66| 		let tech = TechnologyTemplates.Get(key);
|  67|    |-		if ((tech.autoResearch && this.CanResearch(key))
|  68|    |-			|| (tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|    |  67|+		if ((tech.autoResearch && this.CanResearch(key)) ||
|    |  68|+			(tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|  69|  69| 		{
|  70|  70| 			this.unresearchedAutoResearchTechs.delete(key);
|  71|  71| 			this.ResearchTechnology(key);
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  75|  75| };
|  76|  76| 
|  77|  77| // Checks an entity template to see if its technology requirements have been met
|  78|    |-TechnologyManager.prototype.CanProduce = function (templateName)
|    |  78|+TechnologyManager.prototype.CanProduce = function(templateName)
|  79|  79| {
|  80|  80| 	let cmpTempManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|  81|  81| 	let template = cmpTempManager.GetTemplate(templateName);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  98|  98| 
|  99|  99| TechnologyManager.prototype.AreTechnologiesResearched = function(techs)
| 100| 100| {
| 101|    |-	for (let tech of techs) {
|    | 101|+	for (let tech of techs) 
| 102| 102| 		if (!this.researchedTechs.has(tech))
| 103| 103| 			return false;
| 104|    |-	}
|    | 104|+	
| 105| 105| 	return true;
| 106| 106| }
| 107| 107| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 103| 103| 			return false;
| 104| 104| 	}
| 105| 105| 	return true;
| 106|    |-}
|    | 106|+};
| 107| 107| 
| 108| 108| TechnologyManager.prototype.IsTechnologyStarted = function(tech)
| 109| 109| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 202| 202| 		var classes = cmpIdentity.GetClassesList();
| 203| 203| 		// don't use foundations for the class counts but check if techs apply (e.g. health increase)
| 204| 204| 		if (!Engine.QueryInterface(msg.entity, IID_Foundation))
| 205|    |-		{
|    | 205|+		
| 206| 206| 			for (let cls of classes)
| 207| 207| 			{
| 208| 208| 				this.classCounts[cls] = this.classCounts[cls] || 0;
| 212| 212| 				this.typeCountsByClass[cls][template] = this.typeCountsByClass[cls][template] || 0;
| 213| 213| 				this.typeCountsByClass[cls][template] += 1;
| 214| 214| 			}
| 215|    |-		}
|    | 215|+		
| 216| 216| 
| 217| 217| 		// Newly created entity, check if any researched techs might apply
| 218| 218| 		// (only do this for new entities because even if an entity is converted or captured,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 295| 295| 	}
| 296| 296| 
| 297| 297| 	if (template.replaces && template.replaces.length > 0)
| 298|    |-	{
|    | 298|+	
| 299| 299| 		for (var i of template.replaces)
| 300| 300| 		{
| 301| 301| 			if (!i || this.IsTechnologyResearched(i))
| 313| 313| 					cmpPlayerEntityLimits.UpdateLimitsFromTech(i);
| 314| 314| 			}
| 315| 315| 		}
| 316|    |-	}
|    | 316|+	
| 317| 317| 
| 318| 318| 	this.UpdateAutoResearch();
| 319| 319| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 331| 331| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 332| 332| 
| 333| 333| 	// always send research finished message
| 334|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 334|+	Engine.PostMessage(this.entity, MT_ResearchFinished, { "player": playerID, "tech": tech});
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 331| 331| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 332| 332| 
| 333| 333| 	// always send research finished message
| 334|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 334|+	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech });
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
| 338|    |-		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
|    | 338|+		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component] });
| 339| 339| 		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
| 340| 340| 	}
| 341| 341| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
| 338| 338| 		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
| 339|    |-		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
|    | 339|+		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component] });
| 340| 340| 	}
| 341| 341| 
| 342| 342| 	if (tech.startsWith("phase") && !template.autoResearch)
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 458| 458|  */
| 459| 459| TechnologyManager.prototype.GetResearcher = function(tech)
| 460| 460| {
| 461|    |-	return this.researchQueued.get(tech)
|    | 461|+	return this.researchQueued.get(tech);
| 462| 462| };
| 463| 463| 
| 464| 464| /**

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 101| »   for·(let·tech·of·techs)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 229| ·»   »   »   »   »   if·(DoesModificationApply(modif,·classes))
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/TechnologyManager.js
|  68| »   »   »   ||·(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
| 106| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 238| »   »   »   for·(var·component·in·modifiedComponents)
|    | [NORMAL] JSHintBear:
|    | 'component' is already defined.

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

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

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 461| »   return·this.researchQueued.get(tech)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 393| 393| function getRepairTimeTooltip(entState)
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396|    |-			"label": headerFont(translate("Number of repairers:")),
|    | 396|+		"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397|    |-			"details": entState.repairable.numBuilders
|    | 397|+		"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398|    |-		}) + "\n" + (entState.repairable.numBuilders ?
|    | 398|+	}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
| 401| 401| 			"Add another worker to speed up the repairs by %(second)s seconds.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 415| 415| function getBuildTimeTooltip(entState)
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418|    |-			"label": headerFont(translate("Number of builders:")),
|    | 418|+		"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419|    |-			"details": entState.foundation.numBuilders
|    | 419|+		"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420|    |-		}) + "\n" + (entState.foundation.numBuilders ?
|    | 420|+	}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
| 423| 423| 			"Add another worker to speed up the construction by %(second)s seconds.",
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 214| 214| 
| 215| 215| m.GameState.prototype.areResearched = function(techs)
| 216| 216| {
| 217|    |-	for (let tech of techs) {
|    | 217|+	for (let tech of techs) 
| 218| 218| 		if (!this.playerData.researchedTechs.has(tech))
| 219| 219| 			return false;
| 220|    |-	}
|    | 220|+	
| 221| 221| 	return true;
| 222| 222| }
| 223| 223| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 219| 219| 			return false;
| 220| 220| 	}
| 221| 221| 	return true;
| 222|    |-}
|    | 222|+};
| 223| 223| 
| 224| 224| /** true if started or queued */
| 225| 225| m.GameState.prototype.isResearching = function(template)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 619| 619| 	else if (template.resourceSupplyType() !== undefined)	// animal resources
| 620| 620| 		count += this.countEntitiesByType("resource|" + type, true);
| 621| 621| 	else
| 622|    |-	{
|    | 622|+	
| 623| 623| 		// Count entities in building production queues
| 624| 624| 		// TODO: maybe this fails for corrals.
| 625| 625| 		this.getOwnTrainingFacilities().forEach(function(ent) {
| 627| 627| 				if (item.unitTemplate == type)
| 628| 628| 					count += item.count;
| 629| 629| 		});
| 630|    |-	}
|    | 630|+	
| 631| 631| 
| 632| 632| 	return count;
| 633| 633| };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 779| 779| 				ret.push([techs[1]._templateName, techs[1]]);
| 780| 780| 		}
| 781| 781| 		else if (this.canResearch(tech))
| 782|    |-		{
|    | 782|+		
| 783| 783| 			// Phases are treated separately
| 784| 784| 			if (this.phases.every(phase => template._templateName != phase.name))
| 785| 785| 				ret.push([tech, template]);
| 786|    |-		}
|    | 786|+		
| 787| 787| 	}
| 788| 788| 	return ret;
| 789| 789| };

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 217| »   for·(let·tech·of·techs)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 278| »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 295| »   »   »   switch·(type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 222| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  33|  33| 		{
|  34|  34| 			let args = string.split("/");
|  35|  35| 			for (let arg of args)
|  36|    |-			{
|    |  36|+			
|  37|  37| 				if (value[arg])
|  38|  38| 					value = value[arg];
|  39|  39| 				else
|  41|  41| 					value = undefined;
|  42|  42| 					break;
|  43|  43| 				}
|  44|    |-			}
|    |  44|+			
|  45|  45| 			this._tpCache.set(string, value);
|  46|  46| 		}
|  47|  47| 		return this._tpCache.get(string);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  80|  80| 		return true;
|  81|  81| 	},
|  82|  82| 
|  83|    |-	"requiredTechs": function() { 
|    |  83|+	"requiredTechs": function() {
|  84|  84| 		let requiredTechnologies = this.get("Identity/RequiredTechnologies");
|  85|  85| 		if (requiredTechnologies && requiredTechnologies._string)
|  86|  86| 			return requiredTechnologies._string.split(/\s+/);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
| 314| 314| 			return undefined;
| 315| 315| 
| 316| 316| 		if (this.get("Attack/" + type + "/Bonuses"))
| 317|    |-		{
|    | 317|+		
| 318| 318| 			for (let b in this.get("Attack/" + type + "/Bonuses"))
| 319| 319| 			{
| 320| 320| 				let bonusClasses = this.get("Attack/" + type + "/Bonuses/" + b + "/Classes");
| 324| 324| 					if (bcl == againstClass)
| 325| 325| 						return +this.get("Attack/" + type + "/Bonuses/" + b + "/Multiplier");
| 326| 326| 			}
| 327|    |-		}
|    | 327|+		
| 328| 328| 		return 1;
| 329| 329| 	},
| 330| 330| 

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 101| »   »   for·(let·techRequired·of·techsRequired)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 804| »   »   if·(this.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 821| »   »   if·(this.position()·!==·undefined·&&·unitToFleeFrom.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 226| 226| 		{
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229|    |-					"name": aura.auraName,
|    | 229|+				"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230|    |-					"description": aura.auraDescription || null,
|    | 230|+				"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231|    |-					"radius": aura.radius || null
|    | 231|+				"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
| 234| 234| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232|    |-				};
|    | 232|+			};
| 233| 233| 		}
| 234| 234| 	}
| 235| 235| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 389| 389| 		ret.icon = template.Identity.Icon;
| 390| 390| 		ret.tooltip = template.Identity.Tooltip;
| 391| 391| 		ret.requiredTechnologies = [];
| 392|    |-		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) {
|    | 392|+		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) 
| 393| 393| 			ret.requiredTechnologies = template.Identity.RequiredTechnologies._string.split(/\s+/);
| 394|    |-		}
|    | 394|+		
| 395| 395| 		ret.visibleIdentityClasses = GetVisibleIdentityClasses(template.Identity);
| 396| 396| 		ret.nativeCiv = template.Identity.Civ;
| 397| 397| 	}

binaries/data/mods/public/globalscripts/Templates.js
| 392| »   »   if·(template.Identity.RequiredTechnologies·&&·template.Identity.RequiredTechnologies._string)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
| 100| 100| 	this.visibleClassesList = GetVisibleIdentityClasses(this.template);
| 101| 101| };
| 102| 102| 
| 103|    |-Identity.prototype.Deserialize = function ()
|    | 103|+Identity.prototype.Deserialize = function()
| 104| 104| {
| 105| 105| 	this.Init();
| 106| 106| };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 452| 452| 				continue;
| 453| 453| 
| 454| 454| 			if (state.pack.progress == 0)
| 455|    |-			{
|    | 455|+			
| 456| 456| 				if (state.pack.packed)
| 457| 457| 					checks.unpackButton = true;
| 458| 458| 				else
| 459| 459| 					checks.packButton = true;
| 460|    |-			}
|    | 460|+			
| 461| 461| 			else if (state.pack.packed)
| 462| 462| 				checks.unpackCancelButton = true;
| 463| 463| 			else
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 763| 763| 				addResearchToQueue(data.item.researchFacilityId, t);
| 764| 764| 			})(tech);
| 765| 765| 
| 766|    |-			button.onPressRight = (t => function () {
|    | 766|+			button.onPressRight = (t => function() {
| 767| 767| 				showTemplateDetails(
| 768| 768| 					t,
| 769| 769| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 941| 941| 			"player": data.player
| 942| 942| 		});
| 943| 943| 
| 944|    |-		let unitIds = data.unitEntStates.map(status => status.id)
|    | 944|+		let unitIds = data.unitEntStates.map(status => status.id);
| 945| 945| 		let [buildingsCountToTrainFullBatch, fullBatchSize, remainderBatch] =
| 946| 946| 			getTrainingStatus(unitIds, data.item, data.playerState);
| 947| 947| 

binaries/data/mods/public/gui/session/selection_panels.js
|  48| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  59| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 731| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 944| »   »   let·unitIds·=·data.unitEntStates.map(status·=>·status.id)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 804| 804| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 805| 805| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 806| 806| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 807|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 807|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 808| 808| 	}
| 809| 809| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 810| 810| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1323|1323| 		}
|1324|1324| 	}
|1325|1325| 	else
|1326|    |-	{
|    |1326|+	
|1327|1327| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1328|1328| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1329|1329| 		// wall piece.
|1344|1344| 			"pos": start.pos,
|1345|1345| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1346|1346| 		});
|1347|    |-	}
|    |1347|+	
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|1350| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1347|1347| 	}
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|    |-	{
|    |1350|+	
|1351|1351| 		// Analogous to the starting side case above
|1352|1352| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1353|1353| 		{
|1385|1385| 				"pos": end.pos,
|1386|1386| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1387|1387| 			});
|1388|    |-	}
|    |1388|+	
|1389|1389| 
|1390|1390| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1391|1391| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1563|1563| 
|1564|1564| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1565|1565| 		if (cmpVisual)
|1566|    |-		{
|    |1566|+		
|1567|1567| 			if (!allPiecesValid || !canAfford)
|1568|1568| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1569|1569| 			else
|1570|1570| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1571|    |-		}
|    |1571|+		
|1572|1572| 
|1573|1573| 		++entPool.numUsed;
|1574|1574| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1637|1637| 			{
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|    |-						"x": pos.x,
|    |1640|+					"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|    |-						"z": pos.z,
|    |1641|+					"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|    |-						"angle": cmpPosition.GetRotation().y,
|    |1642|+					"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|    |-						"ent": ent
|    |1643|+					"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|1646|1646| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1785|1785| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1786|1786| 	}
|1787|1787| 	else if (data.target === secondMarket)
|1788|    |-	{
|    |1788|+	
|1789|1789| 		result = {
|1790|1790| 			"type": "is second",
|1791|1791| 			"gain": cmpEntityTrader.GetGoods().amount,
|1792|1792| 		};
|1793|    |-	}
|    |1793|+	
|1794|1794| 	else if (!firstMarket)
|1795|1795| 	{
|1796|1796| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1792|1792| 		};
|1793|1793| 	}
|1794|1794| 	else if (!firstMarket)
|1795|    |-	{
|    |1795|+	
|1796|1796| 		result = { "type": "set first" };
|1797|    |-	}
|    |1797|+	
|1798|1798| 	else if (!secondMarket)
|1799|1799| 	{
|1800|1800| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1796|1796| 		result = { "type": "set first" };
|1797|1797| 	}
|1798|1798| 	else if (!secondMarket)
|1799|    |-	{
|    |1799|+	
|1800|1800| 		result = {
|1801|1801| 			"type": "set second",
|1802|1802| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1803|1803| 		};
|1804|    |-	}
|    |1804|+	
|1805|1805| 	else
|1806|1806| 	{
|1807|1807| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1803|1803| 		};
|1804|1804| 	}
|1805|1805| 	else
|1806|    |-	{
|    |1806|+	
|1807|1807| 		// Else both markets are not null and target is different from them
|1808|1808| 		result = { "type": "set first" };
|1809|    |-	}
|    |1809|+	
|1810|1810| 	return result;
|1811|1811| };
|1812|1812| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|  97|  97| 	else if (pos.xx === undefined || pos.x == pos.xx && pos.z == pos.zz)
|  98|  98| 		builder.construct(this.type, pos.x, pos.z, pos.angle, this.metadata);
|  99|  99| 	else // try with the lowest, move towards us unless we're same
| 100|    |-	{
|    | 100|+	
| 101| 101| 		for (let step = 0; step <= 1; step += 0.2)
| 102| 102| 			builder.construct(this.type, step*pos.x + (1-step)*pos.xx, step*pos.z + (1-step)*pos.zz,
| 103| 103| 				pos.angle, this.metadata);
| 104|    |-	}
|    | 104|+	
| 105| 105| 	this.onStart(gameState);
| 106| 106| 	Engine.ProfileStop();
| 107| 107| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 131| 131| 	}
| 132| 132| 
| 133| 133| 	if (!this.position)
| 134|    |-	{
|    | 134|+	
| 135| 135| 		if (template.hasClass("CivCentre"))
| 136| 136| 		{
| 137| 137| 			let pos;
| 177| 177| 			else if (!pos)
| 178| 178| 				return false;
| 179| 179| 		}
| 180|    |-	}
|    | 180|+	
| 181| 181| 
| 182| 182| 	// Compute each tile's closeness to friendly structures:
| 183| 183| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 204| 204| 					placement.set(j, 45);
| 205| 205| 		}
| 206| 206| 		else
| 207|    |-		{
|    | 207|+		
| 208| 208| 			for (let j = 0; j < placement.map.length; ++j)
| 209| 209| 				if (HQ.basesMap.map[j] != 0)
| 210| 210| 					placement.set(j, 45);
| 211|    |-		}
|    | 211|+		
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214| 214| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 211| 211| 		}
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214|    |-		{
|    | 214|+		
| 215| 215| 			gameState.getOwnStructures().forEach(function(ent) {
| 216| 216| 				let pos = ent.position();
| 217| 217| 				let x = Math.round(pos[0] / cellSize);
| 245| 245| 				else if (template.genericName() == "Rotary Mill" && ent.hasClass("Field"))
| 246| 246| 					placement.addInfluence(x, z, 60/cellSize, 40);
| 247| 247| 			});
| 248|    |-		}
|    | 248|+		
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250| 250| 		{
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 219| 219| 
| 220| 220| 				let struct = m.getBuiltEntity(gameState, ent);
| 221| 221| 				if (struct.resourceDropsiteTypes() && struct.resourceDropsiteTypes().indexOf("food") != -1)
| 222|    |-				{
|    | 222|+				
| 223| 223| 					if (template.hasClass("Field") || template.hasClass("Corral"))
| 224| 224| 						placement.addInfluence(x, z, 80/cellSize, 50);
| 225| 225| 					else // If this is not a field add a negative influence because we want to leave this area for fields
| 226| 226| 						placement.addInfluence(x, z, 80/cellSize, -20);
| 227|    |-				}
|    | 227|+				
| 228| 228| 				else if (template.hasClass("House"))
| 229| 229| 				{
| 230| 230| 					if (ent.hasClass("House"))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 247| 247| 			});
| 248| 248| 		}
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250|    |-		{
|    | 250|+		
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
| 252| 252| 			{
| 253| 253| 				let value = placement.map[j] - gameState.sharedScript.resourceMaps.wood.map[j]/3;
| 255| 255| 					value /= 2;	// we need space around farmstead, so disfavor map border
| 256| 256| 				placement.set(j, value);
| 257| 257| 			}
| 258|    |-		}
|    | 258|+		
| 259| 259| 	}
| 260| 260| 
| 261| 261| 	// Requires to be inside our territory, and inside our base territory if required
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 268| 268| 	{
| 269| 269| 		let base = this.metadata.base;
| 270| 270| 		for (let j = 0; j < placement.map.length; ++j)
| 271|    |-		{
|    | 271|+		
| 272| 272| 			if (HQ.basesMap.map[j] != base)
| 273| 273| 				placement.map[j] = 0;
| 274| 274| 			else if (placement.map[j] > 0)
| 283| 283| 				if (HQ.isNearInvadingArmy([x, z]))
| 284| 284| 					placement.map[j] = 0;
| 285| 285| 			}
| 286|    |-		}
|    | 286|+		
| 287| 287| 	}
| 288| 288| 	else
| 289| 289| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 286| 286| 		}
| 287| 287| 	}
| 288| 288| 	else
| 289|    |-	{
|    | 289|+	
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291| 291| 		{
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308| 308| 		}
| 309|    |-	}
|    | 309|+	
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
| 312| 312| 	// Find target building's approximate obstruction radius, and expand by a bit to make sure we're not too close,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 288| 288| 	else
| 289| 289| 	{
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291|    |-		{
|    | 291|+		
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 293| 293| 				placement.map[j] = 0;
| 294| 294| 			else if (placement.map[j] > 0)
| 305| 305| 				else if (favoredBase && HQ.basesMap.map[j] == favoredBase)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308|    |-		}
|    | 308|+		
| 309| 309| 	}
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 650| 650| 		{
| 651| 651| 			let count = 0;
| 652| 652| 			for (let j = 0; j < length-1; ++j)
| 653|    |-			{
|    | 653|+			
| 654| 654| 				if ((waterPoints[(i + j) % length]+1) % numPoints == waterPoints[(i + j + 1) % length])
| 655| 655| 					++count;
| 656| 656| 				else
| 657| 657| 					break;
| 658|    |-			}
|    | 658|+			
| 659| 659| 			consec[i] = count;
| 660| 660| 		}
| 661| 661| 		let start = 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 661| 661| 		let start = 0;
| 662| 662| 		let count = 0;
| 663| 663| 		for (let c in consec)
| 664|    |-		{
|    | 664|+		
| 665| 665| 			if (consec[c] > count)
| 666| 666| 			{
| 667| 667| 				start = c;
| 668| 668| 				count = consec[c];
| 669| 669| 			}
| 670|    |-		}
|    | 670|+		
| 671| 671| 
| 672| 672| 		// If we've found a shoreline, stop searching
| 673| 673| 		if (count != numPoints-1)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87, -0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50, -0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0, -1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50, -0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87, -0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 857| 857| 			let dxmax = size - dy;
| 858| 858| 			let ky = iy + dy;
| 859| 859| 			if (ky >= 0 && ky < w)
| 860|    |-			{
|    | 860|+			
| 861| 861| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 862| 862| 				{
| 863| 863| 					let kx = ix + dx;
| 868| 868| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 869| 869| 					nbcell += weight;
| 870| 870| 				}
| 871|    |-			}
|    | 871|+			
| 872| 872| 			if (dy == 0)
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
| 875| 875| 			if (ky >= 0 && ky < w)
| 876|    |-			{
|    | 876|+			
| 877| 877| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 878| 878| 				{
| 879| 879| 					let kx = ix + dx;
| 884| 884| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 885| 885| 					nbcell += weight;
| 886| 886| 				}
| 887|    |-			}
|    | 887|+			
| 888| 888| 		}
| 889| 889| 	}
| 890| 890| 	return nbcell ? total / nbcell : 0;
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/912/

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.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 226| 226| 		{
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229|    |-					"name": aura.auraName,
|    | 229|+				"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230|    |-					"description": aura.auraDescription || null,
|    | 230|+				"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231|    |-					"radius": aura.radius || null
|    | 231|+				"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
| 234| 234| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232|    |-				};
|    | 232|+			};
| 233| 233| 		}
| 234| 234| 	}
| 235| 235| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 389| 389| 		ret.icon = template.Identity.Icon;
| 390| 390| 		ret.tooltip = template.Identity.Tooltip;
| 391| 391| 		ret.requiredTechnologies = [];
| 392|    |-		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) {
|    | 392|+		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) 
| 393| 393| 			ret.requiredTechnologies = template.Identity.RequiredTechnologies._string.split(/\s+/);
| 394|    |-		}
|    | 394|+		
| 395| 395| 		ret.visibleIdentityClasses = GetVisibleIdentityClasses(template.Identity);
| 396| 396| 		ret.nativeCiv = template.Identity.Civ;
| 397| 397| 	}

binaries/data/mods/public/globalscripts/Templates.js
| 392| »   »   if·(template.Identity.RequiredTechnologies·&&·template.Identity.RequiredTechnologies._string)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
| 100| 100| 	this.visibleClassesList = GetVisibleIdentityClasses(this.template);
| 101| 101| };
| 102| 102| 
| 103|    |-Identity.prototype.Deserialize = function ()
|    | 103|+Identity.prototype.Deserialize = function()
| 104| 104| {
| 105| 105| 	this.Init();
| 106| 106| };
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 393| 393| function getRepairTimeTooltip(entState)
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396|    |-			"label": headerFont(translate("Number of repairers:")),
|    | 396|+		"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397|    |-			"details": entState.repairable.numBuilders
|    | 397|+		"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398|    |-		}) + "\n" + (entState.repairable.numBuilders ?
|    | 398|+	}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
| 401| 401| 			"Add another worker to speed up the repairs by %(second)s seconds.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 415| 415| function getBuildTimeTooltip(entState)
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418|    |-			"label": headerFont(translate("Number of builders:")),
|    | 418|+		"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419|    |-			"details": entState.foundation.numBuilders
|    | 419|+		"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420|    |-		}) + "\n" + (entState.foundation.numBuilders ?
|    | 420|+	}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
| 423| 423| 			"Add another worker to speed up the construction by %(second)s seconds.",
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|  97|  97| 	else if (pos.xx === undefined || pos.x == pos.xx && pos.z == pos.zz)
|  98|  98| 		builder.construct(this.type, pos.x, pos.z, pos.angle, this.metadata);
|  99|  99| 	else // try with the lowest, move towards us unless we're same
| 100|    |-	{
|    | 100|+	
| 101| 101| 		for (let step = 0; step <= 1; step += 0.2)
| 102| 102| 			builder.construct(this.type, step*pos.x + (1-step)*pos.xx, step*pos.z + (1-step)*pos.zz,
| 103| 103| 				pos.angle, this.metadata);
| 104|    |-	}
|    | 104|+	
| 105| 105| 	this.onStart(gameState);
| 106| 106| 	Engine.ProfileStop();
| 107| 107| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 131| 131| 	}
| 132| 132| 
| 133| 133| 	if (!this.position)
| 134|    |-	{
|    | 134|+	
| 135| 135| 		if (template.hasClass("CivCentre"))
| 136| 136| 		{
| 137| 137| 			let pos;
| 177| 177| 			else if (!pos)
| 178| 178| 				return false;
| 179| 179| 		}
| 180|    |-	}
|    | 180|+	
| 181| 181| 
| 182| 182| 	// Compute each tile's closeness to friendly structures:
| 183| 183| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 204| 204| 					placement.set(j, 45);
| 205| 205| 		}
| 206| 206| 		else
| 207|    |-		{
|    | 207|+		
| 208| 208| 			for (let j = 0; j < placement.map.length; ++j)
| 209| 209| 				if (HQ.basesMap.map[j] != 0)
| 210| 210| 					placement.set(j, 45);
| 211|    |-		}
|    | 211|+		
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214| 214| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 211| 211| 		}
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214|    |-		{
|    | 214|+		
| 215| 215| 			gameState.getOwnStructures().forEach(function(ent) {
| 216| 216| 				let pos = ent.position();
| 217| 217| 				let x = Math.round(pos[0] / cellSize);
| 245| 245| 				else if (template.genericName() == "Rotary Mill" && ent.hasClass("Field"))
| 246| 246| 					placement.addInfluence(x, z, 60/cellSize, 40);
| 247| 247| 			});
| 248|    |-		}
|    | 248|+		
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250| 250| 		{
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 219| 219| 
| 220| 220| 				let struct = m.getBuiltEntity(gameState, ent);
| 221| 221| 				if (struct.resourceDropsiteTypes() && struct.resourceDropsiteTypes().indexOf("food") != -1)
| 222|    |-				{
|    | 222|+				
| 223| 223| 					if (template.hasClass("Field") || template.hasClass("Corral"))
| 224| 224| 						placement.addInfluence(x, z, 80/cellSize, 50);
| 225| 225| 					else // If this is not a field add a negative influence because we want to leave this area for fields
| 226| 226| 						placement.addInfluence(x, z, 80/cellSize, -20);
| 227|    |-				}
|    | 227|+				
| 228| 228| 				else if (template.hasClass("House"))
| 229| 229| 				{
| 230| 230| 					if (ent.hasClass("House"))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 247| 247| 			});
| 248| 248| 		}
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250|    |-		{
|    | 250|+		
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
| 252| 252| 			{
| 253| 253| 				let value = placement.map[j] - gameState.sharedScript.resourceMaps.wood.map[j]/3;
| 255| 255| 					value /= 2;	// we need space around farmstead, so disfavor map border
| 256| 256| 				placement.set(j, value);
| 257| 257| 			}
| 258|    |-		}
|    | 258|+		
| 259| 259| 	}
| 260| 260| 
| 261| 261| 	// Requires to be inside our territory, and inside our base territory if required
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 268| 268| 	{
| 269| 269| 		let base = this.metadata.base;
| 270| 270| 		for (let j = 0; j < placement.map.length; ++j)
| 271|    |-		{
|    | 271|+		
| 272| 272| 			if (HQ.basesMap.map[j] != base)
| 273| 273| 				placement.map[j] = 0;
| 274| 274| 			else if (placement.map[j] > 0)
| 283| 283| 				if (HQ.isNearInvadingArmy([x, z]))
| 284| 284| 					placement.map[j] = 0;
| 285| 285| 			}
| 286|    |-		}
|    | 286|+		
| 287| 287| 	}
| 288| 288| 	else
| 289| 289| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 286| 286| 		}
| 287| 287| 	}
| 288| 288| 	else
| 289|    |-	{
|    | 289|+	
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291| 291| 		{
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308| 308| 		}
| 309|    |-	}
|    | 309|+	
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
| 312| 312| 	// Find target building's approximate obstruction radius, and expand by a bit to make sure we're not too close,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 288| 288| 	else
| 289| 289| 	{
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291|    |-		{
|    | 291|+		
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 293| 293| 				placement.map[j] = 0;
| 294| 294| 			else if (placement.map[j] > 0)
| 305| 305| 				else if (favoredBase && HQ.basesMap.map[j] == favoredBase)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308|    |-		}
|    | 308|+		
| 309| 309| 	}
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 650| 650| 		{
| 651| 651| 			let count = 0;
| 652| 652| 			for (let j = 0; j < length-1; ++j)
| 653|    |-			{
|    | 653|+			
| 654| 654| 				if ((waterPoints[(i + j) % length]+1) % numPoints == waterPoints[(i + j + 1) % length])
| 655| 655| 					++count;
| 656| 656| 				else
| 657| 657| 					break;
| 658|    |-			}
|    | 658|+			
| 659| 659| 			consec[i] = count;
| 660| 660| 		}
| 661| 661| 		let start = 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 661| 661| 		let start = 0;
| 662| 662| 		let count = 0;
| 663| 663| 		for (let c in consec)
| 664|    |-		{
|    | 664|+		
| 665| 665| 			if (consec[c] > count)
| 666| 666| 			{
| 667| 667| 				start = c;
| 668| 668| 				count = consec[c];
| 669| 669| 			}
| 670|    |-		}
|    | 670|+		
| 671| 671| 
| 672| 672| 		// If we've found a shoreline, stop searching
| 673| 673| 		if (count != numPoints-1)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87, -0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50, -0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0, -1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50, -0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87, -0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 857| 857| 			let dxmax = size - dy;
| 858| 858| 			let ky = iy + dy;
| 859| 859| 			if (ky >= 0 && ky < w)
| 860|    |-			{
|    | 860|+			
| 861| 861| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 862| 862| 				{
| 863| 863| 					let kx = ix + dx;
| 868| 868| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 869| 869| 					nbcell += weight;
| 870| 870| 				}
| 871|    |-			}
|    | 871|+			
| 872| 872| 			if (dy == 0)
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
| 875| 875| 			if (ky >= 0 && ky < w)
| 876|    |-			{
|    | 876|+			
| 877| 877| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 878| 878| 				{
| 879| 879| 					let kx = ix + dx;
| 884| 884| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 885| 885| 					nbcell += weight;
| 886| 886| 				}
| 887|    |-			}
|    | 887|+			
| 888| 888| 		}
| 889| 889| 	}
| 890| 890| 	return nbcell ? total / nbcell : 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  10|  10| 
|  11|  11| 	var ret = {};
|  12|  12| 	for (var i in this)
|  13|    |-	{
|    |  13|+	
|  14|  14| 		if (this.hasOwnProperty(i))
|  15|  15| 			ret[i] = this[i];
|  16|    |-	}
|    |  16|+	
|  17|  17| 	ret.modificationCache = {};
|  18|  18| 	return ret;
|  19|  19| };
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  64|  64| 	for (let key of this.unresearchedAutoResearchTechs)
|  65|  65| 	{
|  66|  66| 		let tech = TechnologyTemplates.Get(key);
|  67|    |-		if ((tech.autoResearch && this.CanResearch(key))
|  68|    |-			|| (tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|    |  67|+		if ((tech.autoResearch && this.CanResearch(key)) ||
|    |  68|+			(tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|  69|  69| 		{
|  70|  70| 			this.unresearchedAutoResearchTechs.delete(key);
|  71|  71| 			this.ResearchTechnology(key);
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  75|  75| };
|  76|  76| 
|  77|  77| // Checks an entity template to see if its technology requirements have been met
|  78|    |-TechnologyManager.prototype.CanProduce = function (templateName)
|    |  78|+TechnologyManager.prototype.CanProduce = function(templateName)
|  79|  79| {
|  80|  80| 	let cmpTempManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|  81|  81| 	let template = cmpTempManager.GetTemplate(templateName);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  98|  98| 
|  99|  99| TechnologyManager.prototype.AreTechnologiesResearched = function(techs)
| 100| 100| {
| 101|    |-	for (let tech of techs) {
|    | 101|+	for (let tech of techs) 
| 102| 102| 		if (!this.researchedTechs.has(tech))
| 103| 103| 			return false;
| 104|    |-	}
|    | 104|+	
| 105| 105| 	return true;
| 106| 106| }
| 107| 107| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 103| 103| 			return false;
| 104| 104| 	}
| 105| 105| 	return true;
| 106|    |-}
|    | 106|+};
| 107| 107| 
| 108| 108| TechnologyManager.prototype.IsTechnologyStarted = function(tech)
| 109| 109| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 202| 202| 		var classes = cmpIdentity.GetClassesList();
| 203| 203| 		// don't use foundations for the class counts but check if techs apply (e.g. health increase)
| 204| 204| 		if (!Engine.QueryInterface(msg.entity, IID_Foundation))
| 205|    |-		{
|    | 205|+		
| 206| 206| 			for (let cls of classes)
| 207| 207| 			{
| 208| 208| 				this.classCounts[cls] = this.classCounts[cls] || 0;
| 212| 212| 				this.typeCountsByClass[cls][template] = this.typeCountsByClass[cls][template] || 0;
| 213| 213| 				this.typeCountsByClass[cls][template] += 1;
| 214| 214| 			}
| 215|    |-		}
|    | 215|+		
| 216| 216| 
| 217| 217| 		// Newly created entity, check if any researched techs might apply
| 218| 218| 		// (only do this for new entities because even if an entity is converted or captured,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 295| 295| 	}
| 296| 296| 
| 297| 297| 	if (template.replaces && template.replaces.length > 0)
| 298|    |-	{
|    | 298|+	
| 299| 299| 		for (var i of template.replaces)
| 300| 300| 		{
| 301| 301| 			if (!i || this.IsTechnologyResearched(i))
| 313| 313| 					cmpPlayerEntityLimits.UpdateLimitsFromTech(i);
| 314| 314| 			}
| 315| 315| 		}
| 316|    |-	}
|    | 316|+	
| 317| 317| 
| 318| 318| 	this.UpdateAutoResearch();
| 319| 319| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 331| 331| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 332| 332| 
| 333| 333| 	// always send research finished message
| 334|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 334|+	Engine.PostMessage(this.entity, MT_ResearchFinished, { "player": playerID, "tech": tech});
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 331| 331| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 332| 332| 
| 333| 333| 	// always send research finished message
| 334|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 334|+	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech });
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 335| 335| 
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
| 338|    |-		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
|    | 338|+		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component] });
| 339| 339| 		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
| 340| 340| 	}
| 341| 341| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 336| 336| 	for (var component in modifiedComponents)
| 337| 337| 	{
| 338| 338| 		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
| 339|    |-		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
|    | 339|+		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component] });
| 340| 340| 	}
| 341| 341| 
| 342| 342| 	if (tech.startsWith("phase") && !template.autoResearch)
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 458| 458|  */
| 459| 459| TechnologyManager.prototype.GetResearcher = function(tech)
| 460| 460| {
| 461|    |-	return this.researchQueued.get(tech)
|    | 461|+	return this.researchQueued.get(tech);
| 462| 462| };
| 463| 463| 
| 464| 464| /**

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 101| »   for·(let·tech·of·techs)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 229| ·»   »   »   »   »   if·(DoesModificationApply(modif,·classes))
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/TechnologyManager.js
|  68| »   »   »   ||·(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
| 106| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 238| »   »   »   for·(var·component·in·modifiedComponents)
|    | [NORMAL] JSHintBear:
|    | 'component' is already defined.

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

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

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 461| »   return·this.researchQueued.get(tech)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 214| 214| 
| 215| 215| m.GameState.prototype.areResearched = function(techs)
| 216| 216| {
| 217|    |-	for (let tech of techs) {
|    | 217|+	for (let tech of techs) 
| 218| 218| 		if (!this.playerData.researchedTechs.has(tech))
| 219| 219| 			return false;
| 220|    |-	}
|    | 220|+	
| 221| 221| 	return true;
| 222| 222| }
| 223| 223| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 219| 219| 			return false;
| 220| 220| 	}
| 221| 221| 	return true;
| 222|    |-}
|    | 222|+};
| 223| 223| 
| 224| 224| /** true if started or queued */
| 225| 225| m.GameState.prototype.isResearching = function(template)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 619| 619| 	else if (template.resourceSupplyType() !== undefined)	// animal resources
| 620| 620| 		count += this.countEntitiesByType("resource|" + type, true);
| 621| 621| 	else
| 622|    |-	{
|    | 622|+	
| 623| 623| 		// Count entities in building production queues
| 624| 624| 		// TODO: maybe this fails for corrals.
| 625| 625| 		this.getOwnTrainingFacilities().forEach(function(ent) {
| 627| 627| 				if (item.unitTemplate == type)
| 628| 628| 					count += item.count;
| 629| 629| 		});
| 630|    |-	}
|    | 630|+	
| 631| 631| 
| 632| 632| 	return count;
| 633| 633| };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 779| 779| 				ret.push([techs[1]._templateName, techs[1]]);
| 780| 780| 		}
| 781| 781| 		else if (this.canResearch(tech))
| 782|    |-		{
|    | 782|+		
| 783| 783| 			// Phases are treated separately
| 784| 784| 			if (this.phases.every(phase => template._templateName != phase.name))
| 785| 785| 				ret.push([tech, template]);
| 786|    |-		}
|    | 786|+		
| 787| 787| 	}
| 788| 788| 	return ret;
| 789| 789| };

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 217| »   for·(let·tech·of·techs)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 278| »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 295| »   »   »   switch·(type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 222| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  33|  33| 		{
|  34|  34| 			let args = string.split("/");
|  35|  35| 			for (let arg of args)
|  36|    |-			{
|    |  36|+			
|  37|  37| 				if (value[arg])
|  38|  38| 					value = value[arg];
|  39|  39| 				else
|  41|  41| 					value = undefined;
|  42|  42| 					break;
|  43|  43| 				}
|  44|    |-			}
|    |  44|+			
|  45|  45| 			this._tpCache.set(string, value);
|  46|  46| 		}
|  47|  47| 		return this._tpCache.get(string);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  80|  80| 		return true;
|  81|  81| 	},
|  82|  82| 
|  83|    |-	"requiredTechs": function() { 
|    |  83|+	"requiredTechs": function() {
|  84|  84| 		let requiredTechnologies = this.get("Identity/RequiredTechnologies");
|  85|  85| 		if (requiredTechnologies && requiredTechnologies._string)
|  86|  86| 			return requiredTechnologies._string.split(/\s+/);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
| 314| 314| 			return undefined;
| 315| 315| 
| 316| 316| 		if (this.get("Attack/" + type + "/Bonuses"))
| 317|    |-		{
|    | 317|+		
| 318| 318| 			for (let b in this.get("Attack/" + type + "/Bonuses"))
| 319| 319| 			{
| 320| 320| 				let bonusClasses = this.get("Attack/" + type + "/Bonuses/" + b + "/Classes");
| 324| 324| 					if (bcl == againstClass)
| 325| 325| 						return +this.get("Attack/" + type + "/Bonuses/" + b + "/Multiplier");
| 326| 326| 			}
| 327|    |-		}
|    | 327|+		
| 328| 328| 		return 1;
| 329| 329| 	},
| 330| 330| 

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 101| »   »   for·(let·techRequired·of·techsRequired)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 804| »   »   if·(this.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 821| »   »   if·(this.position()·!==·undefined·&&·unitToFleeFrom.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 452| 452| 				continue;
| 453| 453| 
| 454| 454| 			if (state.pack.progress == 0)
| 455|    |-			{
|    | 455|+			
| 456| 456| 				if (state.pack.packed)
| 457| 457| 					checks.unpackButton = true;
| 458| 458| 				else
| 459| 459| 					checks.packButton = true;
| 460|    |-			}
|    | 460|+			
| 461| 461| 			else if (state.pack.packed)
| 462| 462| 				checks.unpackCancelButton = true;
| 463| 463| 			else
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 763| 763| 				addResearchToQueue(data.item.researchFacilityId, t);
| 764| 764| 			})(tech);
| 765| 765| 
| 766|    |-			button.onPressRight = (t => function () {
|    | 766|+			button.onPressRight = (t => function() {
| 767| 767| 				showTemplateDetails(
| 768| 768| 					t,
| 769| 769| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 941| 941| 			"player": data.player
| 942| 942| 		});
| 943| 943| 
| 944|    |-		let unitIds = data.unitEntStates.map(status => status.id)
|    | 944|+		let unitIds = data.unitEntStates.map(status => status.id);
| 945| 945| 		let [buildingsCountToTrainFullBatch, fullBatchSize, remainderBatch] =
| 946| 946| 			getTrainingStatus(unitIds, data.item, data.playerState);
| 947| 947| 

binaries/data/mods/public/gui/session/selection_panels.js
|  48| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  59| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 731| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 944| »   »   let·unitIds·=·data.unitEntStates.map(status·=>·status.id)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 804| 804| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 805| 805| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 806| 806| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 807|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 807|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 808| 808| 	}
| 809| 809| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 810| 810| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1323|1323| 		}
|1324|1324| 	}
|1325|1325| 	else
|1326|    |-	{
|    |1326|+	
|1327|1327| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1328|1328| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1329|1329| 		// wall piece.
|1344|1344| 			"pos": start.pos,
|1345|1345| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1346|1346| 		});
|1347|    |-	}
|    |1347|+	
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|1350| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1347|1347| 	}
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|    |-	{
|    |1350|+	
|1351|1351| 		// Analogous to the starting side case above
|1352|1352| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1353|1353| 		{
|1385|1385| 				"pos": end.pos,
|1386|1386| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1387|1387| 			});
|1388|    |-	}
|    |1388|+	
|1389|1389| 
|1390|1390| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1391|1391| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1563|1563| 
|1564|1564| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1565|1565| 		if (cmpVisual)
|1566|    |-		{
|    |1566|+		
|1567|1567| 			if (!allPiecesValid || !canAfford)
|1568|1568| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1569|1569| 			else
|1570|1570| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1571|    |-		}
|    |1571|+		
|1572|1572| 
|1573|1573| 		++entPool.numUsed;
|1574|1574| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1637|1637| 			{
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|    |-						"x": pos.x,
|    |1640|+					"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|    |-						"z": pos.z,
|    |1641|+					"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|    |-						"angle": cmpPosition.GetRotation().y,
|    |1642|+					"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|    |-						"ent": ent
|    |1643|+					"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|1646|1646| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1785|1785| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1786|1786| 	}
|1787|1787| 	else if (data.target === secondMarket)
|1788|    |-	{
|    |1788|+	
|1789|1789| 		result = {
|1790|1790| 			"type": "is second",
|1791|1791| 			"gain": cmpEntityTrader.GetGoods().amount,
|1792|1792| 		};
|1793|    |-	}
|    |1793|+	
|1794|1794| 	else if (!firstMarket)
|1795|1795| 	{
|1796|1796| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1792|1792| 		};
|1793|1793| 	}
|1794|1794| 	else if (!firstMarket)
|1795|    |-	{
|    |1795|+	
|1796|1796| 		result = { "type": "set first" };
|1797|    |-	}
|    |1797|+	
|1798|1798| 	else if (!secondMarket)
|1799|1799| 	{
|1800|1800| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1796|1796| 		result = { "type": "set first" };
|1797|1797| 	}
|1798|1798| 	else if (!secondMarket)
|1799|    |-	{
|    |1799|+	
|1800|1800| 		result = {
|1801|1801| 			"type": "set second",
|1802|1802| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1803|1803| 		};
|1804|    |-	}
|    |1804|+	
|1805|1805| 	else
|1806|1806| 	{
|1807|1807| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1803|1803| 		};
|1804|1804| 	}
|1805|1805| 	else
|1806|    |-	{
|    |1806|+	
|1807|1807| 		// Else both markets are not null and target is different from them
|1808|1808| 		result = { "type": "set first" };
|1809|    |-	}
|    |1809|+	
|1810|1810| 	return result;
|1811|1811| };
|1812|1812| 
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/913/

smiley requested changes to this revision.Sat, Jan 5, 6:13 AM
smiley added a subscriber: smiley.

From a quick look at the AI files.

binaries/data/mods/public/simulation/ai/common-api/entity.js
84

This might break, I recall having seen a todo saying ._string values are missing. And IIRC, classes are also derived from a function in globalscript/Templates.js

109

The only relevant code here is id = Math.max(id, 4)
This statement would always be true. In the previous code, this was never reached unless all 3 failed. But the lack of return in this one makes it so.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
215

techs.every((tech) => this.playerData.researchedTechs.has(tech))
TBH, I dont really see the point of adding the function.

binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
31

Notice that [] is considered truthy. Use .length here and wherever this check maybe used.

This revision now requires changes to proceed.Sat, Jan 5, 6:13 AM
Angen planned changes to this revision.Sat, Jan 5, 9:05 AM
Angen marked 2 inline comments as done.
Angen added inline comments.
binaries/data/mods/public/simulation/ai/common-api/entity.js
109

if it has more phase requirments it takes the highest needed.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
215

one function call instead for every tech

elexis added a subscriber: elexis.Sat, Jan 5, 12:52 PM

borg- just asked 2 days ago how to make a tech that unlocks seleucid champions in the barracks, but only those champs that were unlocked in the fortress with the pair tech. I don't know if it's possible to do it currently, but with this patch it would be easier.

Angen marked 2 inline comments as done.Sat, Jan 5, 1:25 PM
Angen added inline comments.
binaries/data/mods/public/simulation/ai/common-api/entity.js
84

Working for formation list in Identity component.

109

oh, I get your comment now

Angen updated this revision to Diff 7265.Sat, Jan 5, 4:04 PM
Angen edited the summary of this revision. (Show Details)

Fix tooltip for upgrade as that component is still using exactly one technology, and some comments.

smiley added inline comments.Sat, Jan 5, 4:06 PM
binaries/data/mods/public/simulation/ai/common-api/entity.js
84

I meant for the AI.

Stan added a subscriber: Stan.Sat, Jan 5, 4:11 PM
Stan added inline comments.
binaries/data/mods/public/simulation/ai/common-api/entity.js
103

switch case ?

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
217

Can this be written differently ?

binaries/data/mods/public/simulation/components/Identity.js
86–89

nuke the 'a'

Vulcan added a comment.Sat, Jan 5, 4:33 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
| 100| 100| 	this.visibleClassesList = GetVisibleIdentityClasses(this.template);
| 101| 101| };
| 102| 102| 
| 103|    |-Identity.prototype.Deserialize = function ()
|    | 103|+Identity.prototype.Deserialize = function()
| 104| 104| {
| 105| 105| 	this.Init();
| 106| 106| };
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 393| 393| function getRepairTimeTooltip(entState)
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396|    |-			"label": headerFont(translate("Number of repairers:")),
|    | 396|+		"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397|    |-			"details": entState.repairable.numBuilders
|    | 397|+		"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398|    |-		}) + "\n" + (entState.repairable.numBuilders ?
|    | 398|+	}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
| 401| 401| 			"Add another worker to speed up the repairs by %(second)s seconds.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 415| 415| function getBuildTimeTooltip(entState)
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418|    |-			"label": headerFont(translate("Number of builders:")),
|    | 418|+		"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419|    |-			"details": entState.foundation.numBuilders
|    | 419|+		"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420|    |-		}) + "\n" + (entState.foundation.numBuilders ?
|    | 420|+	}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
| 423| 423| 			"Add another worker to speed up the construction by %(second)s seconds.",
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 452| 452| 				continue;
| 453| 453| 
| 454| 454| 			if (state.pack.progress == 0)
| 455|    |-			{
|    | 455|+			
| 456| 456| 				if (state.pack.packed)
| 457| 457| 					checks.unpackButton = true;
| 458| 458| 				else
| 459| 459| 					checks.packButton = true;
| 460|    |-			}
|    | 460|+			
| 461| 461| 			else if (state.pack.packed)
| 462| 462| 				checks.unpackCancelButton = true;
| 463| 463| 			else
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 763| 763| 				addResearchToQueue(data.item.researchFacilityId, t);
| 764| 764| 			})(tech);
| 765| 765| 
| 766|    |-			button.onPressRight = (t => function () {
|    | 766|+			button.onPressRight = (t => function() {
| 767| 767| 				showTemplateDetails(
| 768| 768| 					t,
| 769| 769| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 941| 941| 			"player": data.player
| 942| 942| 		});
| 943| 943| 
| 944|    |-		let unitIds = data.unitEntStates.map(status => status.id)
|    | 944|+		let unitIds = data.unitEntStates.map(status => status.id);
| 945| 945| 		let [buildingsCountToTrainFullBatch, fullBatchSize, remainderBatch] =
| 946| 946| 			getTrainingStatus(unitIds, data.item, data.playerState);
| 947| 947| 

binaries/data/mods/public/gui/session/selection_panels.js
|  48| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  59| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 731| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 944| »   »   let·unitIds·=·data.unitEntStates.map(status·=>·status.id)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|  97|  97| 	else if (pos.xx === undefined || pos.x == pos.xx && pos.z == pos.zz)
|  98|  98| 		builder.construct(this.type, pos.x, pos.z, pos.angle, this.metadata);
|  99|  99| 	else // try with the lowest, move towards us unless we're same
| 100|    |-	{
|    | 100|+	
| 101| 101| 		for (let step = 0; step <= 1; step += 0.2)
| 102| 102| 			builder.construct(this.type, step*pos.x + (1-step)*pos.xx, step*pos.z + (1-step)*pos.zz,
| 103| 103| 				pos.angle, this.metadata);
| 104|    |-	}
|    | 104|+	
| 105| 105| 	this.onStart(gameState);
| 106| 106| 	Engine.ProfileStop();
| 107| 107| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 131| 131| 	}
| 132| 132| 
| 133| 133| 	if (!this.position)
| 134|    |-	{
|    | 134|+	
| 135| 135| 		if (template.hasClass("CivCentre"))
| 136| 136| 		{
| 137| 137| 			let pos;
| 177| 177| 			else if (!pos)
| 178| 178| 				return false;
| 179| 179| 		}
| 180|    |-	}
|    | 180|+	
| 181| 181| 
| 182| 182| 	// Compute each tile's closeness to friendly structures:
| 183| 183| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 204| 204| 					placement.set(j, 45);
| 205| 205| 		}
| 206| 206| 		else
| 207|    |-		{
|    | 207|+		
| 208| 208| 			for (let j = 0; j < placement.map.length; ++j)
| 209| 209| 				if (HQ.basesMap.map[j] != 0)
| 210| 210| 					placement.set(j, 45);
| 211|    |-		}
|    | 211|+		
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214| 214| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 211| 211| 		}
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214|    |-		{
|    | 214|+		
| 215| 215| 			gameState.getOwnStructures().forEach(function(ent) {
| 216| 216| 				let pos = ent.position();
| 217| 217| 				let x = Math.round(pos[0] / cellSize);
| 245| 245| 				else if (template.genericName() == "Rotary Mill" && ent.hasClass("Field"))
| 246| 246| 					placement.addInfluence(x, z, 60/cellSize, 40);
| 247| 247| 			});
| 248|    |-		}
|    | 248|+		
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250| 250| 		{
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 219| 219| 
| 220| 220| 				let struct = m.getBuiltEntity(gameState, ent);
| 221| 221| 				if (struct.resourceDropsiteTypes() && struct.resourceDropsiteTypes().indexOf("food") != -1)
| 222|    |-				{
|    | 222|+				
| 223| 223| 					if (template.hasClass("Field") || template.hasClass("Corral"))
| 224| 224| 						placement.addInfluence(x, z, 80/cellSize, 50);
| 225| 225| 					else // If this is not a field add a negative influence because we want to leave this area for fields
| 226| 226| 						placement.addInfluence(x, z, 80/cellSize, -20);
| 227|    |-				}
|    | 227|+				
| 228| 228| 				else if (template.hasClass("House"))
| 229| 229| 				{
| 230| 230| 					if (ent.hasClass("House"))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 247| 247| 			});
| 248| 248| 		}
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250|    |-		{
|    | 250|+		
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
| 252| 252| 			{
| 253| 253| 				let value = placement.map[j] - gameState.sharedScript.resourceMaps.wood.map[j]/3;
| 255| 255| 					value /= 2;	// we need space around farmstead, so disfavor map border
| 256| 256| 				placement.set(j, value);
| 257| 257| 			}
| 258|    |-		}
|    | 258|+		
| 259| 259| 	}
| 260| 260| 
| 261| 261| 	// Requires to be inside our territory, and inside our base territory if required
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 268| 268| 	{
| 269| 269| 		let base = this.metadata.base;
| 270| 270| 		for (let j = 0; j < placement.map.length; ++j)
| 271|    |-		{
|    | 271|+		
| 272| 272| 			if (HQ.basesMap.map[j] != base)
| 273| 273| 				placement.map[j] = 0;
| 274| 274| 			else if (placement.map[j] > 0)
| 283| 283| 				if (HQ.isNearInvadingArmy([x, z]))
| 284| 284| 					placement.map[j] = 0;
| 285| 285| 			}
| 286|    |-		}
|    | 286|+		
| 287| 287| 	}
| 288| 288| 	else
| 289| 289| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 286| 286| 		}
| 287| 287| 	}
| 288| 288| 	else
| 289|    |-	{
|    | 289|+	
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291| 291| 		{
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308| 308| 		}
| 309|    |-	}
|    | 309|+	
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
| 312| 312| 	// Find target building's approximate obstruction radius, and expand by a bit to make sure we're not too close,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 288| 288| 	else
| 289| 289| 	{
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291|    |-		{
|    | 291|+		
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 293| 293| 				placement.map[j] = 0;
| 294| 294| 			else if (placement.map[j] > 0)
| 305| 305| 				else if (favoredBase && HQ.basesMap.map[j] == favoredBase)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308|    |-		}
|    | 308|+		
| 309| 309| 	}
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 650| 650| 		{
| 651| 651| 			let count = 0;
| 652| 652| 			for (let j = 0; j < length-1; ++j)
| 653|    |-			{
|    | 653|+			
| 654| 654| 				if ((waterPoints[(i + j) % length]+1) % numPoints == waterPoints[(i + j + 1) % length])
| 655| 655| 					++count;
| 656| 656| 				else
| 657| 657| 					break;
| 658|    |-			}
|    | 658|+			
| 659| 659| 			consec[i] = count;
| 660| 660| 		}
| 661| 661| 		let start = 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 661| 661| 		let start = 0;
| 662| 662| 		let count = 0;
| 663| 663| 		for (let c in consec)
| 664|    |-		{
|    | 664|+		
| 665| 665| 			if (consec[c] > count)
| 666| 666| 			{
| 667| 667| 				start = c;
| 668| 668| 				count = consec[c];
| 669| 669| 			}
| 670|    |-		}
|    | 670|+		
| 671| 671| 
| 672| 672| 		// If we've found a shoreline, stop searching
| 673| 673| 		if (count != numPoints-1)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87, -0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50, -0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0, -1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50, -0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87, -0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 857| 857| 			let dxmax = size - dy;
| 858| 858| 			let ky = iy + dy;
| 859| 859| 			if (ky >= 0 && ky < w)
| 860|    |-			{
|    | 860|+			
| 861| 861| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 862| 862| 				{
| 863| 863| 					let kx = ix + dx;
| 868| 868| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 869| 869| 					nbcell += weight;
| 870| 870| 				}
| 871|    |-			}
|    | 871|+			
| 872| 872| 			if (dy == 0)
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
| 875| 875| 			if (ky >= 0 && ky < w)
| 876|    |-			{
|    | 876|+			
| 877| 877| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 878| 878| 				{
| 879| 879| 					let kx = ix + dx;
| 884| 884| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 885| 885| 					nbcell += weight;
| 886| 886| 				}
| 887|    |-			}
|    | 887|+			
| 888| 888| 		}
| 889| 889| 	}
| 890| 890| 	return nbcell ? total / nbcell : 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  10|  10| 
|  11|  11| 	var ret = {};
|  12|  12| 	for (var i in this)
|  13|    |-	{
|    |  13|+	
|  14|  14| 		if (this.hasOwnProperty(i))
|  15|  15| 			ret[i] = this[i];
|  16|    |-	}
|    |  16|+	
|  17|  17| 	ret.modificationCache = {};
|  18|  18| 	return ret;
|  19|  19| };
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  64|  64| 	for (let key of this.unresearchedAutoResearchTechs)
|  65|  65| 	{
|  66|  66| 		let tech = TechnologyTemplates.Get(key);
|  67|    |-		if ((tech.autoResearch && this.CanResearch(key))
|  68|    |-			|| (tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|    |  67|+		if ((tech.autoResearch && this.CanResearch(key)) ||
|    |  68|+			(tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|  69|  69| 		{
|  70|  70| 			this.unresearchedAutoResearchTechs.delete(key);
|  71|  71| 			this.ResearchTechnology(key);
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  75|  75| };
|  76|  76| 
|  77|  77| // Checks an entity template to see if its technology requirements have been met
|  78|    |-TechnologyManager.prototype.CanProduce = function (templateName)
|    |  78|+TechnologyManager.prototype.CanProduce = function(templateName)
|  79|  79| {
|  80|  80| 	let cmpTempManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|  81|  81| 	let template = cmpTempManager.GetTemplate(templateName);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  99|  99| TechnologyManager.prototype.AreTechnologiesResearched = function(techs)
| 100| 100| {
| 101| 101| 	return techs.every((tech) => this.researchedTechs.has(tech));
| 102|    |-}
|    | 102|+};
| 103| 103| 
| 104| 104| TechnologyManager.prototype.IsTechnologyStarted = function(tech)
| 105| 105| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 198| 198| 		var classes = cmpIdentity.GetClassesList();
| 199| 199| 		// don't use foundations for the class counts but check if techs apply (e.g. health increase)
| 200| 200| 		if (!Engine.QueryInterface(msg.entity, IID_Foundation))
| 201|    |-		{
|    | 201|+		
| 202| 202| 			for (let cls of classes)
| 203| 203| 			{
| 204| 204| 				this.classCounts[cls] = this.classCounts[cls] || 0;
| 208| 208| 				this.typeCountsByClass[cls][template] = this.typeCountsByClass[cls][template] || 0;
| 209| 209| 				this.typeCountsByClass[cls][template] += 1;
| 210| 210| 			}
| 211|    |-		}
|    | 211|+		
| 212| 212| 
| 213| 213| 		// Newly created entity, check if any researched techs might apply
| 214| 214| 		// (only do this for new entities because even if an entity is converted or captured,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 291| 291| 	}
| 292| 292| 
| 293| 293| 	if (template.replaces && template.replaces.length > 0)
| 294|    |-	{
|    | 294|+	
| 295| 295| 		for (var i of template.replaces)
| 296| 296| 		{
| 297| 297| 			if (!i || this.IsTechnologyResearched(i))
| 309| 309| 					cmpPlayerEntityLimits.UpdateLimitsFromTech(i);
| 310| 310| 			}
| 311| 311| 		}
| 312|    |-	}
|    | 312|+	
| 313| 313| 
| 314| 314| 	this.UpdateAutoResearch();
| 315| 315| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 327| 327| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 328| 328| 
| 329| 329| 	// always send research finished message
| 330|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 330|+	Engine.PostMessage(this.entity, MT_ResearchFinished, { "player": playerID, "tech": tech});
| 331| 331| 
| 332| 332| 	for (var component in modifiedComponents)
| 333| 333| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 327| 327| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 328| 328| 
| 329| 329| 	// always send research finished message
| 330|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 330|+	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech });
| 331| 331| 
| 332| 332| 	for (var component in modifiedComponents)
| 333| 333| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 331| 331| 
| 332| 332| 	for (var component in modifiedComponents)
| 333| 333| 	{
| 334|    |-		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
|    | 334|+		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component] });
| 335| 335| 		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
| 336| 336| 	}
| 337| 337| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 332| 332| 	for (var component in modifiedComponents)
| 333| 333| 	{
| 334| 334| 		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
| 335|    |-		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
|    | 335|+		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component] });
| 336| 336| 	}
| 337| 337| 
| 338| 338| 	if (tech.startsWith("phase") && !template.autoResearch)
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 454| 454|  */
| 455| 455| TechnologyManager.prototype.GetResearcher = function(tech)
| 456| 456| {
| 457|    |-	return this.researchQueued.get(tech)
|    | 457|+	return this.researchQueued.get(tech);
| 458| 458| };
| 459| 459| 
| 460| 460| /**

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 225| ·»   »   »   »   »   if·(DoesModificationApply(modif,·classes))
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/TechnologyManager.js
|  68| »   »   »   ||·(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
| 102| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 234| »   »   »   for·(var·component·in·modifiedComponents)
|    | [NORMAL] JSHintBear:
|    | 'component' is already defined.

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

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

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 457| »   return·this.researchQueued.get(tech)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 226| 226| 		{
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229|    |-					"name": aura.auraName,
|    | 229|+				"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230|    |-					"description": aura.auraDescription || null,
|    | 230|+				"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231|    |-					"radius": aura.radius || null
|    | 231|+				"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
| 234| 234| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232|    |-				};
|    | 232|+			};
| 233| 233| 		}
| 234| 234| 	}
| 235| 235| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 389| 389| 		ret.icon = template.Identity.Icon;
| 390| 390| 		ret.tooltip = template.Identity.Tooltip;
| 391| 391| 		ret.requiredTechnologies = [];
| 392|    |-		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) {
|    | 392|+		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) 
| 393| 393| 			ret.requiredTechnologies = template.Identity.RequiredTechnologies._string.split(/\s+/);
| 394|    |-		}
|    | 394|+		
| 395| 395| 		ret.visibleIdentityClasses = GetVisibleIdentityClasses(template.Identity);
| 396| 396| 		ret.nativeCiv = template.Identity.Civ;
| 397| 397| 	}

binaries/data/mods/public/globalscripts/Templates.js
| 392| »   »   if·(template.Identity.RequiredTechnologies·&&·template.Identity.RequiredTechnologies._string)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 215| 215| m.GameState.prototype.areResearched = function(techs)
| 216| 216| {
| 217| 217| 	return techs.every((tech) => this.playerData.researchedTechs.has(tech));
| 218|    |-}
|    | 218|+};
| 219| 219| 
| 220| 220| /** true if started or queued */
| 221| 221| m.GameState.prototype.isResearching = function(template)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 615| 615| 	else if (template.resourceSupplyType() !== undefined)	// animal resources
| 616| 616| 		count += this.countEntitiesByType("resource|" + type, true);
| 617| 617| 	else
| 618|    |-	{
|    | 618|+	
| 619| 619| 		// Count entities in building production queues
| 620| 620| 		// TODO: maybe this fails for corrals.
| 621| 621| 		this.getOwnTrainingFacilities().forEach(function(ent) {
| 623| 623| 				if (item.unitTemplate == type)
| 624| 624| 					count += item.count;
| 625| 625| 		});
| 626|    |-	}
|    | 626|+	
| 627| 627| 
| 628| 628| 	return count;
| 629| 629| };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 775| 775| 				ret.push([techs[1]._templateName, techs[1]]);
| 776| 776| 		}
| 777| 777| 		else if (this.canResearch(tech))
| 778|    |-		{
|    | 778|+		
| 779| 779| 			// Phases are treated separately
| 780| 780| 			if (this.phases.every(phase => template._templateName != phase.name))
| 781| 781| 				ret.push([tech, template]);
| 782|    |-		}
|    | 782|+		
| 783| 783| 	}
| 784| 784| 	return ret;
| 785| 785| };

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 274| »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 291| »   »   »   switch·(type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 218| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 804| 804| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 805| 805| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 806| 806| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 807|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 807|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 808| 808| 	}
| 809| 809| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 810| 810| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1323|1323| 		}
|1324|1324| 	}
|1325|1325| 	else
|1326|    |-	{
|    |1326|+	
|1327|1327| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1328|1328| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1329|1329| 		// wall piece.
|1344|1344| 			"pos": start.pos,
|1345|1345| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1346|1346| 		});
|1347|    |-	}
|    |1347|+	
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|1350| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1347|1347| 	}
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|    |-	{
|    |1350|+	
|1351|1351| 		// Analogous to the starting side case above
|1352|1352| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1353|1353| 		{
|1385|1385| 				"pos": end.pos,
|1386|1386| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1387|1387| 			});
|1388|    |-	}
|    |1388|+	
|1389|1389| 
|1390|1390| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1391|1391| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1563|1563| 
|1564|1564| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1565|1565| 		if (cmpVisual)
|1566|    |-		{
|    |1566|+		
|1567|1567| 			if (!allPiecesValid || !canAfford)
|1568|1568| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1569|1569| 			else
|1570|1570| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1571|    |-		}
|    |1571|+		
|1572|1572| 
|1573|1573| 		++entPool.numUsed;
|1574|1574| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1637|1637| 			{
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|    |-						"x": pos.x,
|    |1640|+					"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|    |-						"z": pos.z,
|    |1641|+					"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|    |-						"angle": cmpPosition.GetRotation().y,
|    |1642|+					"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|    |-						"ent": ent
|    |1643|+					"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|1646|1646| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1785|1785| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1786|1786| 	}
|1787|1787| 	else if (data.target === secondMarket)
|1788|    |-	{
|    |1788|+	
|1789|1789| 		result = {
|1790|1790| 			"type": "is second",
|1791|1791| 			"gain": cmpEntityTrader.GetGoods().amount,
|1792|1792| 		};
|1793|    |-	}
|    |1793|+	
|1794|1794| 	else if (!firstMarket)
|1795|1795| 	{
|1796|1796| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1792|1792| 		};
|1793|1793| 	}
|1794|1794| 	else if (!firstMarket)
|1795|    |-	{
|    |1795|+	
|1796|1796| 		result = { "type": "set first" };
|1797|    |-	}
|    |1797|+	
|1798|1798| 	else if (!secondMarket)
|1799|1799| 	{
|1800|1800| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1796|1796| 		result = { "type": "set first" };
|1797|1797| 	}
|1798|1798| 	else if (!secondMarket)
|1799|    |-	{
|    |1799|+	
|1800|1800| 		result = {
|1801|1801| 			"type": "set second",
|1802|1802| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1803|1803| 		};
|1804|    |-	}
|    |1804|+	
|1805|1805| 	else
|1806|1806| 	{
|1807|1807| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1803|1803| 		};
|1804|1804| 	}
|1805|1805| 	else
|1806|    |-	{
|    |1806|+	
|1807|1807| 		// Else both markets are not null and target is different from them
|1808|1808| 		result = { "type": "set first" };
|1809|    |-	}
|    |1809|+	
|1810|1810| 	return result;
|1811|1811| };
|1812|1812| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  33|  33| 		{
|  34|  34| 			let args = string.split("/");
|  35|  35| 			for (let arg of args)
|  36|    |-			{
|    |  36|+			
|  37|  37| 				if (value[arg])
|  38|  38| 					value = value[arg];
|  39|  39| 				else
|  41|  41| 					value = undefined;
|  42|  42| 					break;
|  43|  43| 				}
|  44|    |-			}
|    |  44|+			
|  45|  45| 			this._tpCache.set(string, value);
|  46|  46| 		}
|  47|  47| 		return this._tpCache.get(string);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  98|  98| 	"phase": function() {
|  99|  99| 		let techsRequired = this.requiredTechs();
| 100| 100| 		let id = 0;
| 101|    |-		for (let techRequired of techsRequired) {
|    | 101|+		for (let techRequired of techsRequired) 
| 102| 102| 			if (techRequired == "phase_village")
| 103| 103| 				id = Math.max(id, 1);
| 104| 104| 			else if (techRequired == "phase_town")
| 107| 107| 				id = Math.max(id, 3);
| 108| 108| 			else if (techRequired.startsWith("phase_"))
| 109| 109| 				id = Math.max(id, 4);
| 110|    |-		}
|    | 110|+		
| 111| 111| 		return id;
| 112| 112| 	},
| 113| 113| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
| 314| 314| 			return undefined;
| 315| 315| 
| 316| 316| 		if (this.get("Attack/" + type + "/Bonuses"))
| 317|    |-		{
|    | 317|+		
| 318| 318| 			for (let b in this.get("Attack/" + type + "/Bonuses"))
| 319| 319| 			{
| 320| 320| 				let bonusClasses = this.get("Attack/" + type + "/Bonuses/" + b + "/Classes");
| 324| 324| 					if (bcl == againstClass)
| 325| 325| 						return +this.get("Attack/" + type + "/Bonuses/" + b + "/Multiplier");
| 326| 326| 			}
| 327|    |-		}
|    | 327|+		
| 328| 328| 		return 1;
| 329| 329| 	},
| 330| 330| 

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 101| »   »   for·(let·techRequired·of·techsRequired)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 804| »   »   if·(this.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 821| »   »   if·(this.position()·!==·undefined·&&·unitToFleeFrom.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/920/

Angen marked 3 inline comments as done.Sun, Jan 6, 11:23 PM
Angen added inline comments.
binaries/data/mods/public/simulation/ai/common-api/entity.js
103

I dont think I can write switch case for .startsWith

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
217

for each loop, for loop, while, or this, I think this is the shortest way

Angen edited the summary of this revision. (Show Details)Mon, Jan 7, 7:32 PM
Angen planned changes to this revision.Mon, Jan 7, 8:14 PM
smiley added inline comments.Tue, Jan 8, 1:07 PM
binaries/data/mods/public/simulation/ai/common-api/entity.js
19

The TODO I mentioned. Although, I have not checked whether what it's saying is true.

Angen updated this revision to Diff 7337.Sun, Jan 13, 6:44 PM

fix spy, AI _string, palisade and structure tree

Angen edited the summary of this revision. (Show Details)Sun, Jan 13, 6:45 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 393| 393| function getRepairTimeTooltip(entState)
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396|    |-			"label": headerFont(translate("Number of repairers:")),
|    | 396|+		"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 394| 394| {
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397|    |-			"details": entState.repairable.numBuilders
|    | 397|+		"details": entState.repairable.numBuilders
| 398| 398| 		}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 395| 395| 	return sprintf(translate("%(label)s %(details)s"), {
| 396| 396| 			"label": headerFont(translate("Number of repairers:")),
| 397| 397| 			"details": entState.repairable.numBuilders
| 398|    |-		}) + "\n" + (entState.repairable.numBuilders ?
|    | 398|+	}) + "\n" + (entState.repairable.numBuilders ?
| 399| 399| 		sprintf(translatePlural(
| 400| 400| 			"Add another worker to speed up the repairs by %(second)s second.",
| 401| 401| 			"Add another worker to speed up the repairs by %(second)s seconds.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 415| 415| function getBuildTimeTooltip(entState)
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418|    |-			"label": headerFont(translate("Number of builders:")),
|    | 418|+		"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 416| 416| {
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419|    |-			"details": entState.foundation.numBuilders
|    | 419|+		"details": entState.foundation.numBuilders
| 420| 420| 		}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/common/tooltips.js
| 417| 417| 	return sprintf(translate("%(label)s %(details)s"), {
| 418| 418| 			"label": headerFont(translate("Number of builders:")),
| 419| 419| 			"details": entState.foundation.numBuilders
| 420|    |-		}) + "\n" + (entState.foundation.numBuilders ?
|    | 420|+	}) + "\n" + (entState.foundation.numBuilders ?
| 421| 421| 		sprintf(translatePlural(
| 422| 422| 			"Add another worker to speed up the construction by %(second)s second.",
| 423| 423| 			"Add another worker to speed up the construction by %(second)s seconds.",
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 226| 226| 		{
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229|    |-					"name": aura.auraName,
|    | 229|+				"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 227| 227| 			let aura = auraTemplates[auraID];
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230|    |-					"description": aura.auraDescription || null,
|    | 230|+				"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 228| 228| 			ret.auras[auraID] = {
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231|    |-					"radius": aura.radius || null
|    | 231|+				"radius": aura.radius || null
| 232| 232| 				};
| 233| 233| 		}
| 234| 234| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 229| 229| 					"name": aura.auraName,
| 230| 230| 					"description": aura.auraDescription || null,
| 231| 231| 					"radius": aura.radius || null
| 232|    |-				};
|    | 232|+			};
| 233| 233| 		}
| 234| 234| 	}
| 235| 235| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/globalscripts/Templates.js
| 389| 389| 		ret.icon = template.Identity.Icon;
| 390| 390| 		ret.tooltip = template.Identity.Tooltip;
| 391| 391| 		ret.requiredTechnologies = [];
| 392|    |-		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) {
|    | 392|+		if (template.Identity.RequiredTechnologies && template.Identity.RequiredTechnologies._string) 
| 393| 393| 			ret.requiredTechnologies = template.Identity.RequiredTechnologies._string.split(/\s+/);
| 394|    |-		}
|    | 394|+		
| 395| 395| 		ret.visibleIdentityClasses = GetVisibleIdentityClasses(template.Identity);
| 396| 396| 		ret.nativeCiv = template.Identity.Civ;
| 397| 397| 	}

binaries/data/mods/public/globalscripts/Templates.js
| 392| »   »   if·(template.Identity.RequiredTechnologies·&&·template.Identity.RequiredTechnologies._string)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/menu.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/menu.js
| 873| 873| 	Engine.GetGUIObjectByName("barterHelp").hidden = !canBarter;
| 874| 874| 
| 875| 875| 	if (canBarter)
| 876|    |-		g_ResourceData.GetCodes().forEach((resCode, i) => { barterUpdateCommon(resCode, i, "barter", g_ViewedPlayer) });
|    | 876|+		g_ResourceData.GetCodes().forEach((resCode, i) => { barterUpdateCommon(resCode, i, "barter", g_ViewedPlayer); });
| 877| 877| }
| 878| 878| 
| 879| 879| function getIdleLandTradersText(traderNumber)

binaries/data/mods/public/gui/session/menu.js
| 482| »   »   button.onPress·=·(function(player,·stance)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'stance' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 514| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 514| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'resCode' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 514| »   »   button.onPress·=·(function(i,·resCode,·button)·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 557| »   button.onPress·=·(function(i)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 623| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 623| »   button.onPress·=·(function(i,·button)·{·return·function()·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'button' is already declared in the upper scope.

binaries/data/mods/public/gui/session/menu.js
| 876| »   »   g_ResourceData.GetCodes().forEach((resCode,·i)·=>·{·barterUpdateCommon(resCode,·i,·"barter",·g_ViewedPlayer)·});
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 804| 804| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 805| 805| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 806| 806| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 807|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 807|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 808| 808| 	}
| 809| 809| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 810| 810| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1323|1323| 		}
|1324|1324| 	}
|1325|1325| 	else
|1326|    |-	{
|    |1326|+	
|1327|1327| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1328|1328| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1329|1329| 		// wall piece.
|1344|1344| 			"pos": start.pos,
|1345|1345| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1346|1346| 		});
|1347|    |-	}
|    |1347|+	
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|1350| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1347|1347| 	}
|1348|1348| 
|1349|1349| 	if (end.pos)
|1350|    |-	{
|    |1350|+	
|1351|1351| 		// Analogous to the starting side case above
|1352|1352| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1353|1353| 		{
|1385|1385| 				"pos": end.pos,
|1386|1386| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1387|1387| 			});
|1388|    |-	}
|    |1388|+	
|1389|1389| 
|1390|1390| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1391|1391| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1563|1563| 
|1564|1564| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1565|1565| 		if (cmpVisual)
|1566|    |-		{
|    |1566|+		
|1567|1567| 			if (!allPiecesValid || !canAfford)
|1568|1568| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1569|1569| 			else
|1570|1570| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1571|    |-		}
|    |1571|+		
|1572|1572| 
|1573|1573| 		++entPool.numUsed;
|1574|1574| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1637|1637| 			{
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|    |-						"x": pos.x,
|    |1640|+					"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1638|1638| 				minDist2 = dist2;
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|    |-						"z": pos.z,
|    |1641|+					"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1639|1639| 				minDistEntitySnapData = {
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|    |-						"angle": cmpPosition.GetRotation().y,
|    |1642|+					"angle": cmpPosition.GetRotation().y,
|1643|1643| 						"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1640|1640| 						"x": pos.x,
|1641|1641| 						"z": pos.z,
|1642|1642| 						"angle": cmpPosition.GetRotation().y,
|1643|    |-						"ent": ent
|    |1643|+					"ent": ent
|1644|1644| 				};
|1645|1645| 			}
|1646|1646| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1785|1785| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1786|1786| 	}
|1787|1787| 	else if (data.target === secondMarket)
|1788|    |-	{
|    |1788|+	
|1789|1789| 		result = {
|1790|1790| 			"type": "is second",
|1791|1791| 			"gain": cmpEntityTrader.GetGoods().amount,
|1792|1792| 		};
|1793|    |-	}
|    |1793|+	
|1794|1794| 	else if (!firstMarket)
|1795|1795| 	{
|1796|1796| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1792|1792| 		};
|1793|1793| 	}
|1794|1794| 	else if (!firstMarket)
|1795|    |-	{
|    |1795|+	
|1796|1796| 		result = { "type": "set first" };
|1797|    |-	}
|    |1797|+	
|1798|1798| 	else if (!secondMarket)
|1799|1799| 	{
|1800|1800| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1796|1796| 		result = { "type": "set first" };
|1797|1797| 	}
|1798|1798| 	else if (!secondMarket)
|1799|    |-	{
|    |1799|+	
|1800|1800| 		result = {
|1801|1801| 			"type": "set second",
|1802|1802| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1803|1803| 		};
|1804|    |-	}
|    |1804|+	
|1805|1805| 	else
|1806|1806| 	{
|1807|1807| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1803|1803| 		};
|1804|1804| 	}
|1805|1805| 	else
|1806|    |-	{
|    |1806|+	
|1807|1807| 		// Else both markets are not null and target is different from them
|1808|1808| 		result = { "type": "set first" };
|1809|    |-	}
|    |1809|+	
|1810|1810| 	return result;
|1811|1811| };
|1812|1812| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Identity.js
| 100| 100| 	this.visibleClassesList = GetVisibleIdentityClasses(this.template);
| 101| 101| };
| 102| 102| 
| 103|    |-Identity.prototype.Deserialize = function ()
|    | 103|+Identity.prototype.Deserialize = function()
| 104| 104| {
| 105| 105| 	this.Init();
| 106| 106| };
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 215| 215| m.GameState.prototype.areResearched = function(techs)
| 216| 216| {
| 217| 217| 	return techs.every((tech) => this.playerData.researchedTechs.has(tech));
| 218|    |-}
|    | 218|+};
| 219| 219| 
| 220| 220| /** true if started or queued */
| 221| 221| m.GameState.prototype.isResearching = function(template)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 615| 615| 	else if (template.resourceSupplyType() !== undefined)	// animal resources
| 616| 616| 		count += this.countEntitiesByType("resource|" + type, true);
| 617| 617| 	else
| 618|    |-	{
|    | 618|+	
| 619| 619| 		// Count entities in building production queues
| 620| 620| 		// TODO: maybe this fails for corrals.
| 621| 621| 		this.getOwnTrainingFacilities().forEach(function(ent) {
| 623| 623| 				if (item.unitTemplate == type)
| 624| 624| 					count += item.count;
| 625| 625| 		});
| 626|    |-	}
|    | 626|+	
| 627| 627| 
| 628| 628| 	return count;
| 629| 629| };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 775| 775| 				ret.push([techs[1]._templateName, techs[1]]);
| 776| 776| 		}
| 777| 777| 		else if (this.canResearch(tech))
| 778|    |-		{
|    | 778|+		
| 779| 779| 			// Phases are treated separately
| 780| 780| 			if (this.phases.every(phase => template._templateName != phase.name))
| 781| 781| 				ret.push([tech, template]);
| 782|    |-		}
|    | 782|+		
| 783| 783| 	}
| 784| 784| 	return ret;
| 785| 785| };

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 274| »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 291| »   »   »   switch·(type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/ai/common-api/gamestate.js
| 218| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|  97|  97| 	else if (pos.xx === undefined || pos.x == pos.xx && pos.z == pos.zz)
|  98|  98| 		builder.construct(this.type, pos.x, pos.z, pos.angle, this.metadata);
|  99|  99| 	else // try with the lowest, move towards us unless we're same
| 100|    |-	{
|    | 100|+	
| 101| 101| 		for (let step = 0; step <= 1; step += 0.2)
| 102| 102| 			builder.construct(this.type, step*pos.x + (1-step)*pos.xx, step*pos.z + (1-step)*pos.zz,
| 103| 103| 				pos.angle, this.metadata);
| 104|    |-	}
|    | 104|+	
| 105| 105| 	this.onStart(gameState);
| 106| 106| 	Engine.ProfileStop();
| 107| 107| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 131| 131| 	}
| 132| 132| 
| 133| 133| 	if (!this.position)
| 134|    |-	{
|    | 134|+	
| 135| 135| 		if (template.hasClass("CivCentre"))
| 136| 136| 		{
| 137| 137| 			let pos;
| 177| 177| 			else if (!pos)
| 178| 178| 				return false;
| 179| 179| 		}
| 180|    |-	}
|    | 180|+	
| 181| 181| 
| 182| 182| 	// Compute each tile's closeness to friendly structures:
| 183| 183| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 204| 204| 					placement.set(j, 45);
| 205| 205| 		}
| 206| 206| 		else
| 207|    |-		{
|    | 207|+		
| 208| 208| 			for (let j = 0; j < placement.map.length; ++j)
| 209| 209| 				if (HQ.basesMap.map[j] != 0)
| 210| 210| 					placement.set(j, 45);
| 211|    |-		}
|    | 211|+		
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214| 214| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 211| 211| 		}
| 212| 212| 
| 213| 213| 		if (!HQ.requireHouses || !template.hasClass("House"))
| 214|    |-		{
|    | 214|+		
| 215| 215| 			gameState.getOwnStructures().forEach(function(ent) {
| 216| 216| 				let pos = ent.position();
| 217| 217| 				let x = Math.round(pos[0] / cellSize);
| 245| 245| 				else if (template.genericName() == "Rotary Mill" && ent.hasClass("Field"))
| 246| 246| 					placement.addInfluence(x, z, 60/cellSize, 40);
| 247| 247| 			});
| 248|    |-		}
|    | 248|+		
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250| 250| 		{
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 219| 219| 
| 220| 220| 				let struct = m.getBuiltEntity(gameState, ent);
| 221| 221| 				if (struct.resourceDropsiteTypes() && struct.resourceDropsiteTypes().indexOf("food") != -1)
| 222|    |-				{
|    | 222|+				
| 223| 223| 					if (template.hasClass("Field") || template.hasClass("Corral"))
| 224| 224| 						placement.addInfluence(x, z, 80/cellSize, 50);
| 225| 225| 					else // If this is not a field add a negative influence because we want to leave this area for fields
| 226| 226| 						placement.addInfluence(x, z, 80/cellSize, -20);
| 227|    |-				}
|    | 227|+				
| 228| 228| 				else if (template.hasClass("House"))
| 229| 229| 				{
| 230| 230| 					if (ent.hasClass("House"))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 247| 247| 			});
| 248| 248| 		}
| 249| 249| 		if (template.hasClass("Farmstead"))
| 250|    |-		{
|    | 250|+		
| 251| 251| 			for (let j = 0; j < placement.map.length; ++j)
| 252| 252| 			{
| 253| 253| 				let value = placement.map[j] - gameState.sharedScript.resourceMaps.wood.map[j]/3;
| 255| 255| 					value /= 2;	// we need space around farmstead, so disfavor map border
| 256| 256| 				placement.set(j, value);
| 257| 257| 			}
| 258|    |-		}
|    | 258|+		
| 259| 259| 	}
| 260| 260| 
| 261| 261| 	// Requires to be inside our territory, and inside our base territory if required
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 268| 268| 	{
| 269| 269| 		let base = this.metadata.base;
| 270| 270| 		for (let j = 0; j < placement.map.length; ++j)
| 271|    |-		{
|    | 271|+		
| 272| 272| 			if (HQ.basesMap.map[j] != base)
| 273| 273| 				placement.map[j] = 0;
| 274| 274| 			else if (placement.map[j] > 0)
| 283| 283| 				if (HQ.isNearInvadingArmy([x, z]))
| 284| 284| 					placement.map[j] = 0;
| 285| 285| 			}
| 286|    |-		}
|    | 286|+		
| 287| 287| 	}
| 288| 288| 	else
| 289| 289| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 286| 286| 		}
| 287| 287| 	}
| 288| 288| 	else
| 289|    |-	{
|    | 289|+	
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291| 291| 		{
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308| 308| 		}
| 309|    |-	}
|    | 309|+	
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
| 312| 312| 	// Find target building's approximate obstruction radius, and expand by a bit to make sure we're not too close,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 288| 288| 	else
| 289| 289| 	{
| 290| 290| 		for (let j = 0; j < placement.map.length; ++j)
| 291|    |-		{
|    | 291|+		
| 292| 292| 			if (HQ.basesMap.map[j] == 0)
| 293| 293| 				placement.map[j] = 0;
| 294| 294| 			else if (placement.map[j] > 0)
| 305| 305| 				else if (favoredBase && HQ.basesMap.map[j] == favoredBase)
| 306| 306| 					placement.set(j, placement.map[j] + 100);
| 307| 307| 			}
| 308|    |-		}
|    | 308|+		
| 309| 309| 	}
| 310| 310| 
| 311| 311| 	// Find the best non-obstructed:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 650| 650| 		{
| 651| 651| 			let count = 0;
| 652| 652| 			for (let j = 0; j < length-1; ++j)
| 653|    |-			{
|    | 653|+			
| 654| 654| 				if ((waterPoints[(i + j) % length]+1) % numPoints == waterPoints[(i + j + 1) % length])
| 655| 655| 					++count;
| 656| 656| 				else
| 657| 657| 					break;
| 658|    |-			}
|    | 658|+			
| 659| 659| 			consec[i] = count;
| 660| 660| 		}
| 661| 661| 		let start = 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 661| 661| 		let start = 0;
| 662| 662| 		let count = 0;
| 663| 663| 		for (let c in consec)
| 664|    |-		{
|    | 664|+		
| 665| 665| 			if (consec[c] > count)
| 666| 666| 			{
| 667| 667| 				start = c;
| 668| 668| 				count = consec[c];
| 669| 669| 			}
| 670|    |-		}
|    | 670|+		
| 671| 671| 
| 672| 672| 		// If we've found a shoreline, stop searching
| 673| 673| 		if (count != numPoints-1)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87, -0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50, -0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0, -1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50, -0.87], [ 0.87,-0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 744| 744|  * if wantedSea is given, this tile should be inside this sea
| 745| 745|  */
| 746| 746| const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50],
| 747|    |-	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]];
|    | 747|+	        [-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87, -0.50]];
| 748| 748| 
| 749| 749| m.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea)
| 750| 750| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 857| 857| 			let dxmax = size - dy;
| 858| 858| 			let ky = iy + dy;
| 859| 859| 			if (ky >= 0 && ky < w)
| 860|    |-			{
|    | 860|+			
| 861| 861| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 862| 862| 				{
| 863| 863| 					let kx = ix + dx;
| 868| 868| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 869| 869| 					nbcell += weight;
| 870| 870| 				}
| 871|    |-			}
|    | 871|+			
| 872| 872| 			if (dy == 0)
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
| 873| 873| 				continue;
| 874| 874| 			ky = iy - dy;
| 875| 875| 			if (ky >= 0 && ky < w)
| 876|    |-			{
|    | 876|+			
| 877| 877| 				for (let dx = -dxmax; dx <= dxmax; ++dx)
| 878| 878| 				{
| 879| 879| 					let kx = ix + dx;
| 884| 884| 					total += weight * resourceMaps[k].map[kx + w * ky];
| 885| 885| 					nbcell += weight;
| 886| 886| 				}
| 887|    |-			}
|    | 887|+			
| 888| 888| 		}
| 889| 889| 	}
| 890| 890| 	return nbcell ? total / nbcell : 0;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  33|  33| 		{
|  34|  34| 			let args = string.split("/");
|  35|  35| 			for (let arg of args)
|  36|    |-			{
|    |  36|+			
|  37|  37| 				if (value[arg])
|  38|  38| 					value = value[arg];
|  39|  39| 				else
|  41|  41| 					value = undefined;
|  42|  42| 					break;
|  43|  43| 				}
|  44|    |-			}
|    |  44|+			
|  45|  45| 			this._tpCache.set(string, value);
|  46|  46| 		}
|  47|  47| 		return this._tpCache.get(string);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|  99|  99| 	"phase": function() {
| 100| 100| 		let techsRequired = this.requiredTechs();
| 101| 101| 		let id = 0;
| 102|    |-		for (let techRequired of techsRequired) {
|    | 102|+		for (let techRequired of techsRequired) 
| 103| 103| 			if (techRequired == "phase_village")
| 104| 104| 				id = Math.max(id, 1);
| 105| 105| 			else if (techRequired == "phase_town")
| 108| 108| 				id = Math.max(id, 3);
| 109| 109| 			else if (techRequired.startsWith("phase_"))
| 110| 110| 				id = Math.max(id, 4);
| 111|    |-		}
|    | 111|+		
| 112| 112| 		return id;
| 113| 113| 	},
| 114| 114| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js
| 315| 315| 			return undefined;
| 316| 316| 
| 317| 317| 		if (this.get("Attack/" + type + "/Bonuses"))
| 318|    |-		{
|    | 318|+		
| 319| 319| 			for (let b in this.get("Attack/" + type + "/Bonuses"))
| 320| 320| 			{
| 321| 321| 				let bonusClasses = this.get("Attack/" + type + "/Bonuses/" + b + "/Classes");
| 325| 325| 					if (bcl == againstClass)
| 326| 326| 						return +this.get("Attack/" + type + "/Bonuses/" + b + "/Multiplier");
| 327| 327| 			}
| 328|    |-		}
|    | 328|+		
| 329| 329| 		return 1;
| 330| 330| 	},
| 331| 331| 

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 102| »   »   for·(let·techRequired·of·techsRequired)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 805| »   »   if·(this.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/ai/common-api/entity.js
| 822| »   »   if·(this.position()·!==·undefined·&&·unitToFleeFrom.position()·!==·undefined)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-in'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  10|  10| 
|  11|  11| 	var ret = {};
|  12|  12| 	for (var i in this)
|  13|    |-	{
|    |  13|+	
|  14|  14| 		if (this.hasOwnProperty(i))
|  15|  15| 			ret[i] = this[i];
|  16|    |-	}
|    |  16|+	
|  17|  17| 	ret.modificationCache = {};
|  18|  18| 	return ret;
|  19|  19| };
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  64|  64| 	for (let key of this.unresearchedAutoResearchTechs)
|  65|  65| 	{
|  66|  66| 		let tech = TechnologyTemplates.Get(key);
|  67|    |-		if ((tech.autoResearch && this.CanResearch(key))
|  68|    |-			|| (tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|    |  67|+		if ((tech.autoResearch && this.CanResearch(key)) ||
|    |  68|+			(tech.top && (this.IsTechnologyResearched(tech.top) || this.IsTechnologyResearched(tech.bottom))))
|  69|  69| 		{
|  70|  70| 			this.unresearchedAutoResearchTechs.delete(key);
|  71|  71| 			this.ResearchTechnology(key);
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  75|  75| };
|  76|  76| 
|  77|  77| // Checks an entity template to see if its technology requirements have been met
|  78|    |-TechnologyManager.prototype.CanProduce = function (templateName)
|    |  78|+TechnologyManager.prototype.CanProduce = function(templateName)
|  79|  79| {
|  80|  80| 	let cmpTempManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager);
|  81|  81| 	let template = cmpTempManager.GetTemplate(templateName);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|  99|  99| TechnologyManager.prototype.AreTechnologiesResearched = function(techs)
| 100| 100| {
| 101| 101| 	return techs.every((tech) => this.researchedTechs.has(tech));
| 102|    |-}
|    | 102|+};
| 103| 103| 
| 104| 104| TechnologyManager.prototype.IsTechnologyStarted = function(tech)
| 105| 105| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 198| 198| 		var classes = cmpIdentity.GetClassesList();
| 199| 199| 		// don't use foundations for the class counts but check if techs apply (e.g. health increase)
| 200| 200| 		if (!Engine.QueryInterface(msg.entity, IID_Foundation))
| 201|    |-		{
|    | 201|+		
| 202| 202| 			for (let cls of classes)
| 203| 203| 			{
| 204| 204| 				this.classCounts[cls] = this.classCounts[cls] || 0;
| 208| 208| 				this.typeCountsByClass[cls][template] = this.typeCountsByClass[cls][template] || 0;
| 209| 209| 				this.typeCountsByClass[cls][template] += 1;
| 210| 210| 			}
| 211|    |-		}
|    | 211|+		
| 212| 212| 
| 213| 213| 		// Newly created entity, check if any researched techs might apply
| 214| 214| 		// (only do this for new entities because even if an entity is converted or captured,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 291| 291| 	}
| 292| 292| 
| 293| 293| 	if (template.replaces && template.replaces.length > 0)
| 294|    |-	{
|    | 294|+	
| 295| 295| 		for (var i of template.replaces)
| 296| 296| 		{
| 297| 297| 			if (!i || this.IsTechnologyResearched(i))
| 309| 309| 					cmpPlayerEntityLimits.UpdateLimitsFromTech(i);
| 310| 310| 			}
| 311| 311| 		}
| 312|    |-	}
|    | 312|+	
| 313| 313| 
| 314| 314| 	this.UpdateAutoResearch();
| 315| 315| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 327| 327| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 328| 328| 
| 329| 329| 	// always send research finished message
| 330|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 330|+	Engine.PostMessage(this.entity, MT_ResearchFinished, { "player": playerID, "tech": tech});
| 331| 331| 
| 332| 332| 	for (var component in modifiedComponents)
| 333| 333| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 327| 327| 		cmpPlayerEntityLimits.UpdateLimitsFromTech(tech);
| 328| 328| 
| 329| 329| 	// always send research finished message
| 330|    |-	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech});
|    | 330|+	Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech });
| 331| 331| 
| 332| 332| 	for (var component in modifiedComponents)
| 333| 333| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 331| 331| 
| 332| 332| 	for (var component in modifiedComponents)
| 333| 333| 	{
| 334|    |-		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
|    | 334|+		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component] });
| 335| 335| 		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
| 336| 336| 	}
| 337| 337| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 332| 332| 	for (var component in modifiedComponents)
| 333| 333| 	{
| 334| 334| 		Engine.PostMessage(SYSTEM_ENTITY, MT_TemplateModification, { "player": playerID, "component": component, "valueNames": modifiedComponents[component]});
| 335|    |-		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component]});
|    | 335|+		Engine.BroadcastMessage(MT_ValueModification, { "entities": ents, "component": component, "valueNames": modifiedComponents[component] });
| 336| 336| 	}
| 337| 337| 
| 338| 338| 	if (tech.startsWith("phase") && !template.autoResearch)
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/TechnologyManager.js
| 454| 454|  */
| 455| 455| TechnologyManager.prototype.GetResearcher = function(tech)
| 456| 456| {
| 457|    |-	return this.researchQueued.get(tech)
|    | 457|+	return this.researchQueued.get(tech);
| 458| 458| };
| 459| 459| 
| 460| 460| /**

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 225| ·»   »   »   »   »   if·(DoesModificationApply(modif,·classes))
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/TechnologyManager.js
|  68| »   »   »   ||·(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
| 102| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 234| »   »   »   for·(var·component·in·modifiedComponents)
|    | [NORMAL] JSHintBear:
|    | 'component' is already defined.

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

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

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

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

binaries/data/mods/public/simulation/components/TechnologyManager.js
| 457| »   return·this.researchQueued.get(tech)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/reference/common/helper.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/reference/common/helper.js
| 110| 110| {
| 111| 111| 	if (!template.requiredTechnologies.length)
| 112| 112| 		return g_ParsedData.phaseList[0];
| 113|    |-	
|    | 113|+
| 114| 114| 	for (let tech of template.requiredTechnologies) { 
| 115| 115| 		if (basename(tech).startsWith("phase"))
| 116| 116| 			return getActualPhase(tech);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/reference/common/helper.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/reference/common/helper.js
| 111| 111| 	if (!template.requiredTechnologies.length)
| 112| 112| 		return g_ParsedData.phaseList[0];
| 113| 113| 	
| 114|    |-	for (let tech of template.requiredTechnologies) { 
|    | 114|+	for (let tech of template.requiredTechnologies)  
| 115| 115| 		if (basename(tech).startsWith("phase"))
| 116| 116| 			return getActualPhase(tech);
| 117|    |-	}
|    | 117|+	
| 118| 118| 	return getPhaseOfTechnology(template.requiredTechnologies[0]);
| 119| 119| }
| 120| 120| 
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/reference/common/helper.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/reference/common/helper.js
| 111| 111| 	if (!template.requiredTechnologies.length)
| 112| 112| 		return g_ParsedData.phaseList[0];
| 113| 113| 	
| 114|    |-	for (let tech of template.requiredTechnologies) { 
|    | 114|+	for (let tech of template.requiredTechnologies) {
| 115| 115| 		if (basename(tech).startsWith("phase"))
| 116| 116| 			return getActualPhase(tech);
| 117| 117| 	}

binaries/data/mods/public/gui/reference/common/helper.js
| 114| »   for·(let·tech·of·template.requiredTechnologies)·{·
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 452| 452| 				continue;
| 453| 453| 
| 454| 454| 			if (state.pack.progress == 0)
| 455|    |-			{
|    | 455|+			
| 456| 456| 				if (state.pack.packed)
| 457| 457| 					checks.unpackButton = true;
| 458| 458| 				else
| 459| 459| 					checks.packButton = true;
| 460|    |-			}
|    | 460|+			
| 461| 461| 			else if (state.pack.packed)
| 462| 462| 				checks.unpackCancelButton = true;
| 463| 463| 			else
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 763| 763| 				addResearchToQueue(data.item.researchFacilityId, t);
| 764| 764| 			})(tech);
| 765| 765| 
| 766|    |-			button.onPressRight = (t => function () {
|    | 766|+			button.onPressRight = (t => function() {
| 767| 767| 				showTemplateDetails(
| 768| 768| 					t,
| 769| 769| 					GetTemplateData(data.unitEntStates.find(state => state.id == data.item.researchFacilityId).template).nativeCiv);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 941| 941| 			"player": data.player
| 942| 942| 		});
| 943| 943| 
| 944|    |-		let unitIds = data.unitEntStates.map(status => status.id)
|    | 944|+		let unitIds = data.unitEntStates.map(status => status.id);
| 945| 945| 		let [buildingsCountToTrainFullBatch, fullBatchSize, remainderBatch] =
| 946| 946| 			getTrainingStatus(unitIds, data.item, data.playerState);
| 947| 947| 

binaries/data/mods/public/gui/session/selection_panels.js
|  48| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  59| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 731| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 944| »   »   let·unitIds·=·data.unitEntStates.map(status·=>·status.id)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/959/

smiley resigned from this revision.Tue, Jan 15, 8:37 AM

The concerns I raised seems to be fixed. At least the id one. IDK about the _string one.