Page MenuHomeWildfire Games

Formation animation refactor
ClosedPublic

Authored by wraitii on Feb 25 2018, 11:41 PM.

Details

Summary

The animation overrides are a little awkward, so it might be better to define variants for each position within a formation. This continues (or finishes) the work of rP20631. The Replace/ResetMoveAnimation functions of CCmpVisualActor can be removed.

Test Plan

See if this is preferred.
Test phalanx with Athens spearmen and syntagma with Ptolemy pikemen. (Other units to be updated later.)
This should fit with D1307.

Diff Detail

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

Event Timeline

temple created this revision.Feb 25 2018, 11:41 PM
temple edited the test plan for this revision. (Show Details)Feb 25 2018, 11:43 PM
Vulcan added a subscriber: Vulcan.Feb 26 2018, 4:09 AM

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

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = { "sin": 0, "cos": 0};
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = {"sin": 0, "cos": 0 };
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return { "width": this.width, "depth": this.depth};
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return {"width": this.width, "depth": this.depth };
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return { "width":1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'width'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width": 1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width":1, "depth": 1 };
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = { "width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = {"width": 0, "depth": 0 };
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561|    |-	{
|    | 561|+	
| 562| 562| 		if (shape.type == "circle")
| 563| 563| 		{
| 564| 564| 			r.width += shape.radius * 2;
| 569| 569| 			r.width += shape.width;
| 570| 570| 			r.depth += shape.depth;
| 571| 571| 		}
| 572|    |-	}
|    | 572|+	
| 573| 573| 	r.width /= footprints.length;
| 574| 574| 	r.depth /= footprints.length;
| 575| 575| 	return r;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 582| 582| 	separation.depth *= this.separationMultiplier.depth;
| 583| 583| 
| 584| 584| 	if (this.columnar)
| 585|    |-		var sortingClasses = ["Cavalry","Infantry"];
|    | 585|+		var sortingClasses = ["Cavalry", "Infantry"];
| 586| 586| 	else
| 587| 587| 		var sortingClasses = this.sortingClasses.slice();
| 588| 588| 	sortingClasses.push("Unknown");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 599| 599| 		var classes = cmpIdentity.GetClassesList();
| 600| 600| 		var done = false;
| 601| 601| 		for (var c = 0; c < sortingClasses.length; ++c)
| 602|    |-		{
|    | 602|+		
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605| 605| 				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
| 609|    |-		}
|    | 609|+		
| 610| 610| 		if (!done)
| 611| 611| 			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] });
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["Unknown"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types.Unknown.push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({ "ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({"ent": active[i], "pos": positions[i] });
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 626| 626| 	if (this.columnar)
| 627| 627| 	{
| 628| 628| 		shape = "square";
| 629|    |-		cols = Math.min(count,3);
|    | 629|+		cols = Math.min(count, 3);
| 630| 630| 		shiftRows = false;
| 631| 631| 		centerGap = 0;
| 632| 632| 		sortingOrder = null;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 680| 680| 					n -= r%2;
| 681| 681| 			}
| 682| 682| 			else if (shape == "triangle")
| 683|    |-			{
|    | 683|+			
| 684| 684| 				if (shiftRows)
| 685| 685| 					var n = r + 1;
| 686| 686| 				else
| 687| 687| 					var n = r * 2 + 1;
| 688|    |-			}
|    | 688|+			
| 689| 689| 			if (!shiftRows && n > left)
| 690| 690| 				n = left;
| 691| 691| 			for (var c = 0; c < n && left > 0; ++c)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 721| 721| 	// calculating offset distances without a zero average makes no sense, as the formation
| 722| 722| 	// will jump to a different position any time
| 723| 723| 	var avgoffset = Vector2D.average(offsets);
| 724|    |-	offsets.forEach(function (o) {o.sub(avgoffset);});
|    | 724|+	offsets.forEach(function(o) {o.sub(avgoffset);});
| 725| 725| 
| 726| 726| 	// sort the available places in certain ways
| 727| 727| 	// the places first in the list will contain the heaviest units as defined by the order
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'column'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column };
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var { sin, cos} = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var {sin, cos } = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = { "sin": 0, "cos": 1};
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = {"sin": 0, "cos": 1 };
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 889| 889| 		cmpOtherFormation.RemoveMembers(otherMembers);
| 890| 890| 		this.AddMembers(otherMembers);
| 891| 891| 		Engine.DestroyEntity(this.twinFormations[i]);
| 892|    |-		this.twinFormations.splice(i,1);
|    | 892|+		this.twinFormations.splice(i, 1);
| 893| 893| 	}
| 894| 894| 	// Switch between column and box if necessary
| 895| 895| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);

binaries/data/mods/public/simulation/components/Formation.js
| 326| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 413| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 459| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 500| »   »   var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 535| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 587| »   »   var·sortingClasses·=·this.sortingClasses.slice();
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 596| »   for·(var·i·in·active)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 611| »   »   »   types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | ['Unknown'] is better written in dot notation.

binaries/data/mods/public/simulation/components/Formation.js
| 651| »   »   for·(var·i·=·0;·i·<·count;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 685| »   »   »   »   »   var·n·=·r·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 687| »   »   »   »   »   var·n·=·r·*·2·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 698| »   »   »   »   »   var·x·=·side·*·Math.ceil(c/2)·*·separation.width;
|    | [NORMAL] JSHintBear:
|    | 'x' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 701| »   »   »   »   »   if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 703| »   »   »   »   »   x·+=·side·*·centerGap·/·2;
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 709| »   »   »   »   offsets.push(new·Vector2D(x·+·r1,·z·+·r2));
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 689| »   »   »   if·(!shiftRows·&&·n·>·left)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 690| »   »   »   »   n·=·left;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 695| »   »   »   »   if·(n%2·==·0)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 705| »   »   »   »   var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 715| »   »   »   this.maxColumnsUsed[r]·=·n;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 588| »   sortingClasses.push("Unknown");
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 593| »   for·(var·i·=·0;·i·<·sortingClasses.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 594| »   »   types[sortingClasses[i]]·=·[];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 601| »   »   for·(var·c·=·0;·c·<·sortingClasses.length;·++c)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 603| »   »   »   if·(classes.indexOf(sortingClasses[c])·>·-1)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 605| »   »   »   »   types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 746| »   »   var·t·=·types[sortingClasses[i-1]];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 851| »   var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitMotion' is already defined.
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  70|  70| // do worry around armies slaughtering the guy standing next to you), etc.
|  71|  71| var g_Stances = {
|  72|  72| 	"violent": {
|  73|    |-		targetVisibleEnemies: true,
|    |  73|+		"targetVisibleEnemies": true,
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  71|  71| var g_Stances = {
|  72|  72| 	"violent": {
|  73|  73| 		targetVisibleEnemies: true,
|  74|    |-		targetAttackersAlways: true,
|    |  74|+		"targetAttackersAlways": true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  72|  72| 	"violent": {
|  73|  73| 		targetVisibleEnemies: true,
|  74|  74| 		targetAttackersAlways: true,
|  75|    |-		respondFlee: false,
|    |  75|+		"respondFlee": false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  73|  73| 		targetVisibleEnemies: true,
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|    |-		respondChase: true,
|    |  76|+		"respondChase": true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|  79|  79| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|    |-		respondChaseBeyondVision: true,
|    |  77|+		"respondChaseBeyondVision": true,
|  78|  78| 		respondStandGround: false,
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|    |-		respondStandGround: false,
|    |  78|+		"respondStandGround": false,
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|  79|    |-		respondHoldGround: false,
|    |  79|+		"respondHoldGround": false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|    |-		targetVisibleEnemies: true,
|    |  82|+		"targetVisibleEnemies": true,
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|  83|    |-		targetAttackersAlways: false,
|    |  83|+		"targetAttackersAlways": false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|  83|  83| 		targetAttackersAlways: false,
|  84|    |-		respondFlee: false,
|    |  84|+		"respondFlee": false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  82|  82| 		targetVisibleEnemies: true,
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|    |-		respondChase: true,
|    |  85|+		"respondChase": true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|  88|  88| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|    |-		respondChaseBeyondVision: false,
|    |  86|+		"respondChaseBeyondVision": false,
|  87|  87| 		respondStandGround: false,
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|    |-		respondStandGround: false,
|    |  87|+		"respondStandGround": false,
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|  88|    |-		respondHoldGround: false,
|    |  88|+		"respondHoldGround": false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|    |-		targetVisibleEnemies: true,
|    |  91|+		"targetVisibleEnemies": true,
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|  92|    |-		targetAttackersAlways: false,
|    |  92|+		"targetAttackersAlways": false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|  92|  92| 		targetAttackersAlways: false,
|  93|    |-		respondFlee: false,
|    |  93|+		"respondFlee": false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  91|  91| 		targetVisibleEnemies: true,
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|    |-		respondChase: false,
|    |  94|+		"respondChase": false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|  97|  97| 		respondHoldGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|    |-		respondChaseBeyondVision: false,
|    |  95|+		"respondChaseBeyondVision": false,
|  96|  96| 		respondStandGround: false,
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|    |-		respondStandGround: false,
|    |  96|+		"respondStandGround": false,
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|  99|  99| 	"passive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|  97|    |-		respondHoldGround: true,
|    |  97|+		"respondHoldGround": true,
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100|    |-		targetVisibleEnemies: false,
|    | 100|+		"targetVisibleEnemies": false,
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
| 101|    |-		targetAttackersAlways: false,
|    | 101|+		"targetAttackersAlways": false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
| 101| 101| 		targetAttackersAlways: false,
| 102|    |-		respondFlee: true,
|    | 102|+		"respondFlee": true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 100| 100| 		targetVisibleEnemies: false,
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103|    |-		respondChase: false,
|    | 103|+		"respondChase": false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
| 106| 106| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104|    |-		respondChaseBeyondVision: false,
|    | 104|+		"respondChaseBeyondVision": false,
| 105| 105| 		respondStandGround: false,
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105|    |-		respondStandGround: false,
|    | 105|+		"respondStandGround": false,
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
| 108| 108| 	"standground": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
| 106|    |-		respondHoldGround: false,
|    | 106|+		"respondHoldGround": false,
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109|    |-		targetVisibleEnemies: true,
|    | 109|+		"targetVisibleEnemies": true,
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
| 110|    |-		targetAttackersAlways: false,
|    | 110|+		"targetAttackersAlways": false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
| 110| 110| 		targetAttackersAlways: false,
| 111|    |-		respondFlee: false,
|    | 111|+		"respondFlee": false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 109| 109| 		targetVisibleEnemies: true,
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112|    |-		respondChase: false,
|    | 112|+		"respondChase": false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
| 115| 115| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113|    |-		respondChaseBeyondVision: false,
|    | 113|+		"respondChaseBeyondVision": false,
| 114| 114| 		respondStandGround: true,
| 115| 115| 		respondHoldGround: false,
| 116| 116| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114|    |-		respondStandGround: true,
|    | 114|+		"respondStandGround": true,
| 115| 115| 		respondHoldGround: false,
| 116| 116| 	},
| 117| 117| };
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
| 115|    |-		respondHoldGround: false,
|    | 115|+		"respondHoldGround": false,
| 116| 116| 	},
| 117| 117| };
| 118| 118| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 213| 213| 		// Move a tile outside the building
| 214| 214| 		let range = 4;
| 215| 215| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 216|    |-		{
|    | 216|+		
| 217| 217| 			// We've started walking to the given point
| 218| 218| 			this.SetNextState("INDIVIDUAL.WALKING");
| 219|    |-		}
|    | 219|+		
| 220| 220| 		else
| 221| 221| 		{
| 222| 222| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 218| 218| 			this.SetNextState("INDIVIDUAL.WALKING");
| 219| 219| 		}
| 220| 220| 		else
| 221|    |-		{
|    | 221|+		
| 222| 222| 			// We are already at the target, or can't move at all
| 223| 223| 			this.FinishOrder();
| 224|    |-		}
|    | 224|+		
| 225| 225| 	},
| 226| 226| 
| 227| 227| 	// Individual orders:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 323| 323| 
| 324| 324| 		var ok = this.MoveToTarget(this.order.data.target);
| 325| 325| 		if (ok)
| 326|    |-		{
|    | 326|+		
| 327| 327| 			// We've started walking to the given point
| 328| 328| 			if (this.IsAnimal())
| 329| 329| 				this.SetNextState("ANIMAL.WALKING");
| 330| 330| 			else
| 331| 331| 				this.SetNextState("INDIVIDUAL.WALKING");
| 332|    |-		}
|    | 332|+		
| 333| 333| 		else
| 334| 334| 		{
| 335| 335| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 351| 351| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 352| 352| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 353| 353| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 354|    |-		{
|    | 354|+		
| 355| 355| 			// we were already on the shoreline, and have not moved since
| 356| 356| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 357| 357| 				needToMove = false;
| 358|    |-		}
|    | 358|+		
| 359| 359| 
| 360| 360| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 361| 361| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 349| 349| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 350| 350| 		var needToMove = true;
| 351| 351| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 352|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 353|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 352|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 353|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 354| 354| 		{
| 355| 355| 			// we were already on the shoreline, and have not moved since
| 356| 356| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 360| 360| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 361| 361| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 362| 362| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 363|    |-		{
|    | 363|+		
| 364| 364| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 365|    |-		}
|    | 365|+		
| 366| 366| 		else
| 367| 367| 		{
| 368| 368| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 389| 389| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 390| 390| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 391| 391| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 392|    |-		{
|    | 392|+		
| 393| 393| 			// We've started fleeing from the given target
| 394| 394| 			if (this.IsAnimal())
| 395| 395| 				this.SetNextState("ANIMAL.FLEEING");
| 396| 396| 			else
| 397| 397| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 398|    |-		}
|    | 398|+		
| 399| 399| 		else
| 400| 400| 		{
| 401| 401| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 445| 445| 			}
| 446| 446| 
| 447| 447| 			if (this.order.data.attackType == this.oldAttackType)
| 448|    |-			{
|    | 448|+			
| 449| 449| 				if (this.IsAnimal())
| 450| 450| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 451| 451| 				else
| 452| 452| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 453|    |-			}
|    | 453|+			
| 454| 454| 			else
| 455| 455| 			{
| 456| 456| 				if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 452| 452| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 453| 453| 			}
| 454| 454| 			else
| 455|    |-			{
|    | 455|+			
| 456| 456| 				if (this.IsAnimal())
| 457| 457| 					this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
| 458| 458| 				else
| 459| 459| 					this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
| 460|    |-			}
|    | 460|+			
| 461| 461| 			return;
| 462| 462| 		}
| 463| 463| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 590| 590| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 591| 591| 				}
| 592| 592| 				else
| 593|    |-				{
|    | 593|+				
| 594| 594| 					// We couldn't move there, or the target moved away
| 595| 595| 					this.FinishOrder();
| 596|    |-				}
|    | 596|+				
| 597| 597| 				return;
| 598| 598| 			}
| 599| 599| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 603| 603| 
| 604| 604| 		// Try to move within range
| 605| 605| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 606|    |-		{
|    | 606|+		
| 607| 607| 			// We've started walking to the given point
| 608| 608| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 609|    |-		}
|    | 609|+		
| 610| 610| 		else
| 611| 611| 		{
| 612| 612| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 680| 680| 	"Order.Repair": function(msg) {
| 681| 681| 		// Try to move within range
| 682| 682| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 683|    |-		{
|    | 683|+		
| 684| 684| 			// We've started walking to the given point
| 685| 685| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 686|    |-		}
|    | 686|+		
| 687| 687| 		else
| 688| 688| 		{
| 689| 689| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 717| 717| 		}
| 718| 718| 
| 719| 719| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 720|    |-		{
|    | 720|+		
| 721| 721| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 722|    |-		}
|    | 722|+		
| 723| 723| 		else
| 724| 724| 		{
| 725| 725| 			// We do a range check before actually garrisoning
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 855| 855| 			if (!this.CheckTargetAttackRange(target, target))
| 856| 856| 			{
| 857| 857| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 858|    |-				{
|    | 858|+				
| 859| 859| 					if (this.MoveToTargetAttackRange(target, target))
| 860| 860| 					{
| 861| 861| 						this.SetNextState("COMBAT.APPROACHING");
| 862| 862| 						return;
| 863| 863| 					}
| 864|    |-				}
|    | 864|+				
| 865| 865| 				this.FinishOrder();
| 866| 866| 				return;
| 867| 867| 			}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 880| 880| 			}
| 881| 881| 			// Check if we are already in range, otherwise walk there
| 882| 882| 			if (!this.CheckGarrisonRange(msg.data.target))
| 883|    |-			{
|    | 883|+			
| 884| 884| 				if (!this.CheckTargetVisible(msg.data.target))
| 885| 885| 				{
| 886| 886| 					this.FinishOrder();
| 895| 895| 						return;
| 896| 896| 					}
| 897| 897| 				}
| 898|    |-			}
|    | 898|+			
| 899| 899| 
| 900| 900| 			this.SetNextState("GARRISON.GARRISONING");
| 901| 901| 		},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 887| 887| 					return;
| 888| 888| 				}
| 889| 889| 				else
| 890|    |-				{
|    | 890|+				
| 891| 891| 					// Out of range; move there in formation
| 892| 892| 					if (this.MoveToGarrisonRange(msg.data.target))
| 893| 893| 					{
| 894| 894| 						this.SetNextState("GARRISON.APPROACHING");
| 895| 895| 						return;
| 896| 896| 					}
| 897|    |-				}
|    | 897|+				
| 898| 898| 			}
| 899| 899| 
| 900| 900| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 886| 886| 					this.FinishOrder();
| 887| 887| 					return;
| 888| 888| 				}
| 889|    |-				else
| 890|    |-				{
|    | 889|+				
| 891| 890| 					// Out of range; move there in formation
| 892| 891| 					if (this.MoveToGarrisonRange(msg.data.target))
| 893| 892| 					{
| 894| 893| 						this.SetNextState("GARRISON.APPROACHING");
| 895| 894| 						return;
| 896| 895| 					}
| 897|    |-				}
|    | 896|+				
| 898| 897| 			}
| 899| 898| 
| 900| 899| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 913| 913| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 914| 914| 					}
| 915| 915| 					else
| 916|    |-					{
|    | 916|+					
| 917| 917| 						// We couldn't move there, or the target moved away
| 918| 918| 						this.FinishOrder();
| 919|    |-					}
|    | 919|+					
| 920| 920| 					return;
| 921| 921| 				}
| 922| 922| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1134|1134| 			},
|1135|1135| 		},
|1136|1136| 
|1137|    |-		"GARRISON":{
|    |1137|+		"GARRISON": {
|1138|1138| 			"enter": function() {
|1139|1139| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1140|1140| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1315|1315| 			// If the controller handled an order but some members rejected it,
|1316|1316| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1317|1317| 			if (this.orderQueue.length)
|1318|    |-			{
|    |1318|+			
|1319|1319| 				// We're leaving the formation, so stop our FormationWalk order
|1320|1320| 				if (this.FinishOrder())
|1321|1321| 					return;
|1322|    |-			}
|    |1322|+			
|1323|1323| 
|1324|1324| 			// No orders left, we're an individual now
|1325|1325| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1343|1343| 			// Move a tile outside the building
|1344|1344| 			let range = 4;
|1345|1345| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1346|    |-			{
|    |1346|+			
|1347|1347| 				// We've started walking to the given point
|1348|1348| 				this.SetNextState("WALKINGTOPOINT");
|1349|    |-			}
|    |1349|+			
|1350|1350| 			else
|1351|1351| 			{
|1352|1352| 				// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1348|1348| 				this.SetNextState("WALKINGTOPOINT");
|1349|1349| 			}
|1350|1350| 			else
|1351|    |-			{
|    |1351|+			
|1352|1352| 				// We are already at the target, or can't move at all
|1353|1353| 				this.FinishOrder();
|1354|    |-			}
|    |1354|+			
|1355|1355| 		},
|1356|1356| 
|1357|1357| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1366|1366| 		},
|1367|1367| 
|1368|1368| 		"WALKING": {
|1369|    |-			"enter": function () {
|    |1369|+			"enter": function() {
|1370|1370| 				let cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
|1371|1371| 				if (cmpFormation)
|1372|1372| 					this.SetAnimationVariant(cmpFormation.GetFormationAnimation(this.entity));
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1540|1540| 
|1541|1541| 			"LosRangeUpdate": function(msg) {
|1542|1542| 				if (this.GetStance().targetVisibleEnemies)
|1543|    |-				{
|    |1543|+				
|1544|1544| 					// Start attacking one of the newly-seen enemy (if any)
|1545|1545| 					this.AttackEntitiesByPreference(msg.data.added);
|1546|    |-				}
|    |1546|+				
|1547|1547| 			},
|1548|1548| 
|1549|1549| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1568|1568| 		},
|1569|1569| 
|1570|1570| 		"WALKING": {
|1571|    |-			"enter": function () {
|    |1571|+			"enter": function() {
|1572|1572| 				this.SelectAnimation("move");
|1573|1573| 			},
|1574|1574| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1578|1578| 		},
|1579|1579| 
|1580|1580| 		"WALKINGANDFIGHTING": {
|1581|    |-			"enter": function () {
|    |1581|+			"enter": function() {
|1582|1582| 				// Show weapons rather than carried resources.
|1583|1583| 				this.SetAnimationVariant("combat");
|1584|1584| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1601|1601| 		},
|1602|1602| 
|1603|1603| 		"PATROL": {
|1604|    |-			"enter": function () {
|    |1604|+			"enter": function() {
|1605|1605| 				// Memorize the origin position in case that we want to go back
|1606|1606| 				let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|1607|1607| 				if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1647|1647| 			},
|1648|1648| 
|1649|1649| 			"ESCORTING": {
|1650|    |-				"enter": function () {
|    |1650|+				"enter": function() {
|1651|1651| 					// Show weapons rather than carried resources.
|1652|1652| 					this.SetAnimationVariant("combat");
|1653|1653| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1697|1697| 			},
|1698|1698| 
|1699|1699| 			"GUARDING": {
|1700|    |-				"enter": function () {
|    |1700|+				"enter": function() {
|1701|1701| 					this.StartTimer(1000, 1000);
|1702|1702| 					this.SetHeldPositionOnEntity(this.entity);
|1703|1703| 					this.SetAnimationVariant("combat");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1726|1726| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1727|1727| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1728|1728| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1729|    |-						{
|    |1729|+						
|1730|1730| 							if (this.CanHeal(this.isGuardOf))
|1731|1731| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1732|1732| 							else if (this.CanRepair(this.isGuardOf))
|1733|1733| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1734|    |-						}
|    |1734|+						
|1735|1735| 					}
|1736|1736| 				},
|1737|1737| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1784|1784| 			},
|1785|1785| 
|1786|1786| 			"APPROACHING": {
|1787|    |-				"enter": function () {
|    |1787|+				"enter": function() {
|1788|1788| 					// Show weapons rather than carried resources.
|1789|1789| 					this.SetAnimationVariant("combat");
|1790|1790| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1814|1814| 				"MoveCompleted": function() {
|1815|1815| 
|1816|1816| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1817|    |-					{
|    |1817|+					
|1818|1818| 						// If the unit needs to unpack, do so
|1819|1819| 						if (this.CanUnpack())
|1820|1820| 						{
|1823|1823| 						}
|1824|1824| 						else
|1825|1825| 							this.SetNextState("ATTACKING");
|1826|    |-					}
|    |1826|+					
|1827|1827| 					else
|1828|1828| 					{
|1829|1829| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1821|1821| 							this.PushOrderFront("Unpack", { "force": true });
|1822|1822| 							return;
|1823|1823| 						}
|1824|    |-						else
|1825|    |-							this.SetNextState("ATTACKING");
|    |1824|+						this.SetNextState("ATTACKING");
|1826|1825| 					}
|1827|1826| 					else
|1828|1827| 					{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1825|1825| 							this.SetNextState("ATTACKING");
|1826|1826| 					}
|1827|1827| 					else
|1828|    |-					{
|    |1828|+					
|1829|1829| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1830|1830| 						{
|1831|1831| 							this.SetNextState("APPROACHING");
|1835|1835| 							// Give up
|1836|1836| 							this.FinishOrder();
|1837|1837| 						}
|1838|    |-					}
|    |1838|+					
|1839|1839| 				},
|1840|1840| 			},
|1841|1841| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1827|1827| 					else
|1828|1828| 					{
|1829|1829| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1830|    |-						{
|    |1830|+						
|1831|1831| 							this.SetNextState("APPROACHING");
|1832|    |-						}
|    |1832|+						
|1833|1833| 						else
|1834|1834| 						{
|1835|1835| 							// Give up
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1831|1831| 							this.SetNextState("APPROACHING");
|1832|1832| 						}
|1833|1833| 						else
|1834|    |-						{
|    |1834|+						
|1835|1835| 							// Give up
|1836|1836| 							this.FinishOrder();
|1837|    |-						}
|    |1837|+						
|1838|1838| 					}
|1839|1839| 				},
|1840|1840| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1852|1852| 					}
|1853|1853| 					// Check the target is still alive and attackable
|1854|1854| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1855|    |-					{
|    |1855|+					
|1856|1856| 						// Can't reach it - try to chase after it
|1857|1857| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1858|1858| 						{
|1862|1862| 								return;
|1863|1863| 							}
|1864|1864| 						}
|1865|    |-					}
|    |1865|+					
|1866|1866| 
|1867|1867| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1868|1868| 					this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1855|1855| 					{
|1856|1856| 						// Can't reach it - try to chase after it
|1857|1857| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1858|    |-						{
|    |1858|+						
|1859|1859| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1860|1860| 							{
|1861|1861| 								this.SetNextState("COMBAT.CHASING");
|1862|1862| 								return;
|1863|1863| 							}
|1864|    |-						}
|    |1864|+						
|1865|1865| 					}
|1866|1866| 
|1867|1867| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1893|1893| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1894|1894| 
|1895|1895| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1896|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1896|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1897|1897| 
|1898|1898| 					this.FaceTowardsTarget(this.order.data.target);
|1899|1899| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1968|1968| 
|1969|1969| 						// Can't reach it - try to chase after it
|1970|1970| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1971|    |-						{
|    |1971|+						
|1972|1972| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1973|1973| 							{
|1974|1974| 								this.SetNextState("COMBAT.CHASING");
|1975|1975| 								return;
|1976|1976| 							}
|1977|    |-						}
|    |1977|+						
|1978|1978| 					}
|1979|1979| 
|1980|1980| 					// if we're targetting a formation, find a new member of that formation
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2015|2015| 
|2016|2016| 				"Attacked": function(msg) {
|2017|2017| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2018|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2019|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2018|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2019|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2020|2020| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2021|2021| 				},
|2022|2022| 			},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2022|2022| 			},
|2023|2023| 
|2024|2024| 			"CHASING": {
|2025|    |-				"enter": function () {
|    |2025|+				"enter": function() {
|2026|2026| 					// Show weapons rather than carried resources.
|2027|2027| 					this.SetAnimationVariant("combat");
|2028|2028| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2097|2097| 
|2098|2098| 						// Try to find another nearby target of the same specific type
|2099|2099| 						// Also don't switch to a different type of huntable animal
|2100|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2100|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2101|2101| 							return (
|2102|2102| 								ent != oldTarget
|2103|2103| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2099|2099| 						// Also don't switch to a different type of huntable animal
|2100|2100| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2101|2101| 							return (
|2102|    |-								ent != oldTarget
|2103|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2102|+								ent != oldTarget &&
|    |2103|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2104|2104| 								 || (type.specific == oldType.specific
|2105|2105| 								 && (type.specific != "meat" || oldTemplate == template)))
|2106|2106| 							);
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2100|2100| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2101|2101| 							return (
|2102|2102| 								ent != oldTarget
|2103|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2104|    |-								 || (type.specific == oldType.specific
|    |2103|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2104|+								 (type.specific == oldType.specific
|2105|2105| 								 && (type.specific != "meat" || oldTemplate == template)))
|2106|2106| 							);
|2107|2107| 						}, oldTarget);
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2101|2101| 							return (
|2102|2102| 								ent != oldTarget
|2103|2103| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2104|    |-								 || (type.specific == oldType.specific
|2105|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2104|+								 || (type.specific == oldType.specific &&
|    |2105|+								 (type.specific != "meat" || oldTemplate == template)))
|2106|2106| 							);
|2107|2107| 						}, oldTarget);
|2108|2108| 						if (nearby)
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2110|2110| 							this.PerformGather(nearby, false, false);
|2111|2111| 							return true;
|2112|2112| 						}
|2113|    |-						else
|2114|    |-						{
|    |2113|+						
|2115|2114| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2116|2115| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2117|2116| 							// to order it to GatherNear the resource position.
|2132|2131| 									return true;
|2133|2132| 								}
|2134|2133| 							}
|2135|    |-						}
|    |2134|+						
|2136|2135| 						return true;
|2137|2136| 					}
|2138|2137| 					return false;
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2122|2122| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2123|2123| 								return true;
|2124|2124| 							}
|2125|    |-							else
|2126|    |-							{
|    |2125|+							
|2127|2126| 								// we're kind of stuck here. Return resource.
|2128|2127| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2129|2128| 								if (nearby)
|2131|2130| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2132|2131| 									return true;
|2133|2132| 								}
|2134|    |-							}
|    |2133|+							
|2135|2134| 						}
|2136|2135| 						return true;
|2137|2136| 					}
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2162|2162| 
|2163|2163| 						// Try to find another nearby target of the same specific type
|2164|2164| 						// Also don't switch to a different type of huntable animal
|2165|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2165|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2166|2166| 							return (
|2167|2167| 								ent != oldTarget
|2168|2168| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2164|2164| 						// Also don't switch to a different type of huntable animal
|2165|2165| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2166|2166| 							return (
|2167|    |-								ent != oldTarget
|2168|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2167|+								ent != oldTarget &&
|    |2168|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2169|2169| 								|| (type.specific == oldType.specific
|2170|2170| 								&& (type.specific != "meat" || oldTemplate == template)))
|2171|2171| 							);
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2165|2165| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2166|2166| 							return (
|2167|2167| 								ent != oldTarget
|2168|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2169|    |-								|| (type.specific == oldType.specific
|    |2168|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2169|+								(type.specific == oldType.specific
|2170|2170| 								&& (type.specific != "meat" || oldTemplate == template)))
|2171|2171| 							);
|2172|2172| 						});
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2166|2166| 							return (
|2167|2167| 								ent != oldTarget
|2168|2168| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2169|    |-								|| (type.specific == oldType.specific
|2170|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2169|+								|| (type.specific == oldType.specific &&
|    |2170|+								(type.specific != "meat" || oldTemplate == template)))
|2171|2171| 							);
|2172|2172| 						});
|2173|2173| 						if (nearby)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2209|2209| 
|2210|2210| 					// Try to find another nearby target of the same specific type
|2211|2211| 					// Also don't switch to a different type of huntable animal
|2212|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2212|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2213|2213| 						return (
|2214|2214| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2215|2215| 							|| (type.specific == resourceType.specific
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2211|2211| 					// Also don't switch to a different type of huntable animal
|2212|2212| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2213|2213| 						return (
|2214|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2215|    |-							|| (type.specific == resourceType.specific
|    |2214|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2215|+							(type.specific == resourceType.specific
|2216|2216| 							&& (type.specific != "meat" || resourceTemplate == template))
|2217|2217| 						);
|2218|2218| 					});
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2212|2212| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2213|2213| 						return (
|2214|2214| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2215|    |-							|| (type.specific == resourceType.specific
|2216|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2215|+							|| (type.specific == resourceType.specific &&
|    |2216|+							(type.specific != "meat" || resourceTemplate == template))
|2217|2217| 						);
|2218|2218| 					});
|2219|2219| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2328|2328| 
|2329|2329| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2330|2330| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2331|    |-					{
|    |2331|+					
|2332|2332| 						// Check we can still reach and gather from the target
|2333|2333| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2334|2334| 						{
|2394|2394| 								return;
|2395|2395| 							}
|2396|2396| 						}
|2397|    |-					}
|    |2397|+					
|2398|2398| 
|2399|2399| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2400|2400| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2418|2418| 
|2419|2419| 					// Try to find a new resource of the same specific type near our current position:
|2420|2420| 					// Also don't switch to a different type of huntable animal
|2421|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2421|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2422|2422| 						return (
|2423|2423| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2424|2424| 							|| (type.specific == resourceType.specific
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2420|2420| 					// Also don't switch to a different type of huntable animal
|2421|2421| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2422|2422| 						return (
|2423|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2424|    |-							|| (type.specific == resourceType.specific
|    |2423|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2424|+							(type.specific == resourceType.specific
|2425|2425| 							&& (type.specific != "meat" || resourceTemplate == template))
|2426|2426| 						);
|2427|2427| 					});
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2421|2421| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2422|2422| 						return (
|2423|2423| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2424|    |-							|| (type.specific == resourceType.specific
|2425|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2424|+							|| (type.specific == resourceType.specific &&
|    |2425|+							(type.specific != "meat" || resourceTemplate == template))
|2426|2426| 						);
|2427|2427| 					});
|2428|2428| 					if (nearby)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2462|2462| 			},
|2463|2463| 
|2464|2464| 			"APPROACHING": {
|2465|    |-				"enter": function () {
|    |2465|+				"enter": function() {
|2466|2466| 					this.SelectAnimation("move");
|2467|2467| 					this.StartTimer(1000, 1000);
|2468|2468| 				},
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2508|2508| 					this.StartTimer(prepare, this.healTimers.repeat);
|2509|2509| 
|2510|2510| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2511|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2511|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2512|2512| 
|2513|2513| 					this.FaceTowardsTarget(this.order.data.target);
|2514|2514| 				},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2541|2541| 						}
|2542|2542| 						// Can't reach it - try to chase after it
|2543|2543| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|2544|    |-						{
|    |2544|+						
|2545|2545| 							if (this.MoveToTargetRange(target, IID_Heal))
|2546|2546| 							{
|2547|2547| 								this.SetNextState("HEAL.CHASING");
|2548|2548| 								return;
|2549|2549| 							}
|2550|    |-						}
|    |2550|+						
|2551|2551| 					}
|2552|2552| 					// Can't reach it, healed to max hp or doesn't exist any more - give up
|2553|2553| 					if (this.FinishOrder())
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2563|2563| 				},
|2564|2564| 			},
|2565|2565| 			"CHASING": {
|2566|    |-				"enter": function () {
|    |2566|+				"enter": function() {
|2567|2567| 					this.SelectAnimation("move");
|2568|2568| 					this.StartTimer(1000, 1000);
|2569|2569| 				},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2568|2568| 					this.StartTimer(1000, 1000);
|2569|2569| 				},
|2570|2570| 
|2571|    |-				"leave": function () {
|    |2571|+				"leave": function() {
|2572|2572| 					this.StopTimer();
|2573|2573| 				},
|2574|2574| 				"Timer": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2582|2582| 							this.WalkToHeldPosition();
|2583|2583| 					}
|2584|2584| 				},
|2585|    |-				"MoveCompleted": function () {
|    |2585|+				"MoveCompleted": function() {
|2586|2586| 					this.SetNextState("HEALING");
|2587|2587| 				},
|2588|2588| 			},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2591|2591| 		// Returning to dropsite
|2592|2592| 		"RETURNRESOURCE": {
|2593|2593| 			"APPROACHING": {
|2594|    |-				"enter": function () {
|    |2594|+				"enter": function() {
|2595|2595| 					this.SelectAnimation("move");
|2596|2596| 				},
|2597|2597| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2649|2649| 			},
|2650|2650| 
|2651|2651| 			"APPROACHINGMARKET": {
|2652|    |-				"enter": function () {
|    |2652|+				"enter": function() {
|2653|2653| 					this.SelectAnimation("move");
|2654|2654| 				},
|2655|2655| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2677|2677| 
|2678|2678| 		"REPAIR": {
|2679|2679| 			"APPROACHING": {
|2680|    |-				"enter": function () {
|    |2680|+				"enter": function() {
|2681|2681| 					this.SelectAnimation("move");
|2682|2682| 				},
|2683|2683| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2718|2718| 					{
|2719|2719| 						// The building was already finished/fully repaired before we arrived;
|2720|2720| 						// let the ConstructionFinished handler handle this.
|2721|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2721|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2722|2722| 						return true;
|2723|2723| 					}
|2724|2724| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2718|2718| 					{
|2719|2719| 						// The building was already finished/fully repaired before we arrived;
|2720|2720| 						// let the ConstructionFinished handler handle this.
|2721|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2721|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2722|2722| 						return true;
|2723|2723| 					}
|2724|2724| 
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2758|2758| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2759|2759| 						this.SetNextState("APPROACHING");
|2760|2760| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2761|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2761|+						this.FinishOrder(); // can't approach and isn't in reach
|2762|2762| 				},
|2763|2763| 			},
|2764|2764| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2825|2825| 					var types = cmpResourceDropsite.GetTypes();
|2826|2826| 					// TODO: Slightly undefined behavior here, we don't know what type of resource will be collected,
|2827|2827| 					//   may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that!
|2828|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2828|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2829|2829| 						return (types.indexOf(type.generic) != -1);
|2830|2830| 					}, msg.data.newentity);
|2831|2831| 					if (nearby)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2845|2845| 
|2846|2846| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2847|2847| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2848|    |-				{
|    |2848|+				
|2849|2849| 					// We're already walking to the given point, so add this as a order.
|2850|2850| 					this.WalkToTarget(msg.data.newentity, true);
|2851|    |-				}
|    |2851|+				
|2852|2852| 			},
|2853|2853| 		},
|2854|2854| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2895|2895| 
|2896|2896| 					// Check that we can garrison here
|2897|2897| 					if (this.CanGarrison(target))
|2898|    |-					{
|    |2898|+					
|2899|2899| 						// Check that we're in range of the garrison target
|2900|2900| 						if (this.CheckGarrisonRange(target))
|2901|2901| 						{
|2971|2971| 								return false;
|2972|2972| 							}
|2973|2973| 						}
|2974|    |-					}
|    |2974|+					
|2975|2975| 					// Garrisoning failed for some reason, so finish the order
|2976|2976| 					this.FinishOrder();
|2977|2977| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3088|3088| 		"Attacked": function(msg) {
|3089|3089| 			if (this.template.NaturalBehaviour == "skittish" ||
|3090|3090| 			    this.template.NaturalBehaviour == "passive")
|3091|    |-			{
|    |3091|+			
|3092|3092| 				this.Flee(msg.data.attacker, false);
|3093|    |-			}
|    |3093|+			
|3094|3094| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3095|3095| 			{
|3096|3096| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3097|3097| 					this.Attack(msg.data.attacker, false);
|3098|3098| 			}
|3099|3099| 			else if (this.template.NaturalBehaviour == "domestic")
|3100|    |-			{
|    |3100|+			
|3101|3101| 				// Never flee, stop what we were doing
|3102|3102| 				this.SetNextState("IDLE");
|3103|    |-			}
|    |3103|+			
|3104|3104| 		},
|3105|3105| 
|3106|3106| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3107|3107| 			// Move a tile outside the building
|3108|3108| 			var range = 4;
|3109|3109| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3110|    |-			{
|    |3110|+			
|3111|3111| 				// We've started walking to the given point
|3112|3112| 				this.SetNextState("WALKING");
|3113|    |-			}
|    |3113|+			
|3114|3114| 			else
|3115|3115| 			{
|3116|3116| 				// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3112|3112| 				this.SetNextState("WALKING");
|3113|3113| 			}
|3114|3114| 			else
|3115|    |-			{
|    |3115|+			
|3116|3116| 				// We are already at the target, or can't move at all
|3117|3117| 				this.FinishOrder();
|3118|    |-			}
|    |3118|+			
|3119|3119| 		},
|3120|3120| 
|3121|3121| 		"IDLE": {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3154|3154| 				}
|3155|3155| 				// Start attacking one of the newly-seen enemy (if any)
|3156|3156| 				else if (this.IsDangerousAnimal())
|3157|    |-				{
|    |3157|+				
|3158|3158| 					this.AttackVisibleEntity(msg.data.added);
|3159|    |-				}
|    |3159|+				
|3160|3160| 
|3161|3161| 				// TODO: if two units enter our range together, we'll attack the
|3162|3162| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3197|3197| 				}
|3198|3198| 				// Start attacking one of the newly-seen enemy (if any)
|3199|3199| 				else if (this.template.NaturalBehaviour == "violent")
|3200|    |-				{
|    |3200|+				
|3201|3201| 					this.AttackVisibleEntity(msg.data.added);
|3202|    |-				}
|    |3202|+				
|3203|3203| 			},
|3204|3204| 
|3205|3205| 			"MoveCompleted": function() { },
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3214|3214| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3215|3215| 
|3216|3216| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3217|    |-							// only used for domestic animals
|    |3217|+		// only used for domestic animals
|3218|3218| 	},
|3219|3219| };
|3220|3220| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3271|3271| 
|3272|3272| UnitAI.prototype.IsAnimal = function()
|3273|3273| {
|3274|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3274|+	return (!!this.template.NaturalBehaviour);
|3275|3275| };
|3276|3276| 
|3277|3277| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3309|3309| UnitAI.prototype.GetGarrisonHolder = function()
|3310|3310| {
|3311|3311| 	if (this.IsGarrisoned())
|3312|    |-	{
|    |3312|+	
|3313|3313| 		for (let order of this.orderQueue)
|3314|3314| 			if (order.type == "Garrison" || order.type == "Autogarrison")
|3315|3315| 				return order.data.target;
|3316|    |-	}
|    |3316|+	
|3317|3317| 	return INVALID_ENTITY;
|3318|3318| };
|3319|3319| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3390|3390| 		{
|3391|3391| 			let index = this.GetCurrentState().indexOf(".");
|3392|3392| 			if (index != -1)
|3393|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3393|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3394|3394| 			this.Stop(false);
|3395|3395| 		}
|3396|3396| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3446|3446| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3447|3447| 			continue;
|3448|3448| 		if (i == 0)
|3449|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3449|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3450|3450| 		else
|3451|3451| 			this.orderQueue.splice(i, 1);
|3452|3452| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3446|3446| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3447|3447| 			continue;
|3448|3448| 		if (i == 0)
|3449|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3449|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3450|3450| 		else
|3451|3451| 			this.orderQueue.splice(i, 1);
|3452|3452| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3530|3530| };
|3531|3531| 
|3532|3532| 
|3533|    |-//// FSM linkage functions ////
|    |3533|+// // FSM linkage functions ////
|3534|3534| 
|3535|3535| UnitAI.prototype.SetNextState = function(state)
|3536|3536| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3581|3581| 	if (this.orderQueue.length)
|3582|3582| 	{
|3583|3583| 		let ret = this.UnitFsm.ProcessMessage(this,
|3584|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3584|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3585|3585| 		);
|3586|3586| 
|3587|3587| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3581|3581| 	if (this.orderQueue.length)
|3582|3582| 	{
|3583|3583| 		let ret = this.UnitFsm.ProcessMessage(this,
|3584|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3584|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3585|3585| 		);
|3586|3586| 
|3587|3587| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3594|3594| 		// Otherwise we've successfully processed a new order
|3595|3595| 		return true;
|3596|3596| 	}
|3597|    |-	else
|3598|    |-	{
|    |3597|+	
|3599|3598| 		this.SetNextState("IDLE");
|3600|3599| 
|3601|3600| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3616|3615| 		}
|3617|3616| 
|3618|3617| 		return false;
|3619|    |-	}
|    |3618|+	
|3620|3619| };
|3621|3620| 
|3622|3621| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3633|3633| 	{
|3634|3634| 		this.order = order;
|3635|3635| 		let ret = this.UnitFsm.ProcessMessage(this,
|3636|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3636|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3637|3637| 		);
|3638|3638| 
|3639|3639| 		// If the order was rejected then immediately take it off
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3633|3633| 	{
|3634|3634| 		this.order = order;
|3635|3635| 		let ret = this.UnitFsm.ProcessMessage(this,
|3636|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3636|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3637|3637| 		);
|3638|3638| 
|3639|3639| 		// If the order was rejected then immediately take it off
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3669|3669| 		this.orderQueue.unshift(order);
|3670|3670| 		this.order = order;
|3671|3671| 		let ret = this.UnitFsm.ProcessMessage(this,
|3672|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3672|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3673|3673| 		);
|3674|3674| 
|3675|3675| 		// If the order was rejected then immediately take it off again;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3669|3669| 		this.orderQueue.unshift(order);
|3670|3670| 		this.order = order;
|3671|3671| 		let ret = this.UnitFsm.ProcessMessage(this,
|3672|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3672|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3673|3673| 		);
|3674|3674| 
|3675|3675| 		// If the order was rejected then immediately take it off again;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3703|3703| 				continue;
|3704|3704| 			if (this.orderQueue[i].type == type)
|3705|3705| 				continue;
|3706|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3706|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3707|3707| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3708|3708| 			return;
|3709|3709| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3703|3703| 				continue;
|3704|3704| 			if (this.orderQueue[i].type == type)
|3705|3705| 				continue;
|3706|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3706|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3707|3707| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3708|3708| 			return;
|3709|3709| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3717|3717| {
|3718|3718| 	// Remember the previous work orders to be able to go back to them later if required
|3719|3719| 	if (data && data.force)
|3720|    |-	{
|    |3720|+	
|3721|3721| 		if (this.IsFormationController())
|3722|3722| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3723|3723| 		else
|3724|3724| 			this.UpdateWorkOrders(type);
|3725|    |-	}
|    |3725|+	
|3726|3726| 
|3727|3727| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3728|3728| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3794|3794| 	{
|3795|3795| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3796|3796| 		if (cmpUnitAI)
|3797|    |-		{
|    |3797|+		
|3798|3798| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3799|3799| 			{
|3800|3800| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3803|3803| 					return;
|3804|3804| 				}
|3805|3805| 			}
|3806|    |-		}
|    |3806|+		
|3807|3807| 	}
|3808|3808| 
|3809|3809| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3796|3796| 		if (cmpUnitAI)
|3797|3797| 		{
|3798|3798| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3799|    |-			{
|    |3799|+			
|3800|3800| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3801|3801| 				{
|3802|3802| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3803|3803| 					return;
|3804|3804| 				}
|3805|    |-			}
|    |3805|+			
|3806|3806| 		}
|3807|3807| 	}
|3808|3808| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3808|3808| 
|3809|3809| 	// If nothing found, take the unit orders
|3810|3810| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3811|    |-	{
|    |3811|+	
|3812|3812| 		if (isWorkType(this.orderQueue[i].type))
|3813|3813| 		{
|3814|3814| 			this.workOrders = this.orderQueue.slice(i);
|3815|3815| 			return;
|3816|3816| 		}
|3817|    |-	}
|    |3817|+	
|3818|3818| };
|3819|3819| 
|3820|3820| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3874|3874| 	if (data.timerRepeat === undefined)
|3875|3875| 		this.timer = undefined;
|3876|3876| 
|3877|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3877|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3878|3878| };
|3879|3879| 
|3880|3880| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3874|3874| 	if (data.timerRepeat === undefined)
|3875|3875| 		this.timer = undefined;
|3876|3876| 
|3877|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3877|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3878|3878| };
|3879|3879| 
|3880|3880| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3909|3909| 	this.timer = undefined;
|3910|3910| };
|3911|3911| 
|3912|    |-//// Message handlers /////
|    |3912|+// // Message handlers /////
|3913|3913| 
|3914|3914| UnitAI.prototype.OnMotionChanged = function(msg)
|3915|3915| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3914|3914| UnitAI.prototype.OnMotionChanged = function(msg)
|3915|3915| {
|3916|3916| 	if (msg.starting && !msg.error)
|3917|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3917|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3918|3918| 	else if (!msg.starting || msg.error)
|3919|3919| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3920|3920| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3914|3914| UnitAI.prototype.OnMotionChanged = function(msg)
|3915|3915| {
|3916|3916| 	if (msg.starting && !msg.error)
|3917|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3917|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3918|3918| 	else if (!msg.starting || msg.error)
|3919|3919| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3920|3920| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3916|3916| 	if (msg.starting && !msg.error)
|3917|3917| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3918|3918| 	else if (!msg.starting || msg.error)
|3919|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3919|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3920|3920| };
|3921|3921| 
|3922|3922| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3916|3916| 	if (msg.starting && !msg.error)
|3917|3917| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3918|3918| 	else if (!msg.starting || msg.error)
|3919|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3919|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3920|3920| };
|3921|3921| 
|3922|3922| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3924|3924| 	// TODO: This is a bit inefficient since every unit listens to every
|3925|3925| 	// construction message - ideally we could scope it to only the one we're building
|3926|3926| 
|3927|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3927|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3928|3928| };
|3929|3929| 
|3930|3930| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3924|3924| 	// TODO: This is a bit inefficient since every unit listens to every
|3925|3925| 	// construction message - ideally we could scope it to only the one we're building
|3926|3926| 
|3927|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3927|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3928|3928| };
|3929|3929| 
|3930|3930| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3949|3949| 
|3950|3950| UnitAI.prototype.OnAttacked = function(msg)
|3951|3951| {
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3952|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3953|3953| };
|3954|3954| 
|3955|3955| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3949|3949| 
|3950|3950| UnitAI.prototype.OnAttacked = function(msg)
|3951|3951| {
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3952|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3953|3953| };
|3954|3954| 
|3955|3955| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3954|3954| 
|3955|3955| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3956|3956| {
|3957|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3957|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3958|3958| };
|3959|3959| 
|3960|3960| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3954|3954| 
|3955|3955| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3956|3956| {
|3957|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3957|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3958|3958| };
|3959|3959| 
|3960|3960| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3959|3959| 
|3960|3960| UnitAI.prototype.OnHealthChanged = function(msg)
|3961|3961| {
|3962|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3962|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3963|3963| };
|3964|3964| 
|3965|3965| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3959|3959| 
|3960|3960| UnitAI.prototype.OnHealthChanged = function(msg)
|3961|3961| {
|3962|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3962|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3963|3963| };
|3964|3964| 
|3965|3965| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3965|3965| UnitAI.prototype.OnRangeUpdate = function(msg)
|3966|3966| {
|3967|3967| 	if (msg.tag == this.losRangeQuery)
|3968|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3968|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3969|3969| 	else if (msg.tag == this.losHealRangeQuery)
|3970|3970| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3971|3971| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3965|3965| UnitAI.prototype.OnRangeUpdate = function(msg)
|3966|3966| {
|3967|3967| 	if (msg.tag == this.losRangeQuery)
|3968|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3968|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3969|3969| 	else if (msg.tag == this.losHealRangeQuery)
|3970|3970| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3971|3971| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3967|3967| 	if (msg.tag == this.losRangeQuery)
|3968|3968| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3969|3969| 	else if (msg.tag == this.losHealRangeQuery)
|3970|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3970|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3971|3971| };
|3972|3972| 
|3973|3973| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3967|3967| 	if (msg.tag == this.losRangeQuery)
|3968|3968| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3969|3969| 	else if (msg.tag == this.losHealRangeQuery)
|3970|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3970|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3971|3971| };
|3972|3972| 
|3973|3973| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3972|3972| 
|3973|3973| UnitAI.prototype.OnPackFinished = function(msg)
|3974|3974| {
|3975|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3975|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3976|3976| };
|3977|3977| 
|3978|3978| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3972|3972| 
|3973|3973| UnitAI.prototype.OnPackFinished = function(msg)
|3974|3974| {
|3975|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3975|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3976|3976| };
|3977|3977| 
|3978|3978| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3975|3975| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3976|3976| };
|3977|3977| 
|3978|    |-//// Helper functions to be called by the FSM ////
|    |3978|+// // Helper functions to be called by the FSM ////
|3979|3979| 
|3980|3980| UnitAI.prototype.GetWalkSpeed = function()
|3981|3981| {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4079|4079| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4080|4080| 		return undefined;
|4081|4081| 
|4082|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4082|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4083|4083| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4084|4084| 		return undefined;
|4085|4085| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4164|4164| 			PlaySound(name, member);
|4165|4165| 	}
|4166|4166| 	else
|4167|    |-	{
|    |4167|+	
|4168|4168| 		// Otherwise use our own sounds
|4169|4169| 		PlaySound(name, this.entity);
|4170|    |-	}
|    |4170|+	
|4171|4171| };
|4172|4172| 
|4173|4173| /*
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4333|4333| 	else
|4334|4334| 		// return false? Or hope you come close enough?
|4335|4335| 		var parabolicMaxRange = 0;
|4336|    |-		//return false;
|    |4336|+		// return false;
|4337|4337| 
|4338|4338| 	// the parabole changes while walking, take something in the middle
|4339|4339| 	var guessedMaxRange = (range.max + parabolicMaxRange)/2;
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4398|4398| 	if (this.IsFormationMember())
|4399|4399| 	{
|4400|4400| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4401|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4402|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4401|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4402|+			cmpFormationUnitAI.order.data.target == target)
|4403|4403| 			return true;
|4404|4404| 	}
|4405|4405| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4518|4518| 	var pos = cmpPosition.GetPosition();
|4519|4519| 	var heldPosition = this.heldPosition;
|4520|4520| 	if (heldPosition === undefined)
|4521|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4521|+		heldPosition = { "x": pos.x, "z": pos.z};
|4522|4522| 
|4523|4523| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4524|4524| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4518|4518| 	var pos = cmpPosition.GetPosition();
|4519|4519| 	var heldPosition = this.heldPosition;
|4520|4520| 	if (heldPosition === undefined)
|4521|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4521|+		heldPosition = {"x": pos.x, "z": pos.z };
|4522|4522| 
|4523|4523| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4524|4524| };
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4566|4566| UnitAI.prototype.AttackEntityInZone = function(ents)
|4567|4567| {
|4568|4568| 	var target = ents.find(target =>
|4569|    |-		this.CanAttack(target)
|4570|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4569|+		this.CanAttack(target) &&
|    |4570|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4571|4571| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4572|4572| 	);
|4573|4573| 	if (!target)
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4567|4567| {
|4568|4568| 	var target = ents.find(target =>
|4569|4569| 		this.CanAttack(target)
|4570|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4571|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4570|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4571|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4572|4572| 	);
|4573|4573| 	if (!target)
|4574|4574| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4631|4631| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4632|4632| 	if (this.isGuardOf)
|4633|4633| 	{
|4634|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4634|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4635|4635| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4636|4636| 		if (cmpUnitAI && cmpAttack &&
|4637|4637| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4635|4635| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4636|4636| 		if (cmpUnitAI && cmpAttack &&
|4637|4637| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4638|    |-				return false;
|    |4638|+			return false;
|4639|4639| 	}
|4640|4640| 
|4641|4641| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4640|4640| 
|4641|4641| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4642|4642| 	if (this.GetStance().respondHoldGround)
|4643|    |-	{
|    |4643|+	
|4644|4644| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4645|4645| 			return true;
|4646|    |-	}
|    |4646|+	
|4647|4647| 
|4648|4648| 	// Stop if it's left our vision range, unless we're especially persistent
|4649|4649| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4647|4647| 
|4648|4648| 	// Stop if it's left our vision range, unless we're especially persistent
|4649|4649| 	if (!this.GetStance().respondChaseBeyondVision)
|4650|    |-	{
|    |4650|+	
|4651|4651| 		if (!this.CheckTargetIsInVisionRange(target))
|4652|4652| 			return true;
|4653|    |-	}
|    |4653|+	
|4654|4654| 
|4655|4655| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4656|4656| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4678|4678| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4679|4679| 	if (this.isGuardOf)
|4680|4680| 	{
|4681|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4681|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4682|4682| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4683|4683| 		if (cmpUnitAI && cmpAttack &&
|4684|4684| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4691|4691| 	return false;
|4692|4692| };
|4693|4693| 
|4694|    |-//// External interface functions ////
|    |4694|+// // External interface functions ////
|4695|4695| 
|4696|4696| UnitAI.prototype.SetFormationController = function(ent)
|4697|4697| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4701|4701| 	// of our own formation (or ourself if not in formation)
|4702|4702| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4703|4703| 	if (cmpObstruction)
|4704|    |-	{
|    |4704|+	
|4705|4705| 		if (ent == INVALID_ENTITY)
|4706|4706| 			cmpObstruction.SetControlGroup(this.entity);
|4707|4707| 		else
|4708|4708| 			cmpObstruction.SetControlGroup(ent);
|4709|    |-	}
|    |4709|+	
|4710|4710| 
|4711|4711| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4712|4712| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4844|4844| 	// if we already had an old guard order, do nothing if the target is the same
|4845|4845| 	// and the order is running, otherwise remove the previous order
|4846|4846| 	if (this.isGuardOf)
|4847|    |-	{
|    |4847|+	
|4848|4848| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4849|4849| 			return;
|4850|4850| 		else
|4851|4851| 			this.RemoveGuard();
|4852|    |-	}
|    |4852|+	
|4853|4853| 
|4854|4854| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4855|4855| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4847|4847| 	{
|4848|4848| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4849|4849| 			return;
|4850|    |-		else
|4851|    |-			this.RemoveGuard();
|    |4850|+		this.RemoveGuard();
|4852|4851| 	}
|4853|4852| 
|4854|4853| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4889|4889| 		return;
|4890|4890| 
|4891|4891| 	if (this.order.type == "Guard")
|4892|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4892|+		this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"});
|4893|4893| 	else
|4894|4894| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4895|4895| 			if (this.orderQueue[i].type == "Guard")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4889|4889| 		return;
|4890|4890| 
|4891|4891| 	if (this.order.type == "Guard")
|4892|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4892|+		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" });
|4893|4893| 	else
|4894|4894| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4895|4895| 			if (this.orderQueue[i].type == "Guard")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5018|5018| 			this.WalkToTarget(target, queued);
|5019|5019| 		return;
|5020|5020| 	}
|5021|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |5021|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|5022|5022| };
|5023|5023| 
|5024|5024| /**
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5167|5167| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5168|5168| 	{
|5169|5169| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5170|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5170|+		if (cmpTrader.HasBothMarkets() &&
|5171|5171| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5172|5172| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5173|5173| 		{
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5448|5448| 				{
|5449|5449| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5450|5450| 					var targetClasses = this.order.data.targetClasses;
|5451|    |-					if (targetClasses.attack && cmpIdentity
|5452|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5451|+					if (targetClasses.attack && cmpIdentity &&
|    |5452|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5453|5453| 						continue;
|5454|5454| 					if (targetClasses.avoid && cmpIdentity
|5455|5455| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5451|5451| 					if (targetClasses.attack && cmpIdentity
|5452|5452| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5453|5453| 						continue;
|5454|    |-					if (targetClasses.avoid && cmpIdentity
|5455|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5454|+					if (targetClasses.avoid && cmpIdentity &&
|    |5455|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5456|5456| 						continue;
|5457|5457| 					// Only used by the AIs to prevent some choices of targets
|5458|5458| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5474|5474| 		{
|5475|5475| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5476|5476| 			var targetClasses = this.order.data.targetClasses;
|5477|    |-			if (cmpIdentity && targetClasses.attack
|5478|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5477|+			if (cmpIdentity && targetClasses.attack &&
|    |5478|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5479|5479| 				continue;
|5480|5480| 			if (cmpIdentity && targetClasses.avoid
|5481|5481| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5477|5477| 			if (cmpIdentity && targetClasses.attack
|5478|5478| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5479|5479| 				continue;
|5480|    |-			if (cmpIdentity && targetClasses.avoid
|5481|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5480|+			if (cmpIdentity && targetClasses.avoid &&
|    |5481|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5482|5482| 				continue;
|5483|5483| 			// Only used by the AIs to prevent some choices of targets
|5484|5484| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5517|5517| 
|5518|5518| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5519|5519| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5520|    |-	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|    |5520|+	var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5521|5521| 		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5522|5522| 
|5523|5523| 	return targets;
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5518|5518| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5519|5519| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5520|5520| 	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5521|    |-		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|    |5521|+		.sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5522|5522| 
|5523|5523| 	return targets;
|5524|5524| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5607|5607| 
|5608|5608| UnitAI.prototype.SetHeldPosition = function(x, z)
|5609|5609| {
|5610|    |-	this.heldPosition = {"x": x, "z": z};
|    |5610|+	this.heldPosition = { "x": x, "z": z};
|5611|5611| };
|5612|5612| 
|5613|5613| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5607|5607| 
|5608|5608| UnitAI.prototype.SetHeldPosition = function(x, z)
|5609|5609| {
|5610|    |-	this.heldPosition = {"x": x, "z": z};
|    |5610|+	this.heldPosition = {"x": x, "z": z };
|5611|5611| };
|5612|5612| 
|5613|5613| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5634|5634| 	return false;
|5635|5635| };
|5636|5636| 
|5637|    |-//// Helper functions ////
|    |5637|+// // Helper functions ////
|5638|5638| 
|5639|5639| UnitAI.prototype.CanAttack = function(target)
|5640|5640| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5838|5838| 	return (cmpPack && cmpPack.IsPacking());
|5839|5839| };
|5840|5840| 
|5841|    |-//// Formation specific functions ////
|    |5841|+// // Formation specific functions ////
|5842|5842| 
|5843|5843| UnitAI.prototype.IsAttackingAsFormation = function()
|5844|5844| {
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5843|5843| UnitAI.prototype.IsAttackingAsFormation = function()
|5844|5844| {
|5845|5845| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5846|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5847|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5846|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5847|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5848|5848| };
|5849|5849| 
|5850|5850| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5847|5847| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5848|5848| };
|5849|5849| 
|5850|    |-//// Animal specific functions ////
|    |5850|+// // Animal specific functions ////
|5851|5851| 
|5852|5852| UnitAI.prototype.MoveRandomly = function(distance)
|5853|5853| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2410| »   »   »   »   »   »   let·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'nearby' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3779| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4553| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4568| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4614| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4637| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|5098| »   var·lastPos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.

binaries/data/mods/public/simulation/components/UnitAI.js
| 353| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1885| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2019| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2103| »   »   »   »   »   »   »   »   ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2104| »   »   »   »   »   »   »   »   ·||·(type.specific·==·oldType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2105| »   »   »   »   »   »   »   »   ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2128| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2168| »   »   »   »   »   »   »   »   &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2169| »   »   »   »   »   »   »   »   ||·(type.specific·==·oldType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2170| »   »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·oldTemplate·==·template)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2215| »   »   »   »   »   »   »   ||·(type.specific·==·resourceType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2216| »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2232| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2405| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2421| »   »   »   »   »   var·nearby·=·this.FindNearbyResource(function·(ent,·type,·template)·{
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2424| »   »   »   »   »   »   »   ||·(type.specific·==·resourceType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2425| »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2445| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2629| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2824| »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceDropsite' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2897| »   »   »   »   »   if·(this.CanGarrison(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2900| »   »   »   »   »   »   if·(this.CheckGarrisonRange(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2902| »   »   »   »   »   »   »   var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2924| »   »   »   »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2925| »   »   »   »   »   »   »   »   if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2940| »   »   »   »   »   »   »   »   »   var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2941| »   »   »   »   »   »   »   »   »   var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2968| »   »   »   »   »   »   »   if·(this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3741| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3810| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4082| »   let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|4335| »   »   var·parabolicMaxRange·=·0;
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4339| »   var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2;
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4346| »   return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange));
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4402| »   »   »   &&·cmpFormationUnitAI.order.data.target·==·target)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4570| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4571| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5098| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

binaries/data/mods/public/simulation/components/UnitAI.js
|5452| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5455| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5468| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5469| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5476| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5478| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5481| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5556| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5561| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5564| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5565| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5565| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [MAJOR] JSHintBear:
|    | Too many errors. (93% scanned).

Link to build: https://jenkins.wildfiregames.com/job/differential/104/display/redirect

wraitii added a subscriber: wraitii.

Definitely a needed change, cheers. Assigning to myself.

wraitii commandeered this revision.Jun 24 2019, 7:42 PM
wraitii updated this revision to Diff 8596.
wraitii edited reviewers, added: temple; removed: wraitii.

Rebased - needs some cleaning, like the anti-cavalry formation no longer has a walk animation which is annoying - I guess I should group the animations better. The limit of one variant per file is quite annoying because it means one must change a lot of files every time -_-

Still would work with D1901

Owners added a subscriber: Restricted Owners Package.Jun 24 2019, 7:43 PM
Stan added a comment.Jun 24 2019, 8:00 PM

Rebased - needs some cleaning, like the anti-cavalry formation no longer has a walk animation which is annoying - I guess I should group the animations better. The limit of one variant per file is quite annoying because it means one must change a lot of files every time -_-
Still would work with D1901

Well you didn't have to do it for the other files :P Else you'd have to update way more files than this :P

For added XML files, please add the XML header, thanks.

binaries/data/mods/public/simulation/components/UnitAI.js.rej
1 ↗(On Diff #8596)

that too.

binaries/data/mods/public/simulation/templates/special/formations/testudo.xml.rej
1 ↗(On Diff #8596)

Should be removed ?

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = { "sin": 0, "cos": 0};
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = {"sin": 0, "cos": 0 };
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return { "width": this.width, "depth": this.depth};
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return {"width": this.width, "depth": this.depth };
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return { "width":1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'width'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width": 1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width":1, "depth": 1 };
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = { "width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = {"width": 0, "depth": 0 };
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561|    |-	{
|    | 561|+	
| 562| 562| 		if (shape.type == "circle")
| 563| 563| 		{
| 564| 564| 			r.width += shape.radius * 2;
| 569| 569| 			r.width += shape.width;
| 570| 570| 			r.depth += shape.depth;
| 571| 571| 		}
| 572|    |-	}
|    | 572|+	
| 573| 573| 	r.width /= footprints.length;
| 574| 574| 	r.depth /= footprints.length;
| 575| 575| 	return r;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 582| 582| 	separation.depth *= this.separationMultiplier.depth;
| 583| 583| 
| 584| 584| 	if (this.columnar)
| 585|    |-		var sortingClasses = ["Cavalry","Infantry"];
|    | 585|+		var sortingClasses = ["Cavalry", "Infantry"];
| 586| 586| 	else
| 587| 587| 		var sortingClasses = this.sortingClasses.slice();
| 588| 588| 	sortingClasses.push("Unknown");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 599| 599| 		var classes = cmpIdentity.GetClassesList();
| 600| 600| 		var done = false;
| 601| 601| 		for (var c = 0; c < sortingClasses.length; ++c)
| 602|    |-		{
|    | 602|+		
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605| 605| 				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
| 609|    |-		}
|    | 609|+		
| 610| 610| 		if (!done)
| 611| 611| 			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] });
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["Unknown"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types.Unknown.push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({ "ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({"ent": active[i], "pos": positions[i] });
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 626| 626| 	if (this.columnar)
| 627| 627| 	{
| 628| 628| 		shape = "square";
| 629|    |-		cols = Math.min(count,3);
|    | 629|+		cols = Math.min(count, 3);
| 630| 630| 		shiftRows = false;
| 631| 631| 		centerGap = 0;
| 632| 632| 		sortingOrder = null;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 680| 680| 					n -= r%2;
| 681| 681| 			}
| 682| 682| 			else if (shape == "triangle")
| 683|    |-			{
|    | 683|+			
| 684| 684| 				if (shiftRows)
| 685| 685| 					var n = r + 1;
| 686| 686| 				else
| 687| 687| 					var n = r * 2 + 1;
| 688|    |-			}
|    | 688|+			
| 689| 689| 			if (!shiftRows && n > left)
| 690| 690| 				n = left;
| 691| 691| 			for (var c = 0; c < n && left > 0; ++c)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 721| 721| 	// calculating offset distances without a zero average makes no sense, as the formation
| 722| 722| 	// will jump to a different position any time
| 723| 723| 	var avgoffset = Vector2D.average(offsets);
| 724|    |-	offsets.forEach(function (o) {o.sub(avgoffset);});
|    | 724|+	offsets.forEach(function(o) {o.sub(avgoffset);});
| 725| 725| 
| 726| 726| 	// sort the available places in certain ways
| 727| 727| 	// the places first in the list will contain the heaviest units as defined by the order
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'column'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column };
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var { sin, cos} = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var {sin, cos } = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = { "sin": 0, "cos": 1};
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = {"sin": 0, "cos": 1 };
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 889| 889| 		cmpOtherFormation.RemoveMembers(otherMembers);
| 890| 890| 		this.AddMembers(otherMembers);
| 891| 891| 		Engine.DestroyEntity(this.twinFormations[i]);
| 892|    |-		this.twinFormations.splice(i,1);
|    | 892|+		this.twinFormations.splice(i, 1);
| 893| 893| 	}
| 894| 894| 	// Switch between column and box if necessary
| 895| 895| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);

binaries/data/mods/public/simulation/components/Formation.js
| 326| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 413| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 459| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 500| »   »   var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 535| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 587| »   »   var·sortingClasses·=·this.sortingClasses.slice();
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 596| »   for·(var·i·in·active)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 611| »   »   »   types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | ['Unknown'] is better written in dot notation.

binaries/data/mods/public/simulation/components/Formation.js
| 651| »   »   for·(var·i·=·0;·i·<·count;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 685| »   »   »   »   »   var·n·=·r·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 687| »   »   »   »   »   var·n·=·r·*·2·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 698| »   »   »   »   »   var·x·=·side·*·Math.ceil(c/2)·*·separation.width;
|    | [NORMAL] JSHintBear:
|    | 'x' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 701| »   »   »   »   »   if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 703| »   »   »   »   »   x·+=·side·*·centerGap·/·2;
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 709| »   »   »   »   offsets.push(new·Vector2D(x·+·r1,·z·+·r2));
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 689| »   »   »   if·(!shiftRows·&&·n·>·left)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 690| »   »   »   »   n·=·left;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 695| »   »   »   »   if·(n%2·==·0)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 705| »   »   »   »   var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 715| »   »   »   this.maxColumnsUsed[r]·=·n;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 588| »   sortingClasses.push("Unknown");
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 593| »   for·(var·i·=·0;·i·<·sortingClasses.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 594| »   »   types[sortingClasses[i]]·=·[];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 601| »   »   for·(var·c·=·0;·c·<·sortingClasses.length;·++c)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 603| »   »   »   if·(classes.indexOf(sortingClasses[c])·>·-1)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 605| »   »   »   »   types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 746| »   »   var·t·=·types[sortingClasses[i-1]];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 851| »   var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitMotion' is already defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 515| 515| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 516| 516| 				}
| 517| 517| 				else
| 518|    |-				{
|    | 518|+				
| 519| 519| 					// We couldn't move there, or the target moved away
| 520| 520| 					this.FinishOrder();
| 521|    |-				}
|    | 521|+				
| 522| 522| 				return;
| 523| 523| 			}
| 524| 524| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 730| 730| 			}
| 731| 731| 			// Check if we are already in range, otherwise walk there
| 732| 732| 			if (!this.CheckGarrisonRange(msg.data.target))
| 733|    |-			{
|    | 733|+			
| 734| 734| 				if (!this.CheckTargetVisible(msg.data.target))
| 735| 735| 				{
| 736| 736| 					this.FinishOrder();
| 741| 741| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 742| 					return;
| 743| 743| 				}
| 744|    |-			}
|    | 744|+			
| 745| 745| 
| 746| 746| 			this.SetNextState("GARRISON.GARRISONING");
| 747| 747| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 					this.FinishOrder();
| 737| 737| 					return;
| 738| 738| 				}
| 739|    |-				else
| 740|    |-				{
|    | 739|+				
| 741| 740| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 741| 					return;
| 743|    |-				}
|    | 742|+				
| 744| 743| 			}
| 745| 744| 
| 746| 745| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 759| 759| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 760| 760| 					}
| 761| 761| 					else
| 762|    |-					{
|    | 762|+					
| 763| 763| 						// We couldn't move there, or the target moved away
| 764| 764| 						this.FinishOrder();
| 765|    |-					}
|    | 765|+					
| 766| 766| 					return;
| 767| 767| 				}
| 768| 768| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 992| 992| 			},
| 993| 993| 		},
| 994| 994| 
| 995|    |-		"GARRISON":{
|    | 995|+		"GARRISON": {
| 996| 996| 			"enter": function() {
| 997| 997| 				// If the garrisonholder should pickup, warn it so it can take needed action
| 998| 998| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1205|1205| 			// If the controller handled an order but some members rejected it,
|1206|1206| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1207|1207| 			if (this.orderQueue.length)
|1208|    |-			{
|    |1208|+			
|1209|1209| 				// We're leaving the formation, so stop our FormationWalk order
|1210|1210| 				if (this.FinishOrder())
|1211|1211| 					return;
|1212|    |-			}
|    |1212|+			
|1213|1213| 
|1214|1214| 			// No orders left, we're an individual now
|1215|1215| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1233|1233| 			// Move a tile outside the building
|1234|1234| 			let range = 4;
|1235|1235| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1236|    |-			{
|    |1236|+			
|1237|1237| 				// We are already at the target, or can't move at all
|1238|1238| 				this.FinishOrder();
|1239|    |-			}
|    |1239|+			
|1240|1240| 			else
|1241|1241| 			{
|1242|1242| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1449|1449| 
|1450|1450| 			"LosRangeUpdate": function(msg) {
|1451|1451| 				if (this.GetStance().targetVisibleEnemies)
|1452|    |-				{
|    |1452|+				
|1453|1453| 					// Start attacking one of the newly-seen enemy (if any)
|1454|1454| 					this.AttackEntitiesByPreference(msg.data.added);
|1455|    |-				}
|    |1455|+				
|1456|1456| 			},
|1457|1457| 
|1458|1458| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1482|1482| 				this.SelectAnimation("move");
|1483|1483| 			},
|1484|1484| 
|1485|    |-			"leave": function () {
|    |1485|+			"leave": function() {
|1486|1486| 				this.SelectAnimation("idle");
|1487|1487| 				this.StopMoving();
|1488|1488| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1662|1662| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1663|1663| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1664|1664| 						if (cmpHealth && cmpHealth.IsInjured())
|1665|    |-						{
|    |1665|+						
|1666|1666| 							if (this.CanHeal(this.isGuardOf))
|1667|1667| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1668|1668| 							else if (this.CanRepair(this.isGuardOf))
|1669|1669| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1670|    |-						}
|    |1670|+						
|1671|1671| 					}
|1672|1672| 				},
|1673|1673| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1789|1789| 					}
|1790|1790| 					// Check the target is still alive and attackable
|1791|1791| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1792|    |-					{
|    |1792|+					
|1793|1793| 						// Can't reach it - try to chase after it
|1794|1794| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1795|1795| 						{
|1802|1802| 							this.SetNextState("COMBAT.CHASING");
|1803|1803| 							return true;
|1804|1804| 						}
|1805|    |-					}
|    |1805|+					
|1806|1806| 
|1807|1807| 					this.StopMoving();
|1808|1808| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1835|1835| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1836|1836| 
|1837|1837| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1838|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1838|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1839|1839| 
|1840|1840| 					this.FaceTowardsTarget(this.order.data.target);
|1841|1841| 
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1961|1961| 
|1962|1962| 				"Attacked": function(msg) {
|1963|1963| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1964|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1965|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1964|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1965|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1966|1966| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1967|1967| 				},
|1968|1968| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1981|1981| 					this.SelectAnimation("move");
|1982|1982| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1983|1983| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1984|    |-					{
|    |1984|+					
|1985|1985| 						// Run after a fleeing target
|1986|1986| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|1987|    |-					}
|    |1987|+					
|1988|1988| 					this.StartTimer(1000, 1000);
|1989|1989| 				},
|1990|1990| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2163|2163| 
|2164|2164| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2165|2165| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2166|    |-					{
|    |2166|+					
|2167|2167| 						// Check we can still reach and gather from the target
|2168|2168| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2169|2169| 						{
|2214|2214| 								return;
|2215|2215| 							}
|2216|2216| 						}
|2217|    |-					}
|    |2217|+					
|2218|2218| 
|2219|2219| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2220|2220| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2206|2206| 								return;
|2207|2207| 						}
|2208|2208| 						else
|2209|    |-						{
|    |2209|+						
|2210|2210| 							// Try to follow the target
|2211|2211| 							if (this.MoveToTargetRange(this.gatheringTarget, IID_ResourceGatherer))
|2212|2212| 							{
|2213|2213| 								this.SetNextState("APPROACHING");
|2214|2214| 								return;
|2215|2215| 							}
|2216|    |-						}
|    |2216|+						
|2217|2217| 					}
|2218|2218| 
|2219|2219| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2240|2240| 					// Also don't switch to a different type of huntable animal
|2241|2241| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2242|2242| 						return (
|2243|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2244|    |-							|| (type.specific == resourceType.specific
|    |2243|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2244|+							(type.specific == resourceType.specific
|2245|2245| 							&& (type.specific != "meat" || resourceTemplate == template))
|2246|2246| 						);
|2247|2247| 					});
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2241|2241| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2242|2242| 						return (
|2243|2243| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2244|    |-							|| (type.specific == resourceType.specific
|2245|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2244|+							|| (type.specific == resourceType.specific &&
|    |2245|+							(type.specific != "meat" || resourceTemplate == template))
|2246|2246| 						);
|2247|2247| 					});
|2248|2248| 					if (nearby)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2306|2306| 
|2307|2307| 				"Timer": function(msg) {
|2308|2308| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2309|    |-					{
|    |2309|+					
|2310|2310| 						// Return to our original position unless we have a better order.
|2311|2311| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2312|2312| 							this.WalkToHeldPosition();
|2313|    |-					}
|    |2313|+					
|2314|2314| 				},
|2315|2315| 
|2316|2316| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2340|2340| 					this.StartTimer(prepare, this.healTimers.repeat);
|2341|2341| 
|2342|2342| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2343|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2343|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2344|2344| 
|2345|2345| 					this.FaceTowardsTarget(this.order.data.target);
|2346|2346| 				},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2553|2553| 					{
|2554|2554| 						// The building was already finished/fully repaired before we arrived;
|2555|2555| 						// let the ConstructionFinished handler handle this.
|2556|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2556|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2557|2557| 						return true;
|2558|2558| 					}
|2559|2559| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2553|2553| 					{
|2554|2554| 						// The building was already finished/fully repaired before we arrived;
|2555|2555| 						// let the ConstructionFinished handler handle this.
|2556|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2556|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2557|2557| 						return true;
|2558|2558| 					}
|2559|2559| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2680|2680| 
|2681|2681| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2682|2682| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2683|    |-				{
|    |2683|+				
|2684|2684| 					// We're already walking to the given point, so add this as a order.
|2685|2685| 					this.WalkToTarget(msg.data.newentity, true);
|2686|    |-				}
|    |2686|+				
|2687|2687| 			},
|2688|2688| 		},
|2689|2689| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2743|2743| 
|2744|2744| 					// Check that we can garrison here
|2745|2745| 					if (this.CanGarrison(target))
|2746|    |-					{
|    |2746|+					
|2747|2747| 						// Check that we're in range of the garrison target
|2748|2748| 						if (this.CheckGarrisonRange(target))
|2749|2749| 						{
|2819|2819| 								return false;
|2820|2820| 							}
|2821|2821| 						}
|2822|    |-					}
|    |2822|+					
|2823|2823| 					// Garrisoning failed for some reason, so finish the order
|2824|2824| 					this.FinishOrder();
|2825|2825| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2941|2941| 		"Attacked": function(msg) {
|2942|2942| 			if (this.template.NaturalBehaviour == "skittish" ||
|2943|2943| 			    this.template.NaturalBehaviour == "passive")
|2944|    |-			{
|    |2944|+			
|2945|2945| 				this.Flee(msg.data.attacker, false);
|2946|    |-			}
|    |2946|+			
|2947|2947| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2948|2948| 			{
|2949|2949| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2950|2950| 					this.Attack(msg.data.attacker, false);
|2951|2951| 			}
|2952|2952| 			else if (this.template.NaturalBehaviour == "domestic")
|2953|    |-			{
|    |2953|+			
|2954|2954| 				// Never flee, stop what we were doing
|2955|2955| 				this.SetNextState("IDLE");
|2956|    |-			}
|    |2956|+			
|2957|2957| 		},
|2958|2958| 
|2959|2959| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2964|2964| 				this.FinishOrder();
|2965|2965| 				return;
|2966|2966| 			}
|2967|    |-			else
|2968|    |-			{
|    |2967|+			
|2969|2968| 				this.order.data.min = range;
|2970|2969| 				this.SetNextState("WALKING");
|2971|    |-			}
|    |2970|+			
|2972|2971| 		},
|2973|2972| 
|2974|2973| 		"IDLE": {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3008|3008| 				}
|3009|3009| 				// Start attacking one of the newly-seen enemy (if any)
|3010|3010| 				else if (this.IsDangerousAnimal())
|3011|    |-				{
|    |3011|+				
|3012|3012| 					this.AttackVisibleEntity(msg.data.added);
|3013|    |-				}
|    |3013|+				
|3014|3014| 
|3015|3015| 				// TODO: if two units enter our range together, we'll attack the
|3016|3016| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3051|3051| 				}
|3052|3052| 				// Start attacking one of the newly-seen enemy (if any)
|3053|3053| 				else if (this.template.NaturalBehaviour == "violent")
|3054|    |-				{
|    |3054|+				
|3055|3055| 					this.AttackVisibleEntity(msg.data.added);
|3056|    |-				}
|    |3056|+				
|3057|3057| 			},
|3058|3058| 
|3059|3059| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3066|3066| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3067|3067| 
|3068|3068| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3069|    |-							// only used for domestic animals
|    |3069|+		// only used for domestic animals
|3070|3070| 	},
|3071|3071| };
|3072|3072| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3123|3123| 
|3124|3124| UnitAI.prototype.IsAnimal = function()
|3125|3125| {
|3126|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3126|+	return (!!this.template.NaturalBehaviour);
|3127|3127| };
|3128|3128| 
|3129|3129| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3161|3161| UnitAI.prototype.GetGarrisonHolder = function()
|3162|3162| {
|3163|3163| 	if (this.IsGarrisoned())
|3164|    |-	{
|    |3164|+	
|3165|3165| 		for (let order of this.orderQueue)
|3166|3166| 			if (order.type == "Garrison")
|3167|3167| 				return order.data.target;
|3168|    |-	}
|    |3168|+	
|3169|3169| 	return INVALID_ENTITY;
|3170|3170| };
|3171|3171| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3239|3239| 		{
|3240|3240| 			let index = this.GetCurrentState().indexOf(".");
|3241|3241| 			if (index != -1)
|3242|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3242|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3243|3243| 			this.Stop(false);
|3244|3244| 		}
|3245|3245| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3295|3295| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3296|3296| 			continue;
|3297|3297| 		if (i == 0)
|3298|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3298|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3299|3299| 		else
|3300|3300| 			this.orderQueue.splice(i, 1);
|3301|3301| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3295|3295| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3296|3296| 			continue;
|3297|3297| 		if (i == 0)
|3298|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3298|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3299|3299| 		else
|3300|3300| 			this.orderQueue.splice(i, 1);
|3301|3301| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3379|3379| };
|3380|3380| 
|3381|3381| 
|3382|    |-//// FSM linkage functions ////
|    |3382|+// // FSM linkage functions ////
|3383|3383| 
|3384|3384| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3385|3385| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3551|3551| 				continue;
|3552|3552| 			if (this.orderQueue[i].type == type)
|3553|3553| 				continue;
|3554|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3554|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3555|3555| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3556|3556| 			return;
|3557|3557| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3551|3551| 				continue;
|3552|3552| 			if (this.orderQueue[i].type == type)
|3553|3553| 				continue;
|3554|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3554|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3555|3555| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3556|3556| 			return;
|3557|3557| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3565|3565| {
|3566|3566| 	// Remember the previous work orders to be able to go back to them later if required
|3567|3567| 	if (data && data.force)
|3568|    |-	{
|    |3568|+	
|3569|3569| 		if (this.IsFormationController())
|3570|3570| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3571|3571| 		else
|3572|3572| 			this.UpdateWorkOrders(type);
|3573|    |-	}
|    |3573|+	
|3574|3574| 
|3575|3575| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3576|3576| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3642|3642| 	{
|3643|3643| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3644|3644| 		if (cmpUnitAI)
|3645|    |-		{
|    |3645|+		
|3646|3646| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3647|3647| 			{
|3648|3648| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3651|3651| 					return;
|3652|3652| 				}
|3653|3653| 			}
|3654|    |-		}
|    |3654|+		
|3655|3655| 	}
|3656|3656| 
|3657|3657| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3644|3644| 		if (cmpUnitAI)
|3645|3645| 		{
|3646|3646| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3647|    |-			{
|    |3647|+			
|3648|3648| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3649|3649| 				{
|3650|3650| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3651|3651| 					return;
|3652|3652| 				}
|3653|    |-			}
|    |3653|+			
|3654|3654| 		}
|3655|3655| 	}
|3656|3656| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3656|3656| 
|3657|3657| 	// If nothing found, take the unit orders
|3658|3658| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3659|    |-	{
|    |3659|+	
|3660|3660| 		if (isWorkType(this.orderQueue[i].type))
|3661|3661| 		{
|3662|3662| 			this.workOrders = this.orderQueue.slice(i);
|3663|3663| 			return;
|3664|3664| 		}
|3665|    |-	}
|    |3665|+	
|3666|3666| };
|3667|3667| 
|3668|3668| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3722|3722| 	if (data.timerRepeat === undefined)
|3723|3723| 		this.timer = undefined;
|3724|3724| 
|3725|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3725|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3726|3726| };
|3727|3727| 
|3728|3728| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3722|3722| 	if (data.timerRepeat === undefined)
|3723|3723| 		this.timer = undefined;
|3724|3724| 
|3725|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3725|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3726|3726| };
|3727|3727| 
|3728|3728| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3757|3757| 	this.timer = undefined;
|3758|3758| };
|3759|3759| 
|3760|    |-//// Message handlers /////
|    |3760|+// // Message handlers /////
|3761|3761| 
|3762|3762| UnitAI.prototype.OnMotionChanged = function(msg)
|3763|3763| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3769|3769| 	// TODO: This is a bit inefficient since every unit listens to every
|3770|3770| 	// construction message - ideally we could scope it to only the one we're building
|3771|3771| 
|3772|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3772|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3773|3773| };
|3774|3774| 
|3775|3775| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3769|3769| 	// TODO: This is a bit inefficient since every unit listens to every
|3770|3770| 	// construction message - ideally we could scope it to only the one we're building
|3771|3771| 
|3772|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3772|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3773|3773| };
|3774|3774| 
|3775|3775| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3794|3794| 
|3795|3795| UnitAI.prototype.OnAttacked = function(msg)
|3796|3796| {
|3797|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3797|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3798|3798| };
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3794|3794| 
|3795|3795| UnitAI.prototype.OnAttacked = function(msg)
|3796|3796| {
|3797|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3797|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3798|3798| };
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3801|3801| {
|3802|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3802|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3803|3803| };
|3804|3804| 
|3805|3805| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3801|3801| {
|3802|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3802|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3803|3803| };
|3804|3804| 
|3805|3805| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3804|3804| 
|3805|3805| UnitAI.prototype.OnHealthChanged = function(msg)
|3806|3806| {
|3807|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3807|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3808|3808| };
|3809|3809| 
|3810|3810| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3804|3804| 
|3805|3805| UnitAI.prototype.OnHealthChanged = function(msg)
|3806|3806| {
|3807|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3807|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3808|3808| };
|3809|3809| 
|3810|3810| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3810|3810| UnitAI.prototype.OnRangeUpdate = function(msg)
|3811|3811| {
|3812|3812| 	if (msg.tag == this.losRangeQuery)
|3813|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3813|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3814|3814| 	else if (msg.tag == this.losHealRangeQuery)
|3815|3815| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3816|3816| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3810|3810| UnitAI.prototype.OnRangeUpdate = function(msg)
|3811|3811| {
|3812|3812| 	if (msg.tag == this.losRangeQuery)
|3813|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3813|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3814|3814| 	else if (msg.tag == this.losHealRangeQuery)
|3815|3815| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3816|3816| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3812|3812| 	if (msg.tag == this.losRangeQuery)
|3813|3813| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3814|3814| 	else if (msg.tag == this.losHealRangeQuery)
|3815|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3815|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3816|3816| };
|3817|3817| 
|3818|3818| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3812|3812| 	if (msg.tag == this.losRangeQuery)
|3813|3813| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3814|3814| 	else if (msg.tag == this.losHealRangeQuery)
|3815|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3815|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3816|3816| };
|3817|3817| 
|3818|3818| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3817|3817| 
|3818|3818| UnitAI.prototype.OnPackFinished = function(msg)
|3819|3819| {
|3820|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3820|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3821|3821| };
|3822|3822| 
|3823|3823| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3817|3817| 
|3818|3818| UnitAI.prototype.OnPackFinished = function(msg)
|3819|3819| {
|3820|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3820|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3821|3821| };
|3822|3822| 
|3823|3823| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3820|3820| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3821|3821| };
|3822|3822| 
|3823|    |-//// Helper functions to be called by the FSM ////
|    |3823|+// // Helper functions to be called by the FSM ////
|3824|3824| 
|3825|3825| UnitAI.prototype.GetWalkSpeed = function()
|3826|3826| {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3922|3922| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3923|3923| 		return undefined;
|3924|3924| 
|3925|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3925|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3926|3926| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3927|3927| 		return undefined;
|3928|3928| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4007|4007| 			PlaySound(name, member);
|4008|4008| 	}
|4009|4009| 	else
|4010|    |-	{
|    |4010|+	
|4011|4011| 		// Otherwise use our own sounds
|4012|4012| 		PlaySound(name, this.entity);
|4013|    |-	}
|    |4013|+	
|4014|4014| };
|4015|4015| 
|4016|4016| /*
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4199|4199| 	else
|4200|4200| 		// return false? Or hope you come close enough?
|4201|4201| 		var parabolicMaxRange = 0;
|4202|    |-		//return false;
|    |4202|+		// return false;
|4203|4203| 
|4204|4204| 	// the parabole changes while walking, take something in the middle
|4205|4205| 	var guessedMaxRange = (range.max + parabolicMaxRange)/2;
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4286|4286| 	if (this.IsFormationMember())
|4287|4287| 	{
|4288|4288| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4289|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4290|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4289|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4290|+			cmpFormationUnitAI.order.data.target == target)
|4291|4291| 			return true;
|4292|4292| 	}
|4293|4293| 
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4454|4454| UnitAI.prototype.AttackEntityInZone = function(ents)
|4455|4455| {
|4456|4456| 	var target = ents.find(target =>
|4457|    |-		this.CanAttack(target)
|4458|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4457|+		this.CanAttack(target) &&
|    |4458|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4459|4459| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4460|4460| 	);
|4461|4461| 	if (!target)
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4455|4455| {
|4456|4456| 	var target = ents.find(target =>
|4457|4457| 		this.CanAttack(target)
|4458|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4459|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4458|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4459|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4460|4460| 	);
|4461|4461| 	if (!target)
|4462|4462| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4519|4519| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4520|4520| 	if (this.isGuardOf)
|4521|4521| 	{
|4522|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4522|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4523|4523| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4524|4524| 		if (cmpUnitAI && cmpAttack &&
|4525|4525| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4523|4523| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4524|4524| 		if (cmpUnitAI && cmpAttack &&
|4525|4525| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4526|    |-				return false;
|    |4526|+			return false;
|4527|4527| 	}
|4528|4528| 
|4529|4529| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4528|4528| 
|4529|4529| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4530|4530| 	if (this.GetStance().respondHoldGround)
|4531|    |-	{
|    |4531|+	
|4532|4532| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4533|4533| 			return true;
|4534|    |-	}
|    |4534|+	
|4535|4535| 
|4536|4536| 	// Stop if it's left our vision range, unless we're especially persistent
|4537|4537| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4535|4535| 
|4536|4536| 	// Stop if it's left our vision range, unless we're especially persistent
|4537|4537| 	if (!this.GetStance().respondChaseBeyondVision)
|4538|    |-	{
|    |4538|+	
|4539|4539| 		if (!this.CheckTargetIsInVisionRange(target))
|4540|4540| 			return true;
|4541|    |-	}
|    |4541|+	
|4542|4542| 
|4543|4543| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4544|4544| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4561|4561| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4562|4562| 	if (this.isGuardOf)
|4563|4563| 	{
|4564|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4564|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4565|4565| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4566|4566| 		if (cmpUnitAI && cmpAttack &&
|4567|4567| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4574|4574| 	return false;
|4575|4575| };
|4576|4576| 
|4577|    |-//// External interface functions ////
|    |4577|+// // External interface functions ////
|4578|4578| 
|4579|4579| UnitAI.prototype.SetFormationController = function(ent)
|4580|4580| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4584|4584| 	// of our own formation (or ourself if not in formation)
|4585|4585| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4586|4586| 	if (cmpObstruction)
|4587|    |-	{
|    |4587|+	
|4588|4588| 		if (ent == INVALID_ENTITY)
|4589|4589| 			cmpObstruction.SetControlGroup(this.entity);
|4590|4590| 		else
|4591|4591| 			cmpObstruction.SetControlGroup(ent);
|4592|    |-	}
|    |4592|+	
|4593|4593| 
|4594|4594| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4595|4595| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4727|4727| 	// if we already had an old guard order, do nothing if the target is the same
|4728|4728| 	// and the order is running, otherwise remove the previous order
|4729|4729| 	if (this.isGuardOf)
|4730|    |-	{
|    |4730|+	
|4731|4731| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4732|4732| 			return;
|4733|4733| 		else
|4734|4734| 			this.RemoveGuard();
|4735|    |-	}
|    |4735|+	
|4736|4736| 
|4737|4737| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4738|4738| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4730|4730| 	{
|4731|4731| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4732|4732| 			return;
|4733|    |-		else
|4734|    |-			this.RemoveGuard();
|    |4733|+		this.RemoveGuard();
|4735|4734| 	}
|4736|4735| 
|4737|4736| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4901|4901| 			this.WalkToTarget(target, queued);
|4902|4902| 		return;
|4903|4903| 	}
|4904|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4904|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4905|4905| };
|4906|4906| 
|4907|4907| /**
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5050|5050| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5051|5051| 	{
|5052|5052| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5053|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5053|+		if (cmpTrader.HasBothMarkets() &&
|5054|5054| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5055|5055| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5056|5056| 		{
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5331|5331| 				{
|5332|5332| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5333|5333| 					var targetClasses = this.order.data.targetClasses;
|5334|    |-					if (targetClasses.attack && cmpIdentity
|5335|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5334|+					if (targetClasses.attack && cmpIdentity &&
|    |5335|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5336|5336| 						continue;
|5337|5337| 					if (targetClasses.avoid && cmpIdentity
|5338|5338| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5334|5334| 					if (targetClasses.attack && cmpIdentity
|5335|5335| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5336|5336| 						continue;
|5337|    |-					if (targetClasses.avoid && cmpIdentity
|5338|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5337|+					if (targetClasses.avoid && cmpIdentity &&
|    |5338|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5339|5339| 						continue;
|5340|5340| 					// Only used by the AIs to prevent some choices of targets
|5341|5341| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5357|5357| 		{
|5358|5358| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5359|5359| 			var targetClasses = this.order.data.targetClasses;
|5360|    |-			if (cmpIdentity && targetClasses.attack
|5361|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5360|+			if (cmpIdentity && targetClasses.attack &&
|    |5361|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5362|5362| 				continue;
|5363|5363| 			if (cmpIdentity && targetClasses.avoid
|5364|5364| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5360|5360| 			if (cmpIdentity && targetClasses.attack
|5361|5361| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5362|5362| 				continue;
|5363|    |-			if (cmpIdentity && targetClasses.avoid
|5364|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5363|+			if (cmpIdentity && targetClasses.avoid &&
|    |5364|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5365|5365| 				continue;
|5366|5366| 			// Only used by the AIs to prevent some choices of targets
|5367|5367| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5503|5503| 
|5504|5504| UnitAI.prototype.SetHeldPosition = function(x, z)
|5505|5505| {
|5506|    |-	this.heldPosition = {"x": x, "z": z};
|    |5506|+	this.heldPosition = { "x": x, "z": z};
|5507|5507| };
|5508|5508| 
|5509|5509| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5503|5503| 
|5504|5504| UnitAI.prototype.SetHeldPosition = function(x, z)
|5505|5505| {
|5506|    |-	this.heldPosition = {"x": x, "z": z};
|    |5506|+	this.heldPosition = {"x": x, "z": z };
|5507|5507| };
|5508|5508| 
|5509|5509| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5530|5530| 	return false;
|5531|5531| };
|5532|5532| 
|5533|    |-//// Helper functions ////
|    |5533|+// // Helper functions ////
|5534|5534| 
|5535|5535| UnitAI.prototype.CanAttack = function(target)
|5536|5536| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5734|5734| 	return cmpPack && cmpPack.IsPacking();
|5735|5735| };
|5736|5736| 
|5737|    |-//// Formation specific functions ////
|    |5737|+// // Formation specific functions ////
|5738|5738| 
|5739|5739| UnitAI.prototype.IsAttackingAsFormation = function()
|5740|5740| {
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5739|5739| UnitAI.prototype.IsAttackingAsFormation = function()
|5740|5740| {
|5741|5741| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5742|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5743|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5742|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5743|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5744|5744| };
|5745|5745| 
|5746|5746| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5743|5743| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5744|5744| };
|5745|5745| 
|5746|    |-//// Animal specific functions ////
|    |5746|+// // Animal specific functions ////
|5747|5747| 
|5748|5748| UnitAI.prototype.MoveRandomly = function(distance)
|5749|5749| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 327| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 885| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 907| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 954| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1017| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1052| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1084| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1293| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1476| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1497| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1527| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1682| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1733| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1803| »   »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1971| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2061| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2230| »   »   »   »   »   »   let·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'nearby' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2285| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2403| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2468| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2508| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2712| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2896| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3627| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4441| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4456| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4502| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4525| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4981| »   var·lastPos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.

binaries/data/mods/public/simulation/components/UnitAI.js
| 354| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1827| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|1965| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2225| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2241| »   »   »   »   »   var·nearby·=·this.FindNearbyResource(function(ent,·type,·template)·{
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2244| »   »   »   »   »   »   »   ||·(type.specific·==·resourceType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2245| »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2265| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2445| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2659| »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceDropsite' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2745| »   »   »   »   »   if·(this.CanGarrison(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2748| »   »   »   »   »   »   if·(this.CheckGarrisonRange(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2750| »   »   »   »   »   »   »   var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2772| »   »   »   »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2773| »   »   »   »   »   »   »   »   if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2788| »   »   »   »   »   »   »   »   »   var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2789| »   »   »   »   »   »   »   »   »   var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2816| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2816| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3589| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3658| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3925| »   let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|4201| »   »   var·parabolicMaxRange·=·0;
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4205| »   var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2;
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4212| »   return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange));
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4290| »   »   »   &&·cmpFormationUnitAI.order.data.target·==·target)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4458| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4459| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4981| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

binaries/data/mods/public/simulation/components/UnitAI.js
|5335| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5338| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5351| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5352| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5359| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5361| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5364| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5439| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5442| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5447| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5450| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5451| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5461| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5464| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5743| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1807/display/redirect

wraitii updated this revision to Diff 8661.Jun 30 2019, 7:24 PM

Cleaned up. RC.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = { "sin": 0, "cos": 0};
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = {"sin": 0, "cos": 0 };
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return { "width": this.width, "depth": this.depth};
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return {"width": this.width, "depth": this.depth };
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return { "width":1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'width'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width": 1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width":1, "depth": 1 };
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = { "width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = {"width": 0, "depth": 0 };
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561|    |-	{
|    | 561|+	
| 562| 562| 		if (shape.type == "circle")
| 563| 563| 		{
| 564| 564| 			r.width += shape.radius * 2;
| 569| 569| 			r.width += shape.width;
| 570| 570| 			r.depth += shape.depth;
| 571| 571| 		}
| 572|    |-	}
|    | 572|+	
| 573| 573| 	r.width /= footprints.length;
| 574| 574| 	r.depth /= footprints.length;
| 575| 575| 	return r;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 582| 582| 	separation.depth *= this.separationMultiplier.depth;
| 583| 583| 
| 584| 584| 	if (this.columnar)
| 585|    |-		var sortingClasses = ["Cavalry","Infantry"];
|    | 585|+		var sortingClasses = ["Cavalry", "Infantry"];
| 586| 586| 	else
| 587| 587| 		var sortingClasses = this.sortingClasses.slice();
| 588| 588| 	sortingClasses.push("Unknown");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 599| 599| 		var classes = cmpIdentity.GetClassesList();
| 600| 600| 		var done = false;
| 601| 601| 		for (var c = 0; c < sortingClasses.length; ++c)
| 602|    |-		{
|    | 602|+		
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605| 605| 				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
| 609|    |-		}
|    | 609|+		
| 610| 610| 		if (!done)
| 611| 611| 			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] });
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["Unknown"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types.Unknown.push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({ "ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({"ent": active[i], "pos": positions[i] });
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 626| 626| 	if (this.columnar)
| 627| 627| 	{
| 628| 628| 		shape = "square";
| 629|    |-		cols = Math.min(count,3);
|    | 629|+		cols = Math.min(count, 3);
| 630| 630| 		shiftRows = false;
| 631| 631| 		centerGap = 0;
| 632| 632| 		sortingOrder = null;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 680| 680| 					n -= r%2;
| 681| 681| 			}
| 682| 682| 			else if (shape == "triangle")
| 683|    |-			{
|    | 683|+			
| 684| 684| 				if (shiftRows)
| 685| 685| 					var n = r + 1;
| 686| 686| 				else
| 687| 687| 					var n = r * 2 + 1;
| 688|    |-			}
|    | 688|+			
| 689| 689| 			if (!shiftRows && n > left)
| 690| 690| 				n = left;
| 691| 691| 			for (var c = 0; c < n && left > 0; ++c)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 721| 721| 	// calculating offset distances without a zero average makes no sense, as the formation
| 722| 722| 	// will jump to a different position any time
| 723| 723| 	var avgoffset = Vector2D.average(offsets);
| 724|    |-	offsets.forEach(function (o) {o.sub(avgoffset);});
|    | 724|+	offsets.forEach(function(o) {o.sub(avgoffset);});
| 725| 725| 
| 726| 726| 	// sort the available places in certain ways
| 727| 727| 	// the places first in the list will contain the heaviest units as defined by the order
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'column'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column };
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var { sin, cos} = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var {sin, cos } = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = { "sin": 0, "cos": 1};
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = {"sin": 0, "cos": 1 };
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 889| 889| 		cmpOtherFormation.RemoveMembers(otherMembers);
| 890| 890| 		this.AddMembers(otherMembers);
| 891| 891| 		Engine.DestroyEntity(this.twinFormations[i]);
| 892|    |-		this.twinFormations.splice(i,1);
|    | 892|+		this.twinFormations.splice(i, 1);
| 893| 893| 	}
| 894| 894| 	// Switch between column and box if necessary
| 895| 895| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);

binaries/data/mods/public/simulation/components/Formation.js
| 326| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 413| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 459| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 500| »   »   var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 535| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 587| »   »   var·sortingClasses·=·this.sortingClasses.slice();
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 596| »   for·(var·i·in·active)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 611| »   »   »   types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | ['Unknown'] is better written in dot notation.

binaries/data/mods/public/simulation/components/Formation.js
| 651| »   »   for·(var·i·=·0;·i·<·count;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 685| »   »   »   »   »   var·n·=·r·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 687| »   »   »   »   »   var·n·=·r·*·2·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 698| »   »   »   »   »   var·x·=·side·*·Math.ceil(c/2)·*·separation.width;
|    | [NORMAL] JSHintBear:
|    | 'x' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 701| »   »   »   »   »   if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 703| »   »   »   »   »   x·+=·side·*·centerGap·/·2;
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 709| »   »   »   »   offsets.push(new·Vector2D(x·+·r1,·z·+·r2));
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 689| »   »   »   if·(!shiftRows·&&·n·>·left)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 690| »   »   »   »   n·=·left;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 695| »   »   »   »   if·(n%2·==·0)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 705| »   »   »   »   var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 715| »   »   »   this.maxColumnsUsed[r]·=·n;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 588| »   sortingClasses.push("Unknown");
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 593| »   for·(var·i·=·0;·i·<·sortingClasses.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 594| »   »   types[sortingClasses[i]]·=·[];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 601| »   »   for·(var·c·=·0;·c·<·sortingClasses.length;·++c)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 603| »   »   »   if·(classes.indexOf(sortingClasses[c])·>·-1)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 605| »   »   »   »   types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 746| »   »   var·t·=·types[sortingClasses[i-1]];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 851| »   var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitMotion' is already defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 515| 515| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 516| 516| 				}
| 517| 517| 				else
| 518|    |-				{
|    | 518|+				
| 519| 519| 					// We couldn't move there, or the target moved away
| 520| 520| 					this.FinishOrder();
| 521|    |-				}
|    | 521|+				
| 522| 522| 				return;
| 523| 523| 			}
| 524| 524| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 730| 730| 			}
| 731| 731| 			// Check if we are already in range, otherwise walk there
| 732| 732| 			if (!this.CheckGarrisonRange(msg.data.target))
| 733|    |-			{
|    | 733|+			
| 734| 734| 				if (!this.CheckTargetVisible(msg.data.target))
| 735| 735| 				{
| 736| 736| 					this.FinishOrder();
| 741| 741| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 742| 					return;
| 743| 743| 				}
| 744|    |-			}
|    | 744|+			
| 745| 745| 
| 746| 746| 			this.SetNextState("GARRISON.GARRISONING");
| 747| 747| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 					this.FinishOrder();
| 737| 737| 					return;
| 738| 738| 				}
| 739|    |-				else
| 740|    |-				{
|    | 739|+				
| 741| 740| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 741| 					return;
| 743|    |-				}
|    | 742|+				
| 744| 743| 			}
| 745| 744| 
| 746| 745| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 759| 759| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 760| 760| 					}
| 761| 761| 					else
| 762|    |-					{
|    | 762|+					
| 763| 763| 						// We couldn't move there, or the target moved away
| 764| 764| 						this.FinishOrder();
| 765|    |-					}
|    | 765|+					
| 766| 766| 					return;
| 767| 767| 				}
| 768| 768| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 992| 992| 			},
| 993| 993| 		},
| 994| 994| 
| 995|    |-		"GARRISON":{
|    | 995|+		"GARRISON": {
| 996| 996| 			"enter": function() {
| 997| 997| 				// If the garrisonholder should pickup, warn it so it can take needed action
| 998| 998| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1205|1205| 			// If the controller handled an order but some members rejected it,
|1206|1206| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1207|1207| 			if (this.orderQueue.length)
|1208|    |-			{
|    |1208|+			
|1209|1209| 				// We're leaving the formation, so stop our FormationWalk order
|1210|1210| 				if (this.FinishOrder())
|1211|1211| 					return;
|1212|    |-			}
|    |1212|+			
|1213|1213| 
|1214|1214| 			// No orders left, we're an individual now
|1215|1215| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1233|1233| 			// Move a tile outside the building
|1234|1234| 			let range = 4;
|1235|1235| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1236|    |-			{
|    |1236|+			
|1237|1237| 				// We are already at the target, or can't move at all
|1238|1238| 				this.FinishOrder();
|1239|    |-			}
|    |1239|+			
|1240|1240| 			else
|1241|1241| 			{
|1242|1242| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1449|1449| 
|1450|1450| 			"LosRangeUpdate": function(msg) {
|1451|1451| 				if (this.GetStance().targetVisibleEnemies)
|1452|    |-				{
|    |1452|+				
|1453|1453| 					// Start attacking one of the newly-seen enemy (if any)
|1454|1454| 					this.AttackEntitiesByPreference(msg.data.added);
|1455|    |-				}
|    |1455|+				
|1456|1456| 			},
|1457|1457| 
|1458|1458| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1482|1482| 				this.SelectAnimation("move");
|1483|1483| 			},
|1484|1484| 
|1485|    |-			"leave": function () {
|    |1485|+			"leave": function() {
|1486|1486| 				this.SelectAnimation("idle");
|1487|1487| 				this.StopMoving();
|1488|1488| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1662|1662| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1663|1663| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1664|1664| 						if (cmpHealth && cmpHealth.IsInjured())
|1665|    |-						{
|    |1665|+						
|1666|1666| 							if (this.CanHeal(this.isGuardOf))
|1667|1667| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1668|1668| 							else if (this.CanRepair(this.isGuardOf))
|1669|1669| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1670|    |-						}
|    |1670|+						
|1671|1671| 					}
|1672|1672| 				},
|1673|1673| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1789|1789| 					}
|1790|1790| 					// Check the target is still alive and attackable
|1791|1791| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1792|    |-					{
|    |1792|+					
|1793|1793| 						// Can't reach it - try to chase after it
|1794|1794| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1795|1795| 						{
|1802|1802| 							this.SetNextState("COMBAT.CHASING");
|1803|1803| 							return true;
|1804|1804| 						}
|1805|    |-					}
|    |1805|+					
|1806|1806| 
|1807|1807| 					this.StopMoving();
|1808|1808| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1835|1835| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1836|1836| 
|1837|1837| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1838|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1838|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1839|1839| 
|1840|1840| 					this.FaceTowardsTarget(this.order.data.target);
|1841|1841| 
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1961|1961| 
|1962|1962| 				"Attacked": function(msg) {
|1963|1963| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1964|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1965|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1964|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1965|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1966|1966| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1967|1967| 				},
|1968|1968| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1981|1981| 					this.SelectAnimation("move");
|1982|1982| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1983|1983| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1984|    |-					{
|    |1984|+					
|1985|1985| 						// Run after a fleeing target
|1986|1986| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|1987|    |-					}
|    |1987|+					
|1988|1988| 					this.StartTimer(1000, 1000);
|1989|1989| 				},
|1990|1990| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2163|2163| 
|2164|2164| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2165|2165| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2166|    |-					{
|    |2166|+					
|2167|2167| 						// Check we can still reach and gather from the target
|2168|2168| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2169|2169| 						{
|2214|2214| 								return;
|2215|2215| 							}
|2216|2216| 						}
|2217|    |-					}
|    |2217|+					
|2218|2218| 
|2219|2219| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2220|2220| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2206|2206| 								return;
|2207|2207| 						}
|2208|2208| 						else
|2209|    |-						{
|    |2209|+						
|2210|2210| 							// Try to follow the target
|2211|2211| 							if (this.MoveToTargetRange(this.gatheringTarget, IID_ResourceGatherer))
|2212|2212| 							{
|2213|2213| 								this.SetNextState("APPROACHING");
|2214|2214| 								return;
|2215|2215| 							}
|2216|    |-						}
|    |2216|+						
|2217|2217| 					}
|2218|2218| 
|2219|2219| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2240|2240| 					// Also don't switch to a different type of huntable animal
|2241|2241| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2242|2242| 						return (
|2243|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2244|    |-							|| (type.specific == resourceType.specific
|    |2243|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2244|+							(type.specific == resourceType.specific
|2245|2245| 							&& (type.specific != "meat" || resourceTemplate == template))
|2246|2246| 						);
|2247|2247| 					});
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2241|2241| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2242|2242| 						return (
|2243|2243| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2244|    |-							|| (type.specific == resourceType.specific
|2245|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2244|+							|| (type.specific == resourceType.specific &&
|    |2245|+							(type.specific != "meat" || resourceTemplate == template))
|2246|2246| 						);
|2247|2247| 					});
|2248|2248| 					if (nearby)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2306|2306| 
|2307|2307| 				"Timer": function(msg) {
|2308|2308| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2309|    |-					{
|    |2309|+					
|2310|2310| 						// Return to our original position unless we have a better order.
|2311|2311| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2312|2312| 							this.WalkToHeldPosition();
|2313|    |-					}
|    |2313|+					
|2314|2314| 				},
|2315|2315| 
|2316|2316| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2340|2340| 					this.StartTimer(prepare, this.healTimers.repeat);
|2341|2341| 
|2342|2342| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2343|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2343|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2344|2344| 
|2345|2345| 					this.FaceTowardsTarget(this.order.data.target);
|2346|2346| 				},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2553|2553| 					{
|2554|2554| 						// The building was already finished/fully repaired before we arrived;
|2555|2555| 						// let the ConstructionFinished handler handle this.
|2556|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2556|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2557|2557| 						return true;
|2558|2558| 					}
|2559|2559| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2553|2553| 					{
|2554|2554| 						// The building was already finished/fully repaired before we arrived;
|2555|2555| 						// let the ConstructionFinished handler handle this.
|2556|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2556|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2557|2557| 						return true;
|2558|2558| 					}
|2559|2559| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2680|2680| 
|2681|2681| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2682|2682| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2683|    |-				{
|    |2683|+				
|2684|2684| 					// We're already walking to the given point, so add this as a order.
|2685|2685| 					this.WalkToTarget(msg.data.newentity, true);
|2686|    |-				}
|    |2686|+				
|2687|2687| 			},
|2688|2688| 		},
|2689|2689| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2743|2743| 
|2744|2744| 					// Check that we can garrison here
|2745|2745| 					if (this.CanGarrison(target))
|2746|    |-					{
|    |2746|+					
|2747|2747| 						// Check that we're in range of the garrison target
|2748|2748| 						if (this.CheckGarrisonRange(target))
|2749|2749| 						{
|2819|2819| 								return false;
|2820|2820| 							}
|2821|2821| 						}
|2822|    |-					}
|    |2822|+					
|2823|2823| 					// Garrisoning failed for some reason, so finish the order
|2824|2824| 					this.FinishOrder();
|2825|2825| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2941|2941| 		"Attacked": function(msg) {
|2942|2942| 			if (this.template.NaturalBehaviour == "skittish" ||
|2943|2943| 			    this.template.NaturalBehaviour == "passive")
|2944|    |-			{
|    |2944|+			
|2945|2945| 				this.Flee(msg.data.attacker, false);
|2946|    |-			}
|    |2946|+			
|2947|2947| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2948|2948| 			{
|2949|2949| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2950|2950| 					this.Attack(msg.data.attacker, false);
|2951|2951| 			}
|2952|2952| 			else if (this.template.NaturalBehaviour == "domestic")
|2953|    |-			{
|    |2953|+			
|2954|2954| 				// Never flee, stop what we were doing
|2955|2955| 				this.SetNextState("IDLE");
|2956|    |-			}
|    |2956|+			
|2957|2957| 		},
|2958|2958| 
|2959|2959| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2964|2964| 				this.FinishOrder();
|2965|2965| 				return;
|2966|2966| 			}
|2967|    |-			else
|2968|    |-			{
|    |2967|+			
|2969|2968| 				this.order.data.min = range;
|2970|2969| 				this.SetNextState("WALKING");
|2971|    |-			}
|    |2970|+			
|2972|2971| 		},
|2973|2972| 
|2974|2973| 		"IDLE": {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3008|3008| 				}
|3009|3009| 				// Start attacking one of the newly-seen enemy (if any)
|3010|3010| 				else if (this.IsDangerousAnimal())
|3011|    |-				{
|    |3011|+				
|3012|3012| 					this.AttackVisibleEntity(msg.data.added);
|3013|    |-				}
|    |3013|+				
|3014|3014| 
|3015|3015| 				// TODO: if two units enter our range together, we'll attack the
|3016|3016| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3051|3051| 				}
|3052|3052| 				// Start attacking one of the newly-seen enemy (if any)
|3053|3053| 				else if (this.template.NaturalBehaviour == "violent")
|3054|    |-				{
|    |3054|+				
|3055|3055| 					this.AttackVisibleEntity(msg.data.added);
|3056|    |-				}
|    |3056|+				
|3057|3057| 			},
|3058|3058| 
|3059|3059| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3066|3066| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3067|3067| 
|3068|3068| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3069|    |-							// only used for domestic animals
|    |3069|+		// only used for domestic animals
|3070|3070| 	},
|3071|3071| };
|3072|3072| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3123|3123| 
|3124|3124| UnitAI.prototype.IsAnimal = function()
|3125|3125| {
|3126|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3126|+	return (!!this.template.NaturalBehaviour);
|3127|3127| };
|3128|3128| 
|3129|3129| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3161|3161| UnitAI.prototype.GetGarrisonHolder = function()
|3162|3162| {
|3163|3163| 	if (this.IsGarrisoned())
|3164|    |-	{
|    |3164|+	
|3165|3165| 		for (let order of this.orderQueue)
|3166|3166| 			if (order.type == "Garrison")
|3167|3167| 				return order.data.target;
|3168|    |-	}
|    |3168|+	
|3169|3169| 	return INVALID_ENTITY;
|3170|3170| };
|3171|3171| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3239|3239| 		{
|3240|3240| 			let index = this.GetCurrentState().indexOf(".");
|3241|3241| 			if (index != -1)
|3242|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3242|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3243|3243| 			this.Stop(false);
|3244|3244| 		}
|3245|3245| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3295|3295| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3296|3296| 			continue;
|3297|3297| 		if (i == 0)
|3298|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3298|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3299|3299| 		else
|3300|3300| 			this.orderQueue.splice(i, 1);
|3301|3301| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3295|3295| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3296|3296| 			continue;
|3297|3297| 		if (i == 0)
|3298|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3298|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3299|3299| 		else
|3300|3300| 			this.orderQueue.splice(i, 1);
|3301|3301| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3379|3379| };
|3380|3380| 
|3381|3381| 
|3382|    |-//// FSM linkage functions ////
|    |3382|+// // FSM linkage functions ////
|3383|3383| 
|3384|3384| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3385|3385| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3551|3551| 				continue;
|3552|3552| 			if (this.orderQueue[i].type == type)
|3553|3553| 				continue;
|3554|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3554|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3555|3555| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3556|3556| 			return;
|3557|3557| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3551|3551| 				continue;
|3552|3552| 			if (this.orderQueue[i].type == type)
|3553|3553| 				continue;
|3554|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3554|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3555|3555| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3556|3556| 			return;
|3557|3557| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3565|3565| {
|3566|3566| 	// Remember the previous work orders to be able to go back to them later if required
|3567|3567| 	if (data && data.force)
|3568|    |-	{
|    |3568|+	
|3569|3569| 		if (this.IsFormationController())
|3570|3570| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3571|3571| 		else
|3572|3572| 			this.UpdateWorkOrders(type);
|3573|    |-	}
|    |3573|+	
|3574|3574| 
|3575|3575| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3576|3576| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3642|3642| 	{
|3643|3643| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3644|3644| 		if (cmpUnitAI)
|3645|    |-		{
|    |3645|+		
|3646|3646| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3647|3647| 			{
|3648|3648| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3651|3651| 					return;
|3652|3652| 				}
|3653|3653| 			}
|3654|    |-		}
|    |3654|+		
|3655|3655| 	}
|3656|3656| 
|3657|3657| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3644|3644| 		if (cmpUnitAI)
|3645|3645| 		{
|3646|3646| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3647|    |-			{
|    |3647|+			
|3648|3648| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3649|3649| 				{
|3650|3650| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3651|3651| 					return;
|3652|3652| 				}
|3653|    |-			}
|    |3653|+			
|3654|3654| 		}
|3655|3655| 	}
|3656|3656| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3656|3656| 
|3657|3657| 	// If nothing found, take the unit orders
|3658|3658| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3659|    |-	{
|    |3659|+	
|3660|3660| 		if (isWorkType(this.orderQueue[i].type))
|3661|3661| 		{
|3662|3662| 			this.workOrders = this.orderQueue.slice(i);
|3663|3663| 			return;
|3664|3664| 		}
|3665|    |-	}
|    |3665|+	
|3666|3666| };
|3667|3667| 
|3668|3668| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3722|3722| 	if (data.timerRepeat === undefined)
|3723|3723| 		this.timer = undefined;
|3724|3724| 
|3725|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3725|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3726|3726| };
|3727|3727| 
|3728|3728| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3722|3722| 	if (data.timerRepeat === undefined)
|3723|3723| 		this.timer = undefined;
|3724|3724| 
|3725|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3725|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3726|3726| };
|3727|3727| 
|3728|3728| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3757|3757| 	this.timer = undefined;
|3758|3758| };
|3759|3759| 
|3760|    |-//// Message handlers /////
|    |3760|+// // Message handlers /////
|3761|3761| 
|3762|3762| UnitAI.prototype.OnMotionChanged = function(msg)
|3763|3763| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3769|3769| 	// TODO: This is a bit inefficient since every unit listens to every
|3770|3770| 	// construction message - ideally we could scope it to only the one we're building
|3771|3771| 
|3772|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3772|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3773|3773| };
|3774|3774| 
|3775|3775| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3769|3769| 	// TODO: This is a bit inefficient since every unit listens to every
|3770|3770| 	// construction message - ideally we could scope it to only the one we're building
|3771|3771| 
|3772|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3772|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3773|3773| };
|3774|3774| 
|3775|3775| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3794|3794| 
|3795|3795| UnitAI.prototype.OnAttacked = function(msg)
|3796|3796| {
|3797|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3797|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3798|3798| };
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3794|3794| 
|3795|3795| UnitAI.prototype.OnAttacked = function(msg)
|3796|3796| {
|3797|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3797|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3798|3798| };
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3801|3801| {
|3802|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3802|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3803|3803| };
|3804|3804| 
|3805|3805| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3799|3799| 
|3800|3800| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3801|3801| {
|3802|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3802|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3803|3803| };
|3804|3804| 
|3805|3805| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3804|3804| 
|3805|3805| UnitAI.prototype.OnHealthChanged = function(msg)
|3806|3806| {
|3807|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3807|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3808|3808| };
|3809|3809| 
|3810|3810| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3804|3804| 
|3805|3805| UnitAI.prototype.OnHealthChanged = function(msg)
|3806|3806| {
|3807|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3807|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3808|3808| };
|3809|3809| 
|3810|3810| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3810|3810| UnitAI.prototype.OnRangeUpdate = function(msg)
|3811|3811| {
|3812|3812| 	if (msg.tag == this.losRangeQuery)
|3813|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3813|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3814|3814| 	else if (msg.tag == this.losHealRangeQuery)
|3815|3815| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3816|3816| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3810|3810| UnitAI.prototype.OnRangeUpdate = function(msg)
|3811|3811| {
|3812|3812| 	if (msg.tag == this.losRangeQuery)
|3813|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3813|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3814|3814| 	else if (msg.tag == this.losHealRangeQuery)
|3815|3815| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3816|3816| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3812|3812| 	if (msg.tag == this.losRangeQuery)
|3813|3813| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3814|3814| 	else if (msg.tag == this.losHealRangeQuery)
|3815|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3815|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3816|3816| };
|3817|3817| 
|3818|3818| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3812|3812| 	if (msg.tag == this.losRangeQuery)
|3813|3813| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3814|3814| 	else if (msg.tag == this.losHealRangeQuery)
|3815|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3815|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3816|3816| };
|3817|3817| 
|3818|3818| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3817|3817| 
|3818|3818| UnitAI.prototype.OnPackFinished = function(msg)
|3819|3819| {
|3820|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3820|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3821|3821| };
|3822|3822| 
|3823|3823| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3817|3817| 
|3818|3818| UnitAI.prototype.OnPackFinished = function(msg)
|3819|3819| {
|3820|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3820|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3821|3821| };
|3822|3822| 
|3823|3823| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3820|3820| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3821|3821| };
|3822|3822| 
|3823|    |-//// Helper functions to be called by the FSM ////
|    |3823|+// // Helper functions to be called by the FSM ////
|3824|3824| 
|3825|3825| UnitAI.prototype.GetWalkSpeed = function()
|3826|3826| {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3922|3922| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3923|3923| 		return undefined;
|3924|3924| 
|3925|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3925|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3926|3926| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3927|3927| 		return undefined;
|3928|3928| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4007|4007| 			PlaySound(name, member);
|4008|4008| 	}
|4009|4009| 	else
|4010|    |-	{
|    |4010|+	
|4011|4011| 		// Otherwise use our own sounds
|4012|4012| 		PlaySound(name, this.entity);
|4013|    |-	}
|    |4013|+	
|4014|4014| };
|4015|4015| 
|4016|4016| /*
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4199|4199| 	else
|4200|4200| 		// return false? Or hope you come close enough?
|4201|4201| 		var parabolicMaxRange = 0;
|4202|    |-		//return false;
|    |4202|+		// return false;
|4203|4203| 
|4204|4204| 	// the parabole changes while walking, take something in the middle
|4205|4205| 	var guessedMaxRange = (range.max + parabolicMaxRange)/2;
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4286|4286| 	if (this.IsFormationMember())
|4287|4287| 	{
|4288|4288| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4289|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4290|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4289|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4290|+			cmpFormationUnitAI.order.data.target == target)
|4291|4291| 			return true;
|4292|4292| 	}
|4293|4293| 
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4454|4454| UnitAI.prototype.AttackEntityInZone = function(ents)
|4455|4455| {
|4456|4456| 	var target = ents.find(target =>
|4457|    |-		this.CanAttack(target)
|4458|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4457|+		this.CanAttack(target) &&
|    |4458|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4459|4459| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4460|4460| 	);
|4461|4461| 	if (!target)
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4455|4455| {
|4456|4456| 	var target = ents.find(target =>
|4457|4457| 		this.CanAttack(target)
|4458|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4459|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4458|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4459|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4460|4460| 	);
|4461|4461| 	if (!target)
|4462|4462| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4519|4519| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4520|4520| 	if (this.isGuardOf)
|4521|4521| 	{
|4522|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4522|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4523|4523| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4524|4524| 		if (cmpUnitAI && cmpAttack &&
|4525|4525| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4523|4523| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4524|4524| 		if (cmpUnitAI && cmpAttack &&
|4525|4525| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4526|    |-				return false;
|    |4526|+			return false;
|4527|4527| 	}
|4528|4528| 
|4529|4529| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4528|4528| 
|4529|4529| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4530|4530| 	if (this.GetStance().respondHoldGround)
|4531|    |-	{
|    |4531|+	
|4532|4532| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4533|4533| 			return true;
|4534|    |-	}
|    |4534|+	
|4535|4535| 
|4536|4536| 	// Stop if it's left our vision range, unless we're especially persistent
|4537|4537| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4535|4535| 
|4536|4536| 	// Stop if it's left our vision range, unless we're especially persistent
|4537|4537| 	if (!this.GetStance().respondChaseBeyondVision)
|4538|    |-	{
|    |4538|+	
|4539|4539| 		if (!this.CheckTargetIsInVisionRange(target))
|4540|4540| 			return true;
|4541|    |-	}
|    |4541|+	
|4542|4542| 
|4543|4543| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4544|4544| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4561|4561| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4562|4562| 	if (this.isGuardOf)
|4563|4563| 	{
|4564|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4564|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4565|4565| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4566|4566| 		if (cmpUnitAI && cmpAttack &&
|4567|4567| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4574|4574| 	return false;
|4575|4575| };
|4576|4576| 
|4577|    |-//// External interface functions ////
|    |4577|+// // External interface functions ////
|4578|4578| 
|4579|4579| UnitAI.prototype.SetFormationController = function(ent)
|4580|4580| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4584|4584| 	// of our own formation (or ourself if not in formation)
|4585|4585| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4586|4586| 	if (cmpObstruction)
|4587|    |-	{
|    |4587|+	
|4588|4588| 		if (ent == INVALID_ENTITY)
|4589|4589| 			cmpObstruction.SetControlGroup(this.entity);
|4590|4590| 		else
|4591|4591| 			cmpObstruction.SetControlGroup(ent);
|4592|    |-	}
|    |4592|+	
|4593|4593| 
|4594|4594| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4595|4595| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4727|4727| 	// if we already had an old guard order, do nothing if the target is the same
|4728|4728| 	// and the order is running, otherwise remove the previous order
|4729|4729| 	if (this.isGuardOf)
|4730|    |-	{
|    |4730|+	
|4731|4731| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4732|4732| 			return;
|4733|4733| 		else
|4734|4734| 			this.RemoveGuard();
|4735|    |-	}
|    |4735|+	
|4736|4736| 
|4737|4737| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4738|4738| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4730|4730| 	{
|4731|4731| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4732|4732| 			return;
|4733|    |-		else
|4734|    |-			this.RemoveGuard();
|    |4733|+		this.RemoveGuard();
|4735|4734| 	}
|4736|4735| 
|4737|4736| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4901|4901| 			this.WalkToTarget(target, queued);
|4902|4902| 		return;
|4903|4903| 	}
|4904|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4904|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4905|4905| };
|4906|4906| 
|4907|4907| /**
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5050|5050| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5051|5051| 	{
|5052|5052| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5053|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5053|+		if (cmpTrader.HasBothMarkets() &&
|5054|5054| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5055|5055| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5056|5056| 		{
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5331|5331| 				{
|5332|5332| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5333|5333| 					var targetClasses = this.order.data.targetClasses;
|5334|    |-					if (targetClasses.attack && cmpIdentity
|5335|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5334|+					if (targetClasses.attack && cmpIdentity &&
|    |5335|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5336|5336| 						continue;
|5337|5337| 					if (targetClasses.avoid && cmpIdentity
|5338|5338| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5334|5334| 					if (targetClasses.attack && cmpIdentity
|5335|5335| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5336|5336| 						continue;
|5337|    |-					if (targetClasses.avoid && cmpIdentity
|5338|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5337|+					if (targetClasses.avoid && cmpIdentity &&
|    |5338|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5339|5339| 						continue;
|5340|5340| 					// Only used by the AIs to prevent some choices of targets
|5341|5341| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5357|5357| 		{
|5358|5358| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5359|5359| 			var targetClasses = this.order.data.targetClasses;
|5360|    |-			if (cmpIdentity && targetClasses.attack
|5361|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5360|+			if (cmpIdentity && targetClasses.attack &&
|    |5361|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5362|5362| 				continue;
|5363|5363| 			if (cmpIdentity && targetClasses.avoid
|5364|5364| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5360|5360| 			if (cmpIdentity && targetClasses.attack
|5361|5361| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5362|5362| 				continue;
|5363|    |-			if (cmpIdentity && targetClasses.avoid
|5364|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5363|+			if (cmpIdentity && targetClasses.avoid &&
|    |5364|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5365|5365| 				continue;
|5366|5366| 			// Only used by the AIs to prevent some choices of targets
|5367|5367| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5503|5503| 
|5504|5504| UnitAI.prototype.SetHeldPosition = function(x, z)
|5505|5505| {
|5506|    |-	this.heldPosition = {"x": x, "z": z};
|    |5506|+	this.heldPosition = { "x": x, "z": z};
|5507|5507| };
|5508|5508| 
|5509|5509| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5503|5503| 
|5504|5504| UnitAI.prototype.SetHeldPosition = function(x, z)
|5505|5505| {
|5506|    |-	this.heldPosition = {"x": x, "z": z};
|    |5506|+	this.heldPosition = {"x": x, "z": z };
|5507|5507| };
|5508|5508| 
|5509|5509| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5530|5530| 	return false;
|5531|5531| };
|5532|5532| 
|5533|    |-//// Helper functions ////
|    |5533|+// // Helper functions ////
|5534|5534| 
|5535|5535| UnitAI.prototype.CanAttack = function(target)
|5536|5536| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5734|5734| 	return cmpPack && cmpPack.IsPacking();
|5735|5735| };
|5736|5736| 
|5737|    |-//// Formation specific functions ////
|    |5737|+// // Formation specific functions ////
|5738|5738| 
|5739|5739| UnitAI.prototype.IsAttackingAsFormation = function()
|5740|5740| {
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5739|5739| UnitAI.prototype.IsAttackingAsFormation = function()
|5740|5740| {
|5741|5741| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5742|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5743|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5742|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5743|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5744|5744| };
|5745|5745| 
|5746|5746| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5743|5743| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5744|5744| };
|5745|5745| 
|5746|    |-//// Animal specific functions ////
|    |5746|+// // Animal specific functions ////
|5747|5747| 
|5748|5748| UnitAI.prototype.MoveRandomly = function(distance)
|5749|5749| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 327| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 885| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 907| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 954| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1017| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1052| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1084| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1293| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1476| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1497| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1527| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1682| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1733| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1803| »   »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1971| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2061| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2230| »   »   »   »   »   »   let·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'nearby' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2285| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2403| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2468| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2508| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2712| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2896| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3627| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4441| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4456| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4502| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4525| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4981| »   var·lastPos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.

binaries/data/mods/public/simulation/components/UnitAI.js
| 354| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1827| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|1965| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2225| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2241| »   »   »   »   »   var·nearby·=·this.FindNearbyResource(function(ent,·type,·template)·{
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2244| »   »   »   »   »   »   »   ||·(type.specific·==·resourceType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2245| »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2265| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2445| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2659| »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceDropsite' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2745| »   »   »   »   »   if·(this.CanGarrison(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2748| »   »   »   »   »   »   if·(this.CheckGarrisonRange(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2750| »   »   »   »   »   »   »   var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2772| »   »   »   »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2773| »   »   »   »   »   »   »   »   if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2788| »   »   »   »   »   »   »   »   »   var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2789| »   »   »   »   »   »   »   »   »   var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2816| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2816| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3589| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3658| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3925| »   let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|4201| »   »   var·parabolicMaxRange·=·0;
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4205| »   var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2;
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4212| »   return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange));
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4290| »   »   »   &&·cmpFormationUnitAI.order.data.target·==·target)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4458| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4459| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4981| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

binaries/data/mods/public/simulation/components/UnitAI.js
|5335| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5338| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5351| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5352| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5359| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5361| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5364| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5439| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5442| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5447| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5450| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5451| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5461| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5464| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5743| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1857/display/redirect

Stan added a comment.Jun 30 2019, 7:29 PM

Still missing the XML headers in variants.

wraitii updated this revision to Diff 8737.EditedJul 5 2019, 8:41 PM

Fix anti-cavalry walking, remove now dead C++ code.

RC

Edit: need to do the XML headers thingy.

Vulcan added a comment.Jul 5 2019, 8:56 PM

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

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpVisual.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/simulation2/components/ICmpVisual.h
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"

source/simulation2/components/CCmpVisualActor.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2018"
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = { "sin": 0, "cos": 0};
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = {"sin": 0, "cos": 0 };
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return { "width": this.width, "depth": this.depth};
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return {"width": this.width, "depth": this.depth };
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return { "width":1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'width'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width": 1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width":1, "depth": 1 };
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = { "width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = {"width": 0, "depth": 0 };
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561|    |-	{
|    | 561|+	
| 562| 562| 		if (shape.type == "circle")
| 563| 563| 		{
| 564| 564| 			r.width += shape.radius * 2;
| 569| 569| 			r.width += shape.width;
| 570| 570| 			r.depth += shape.depth;
| 571| 571| 		}
| 572|    |-	}
|    | 572|+	
| 573| 573| 	r.width /= footprints.length;
| 574| 574| 	r.depth /= footprints.length;
| 575| 575| 	return r;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 582| 582| 	separation.depth *= this.separationMultiplier.depth;
| 583| 583| 
| 584| 584| 	if (this.columnar)
| 585|    |-		var sortingClasses = ["Cavalry","Infantry"];
|    | 585|+		var sortingClasses = ["Cavalry", "Infantry"];
| 586| 586| 	else
| 587| 587| 		var sortingClasses = this.sortingClasses.slice();
| 588| 588| 	sortingClasses.push("Unknown");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 599| 599| 		var classes = cmpIdentity.GetClassesList();
| 600| 600| 		var done = false;
| 601| 601| 		for (var c = 0; c < sortingClasses.length; ++c)
| 602|    |-		{
|    | 602|+		
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605| 605| 				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
| 609|    |-		}
|    | 609|+		
| 610| 610| 		if (!done)
| 611| 611| 			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] });
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["Unknown"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types.Unknown.push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({ "ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({"ent": active[i], "pos": positions[i] });
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 626| 626| 	if (this.columnar)
| 627| 627| 	{
| 628| 628| 		shape = "square";
| 629|    |-		cols = Math.min(count,3);
|    | 629|+		cols = Math.min(count, 3);
| 630| 630| 		shiftRows = false;
| 631| 631| 		centerGap = 0;
| 632| 632| 		sortingOrder = null;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 680| 680| 					n -= r%2;
| 681| 681| 			}
| 682| 682| 			else if (shape == "triangle")
| 683|    |-			{
|    | 683|+			
| 684| 684| 				if (shiftRows)
| 685| 685| 					var n = r + 1;
| 686| 686| 				else
| 687| 687| 					var n = r * 2 + 1;
| 688|    |-			}
|    | 688|+			
| 689| 689| 			if (!shiftRows && n > left)
| 690| 690| 				n = left;
| 691| 691| 			for (var c = 0; c < n && left > 0; ++c)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 721| 721| 	// calculating offset distances without a zero average makes no sense, as the formation
| 722| 722| 	// will jump to a different position any time
| 723| 723| 	var avgoffset = Vector2D.average(offsets);
| 724|    |-	offsets.forEach(function (o) {o.sub(avgoffset);});
|    | 724|+	offsets.forEach(function(o) {o.sub(avgoffset);});
| 725| 725| 
| 726| 726| 	// sort the available places in certain ways
| 727| 727| 	// the places first in the list will contain the heaviest units as defined by the order
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'column'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column };
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var { sin, cos} = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var {sin, cos } = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = { "sin": 0, "cos": 1};
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = {"sin": 0, "cos": 1 };
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 889| 889| 		cmpOtherFormation.RemoveMembers(otherMembers);
| 890| 890| 		this.AddMembers(otherMembers);
| 891| 891| 		Engine.DestroyEntity(this.twinFormations[i]);
| 892|    |-		this.twinFormations.splice(i,1);
|    | 892|+		this.twinFormations.splice(i, 1);
| 893| 893| 	}
| 894| 894| 	// Switch between column and box if necessary
| 895| 895| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);

binaries/data/mods/public/simulation/components/Formation.js
| 326| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 413| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 459| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 500| »   »   var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 535| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 587| »   »   var·sortingClasses·=·this.sortingClasses.slice();
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 596| »   for·(var·i·in·active)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 611| »   »   »   types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | ['Unknown'] is better written in dot notation.

binaries/data/mods/public/simulation/components/Formation.js
| 651| »   »   for·(var·i·=·0;·i·<·count;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 685| »   »   »   »   »   var·n·=·r·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 687| »   »   »   »   »   var·n·=·r·*·2·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 698| »   »   »   »   »   var·x·=·side·*·Math.ceil(c/2)·*·separation.width;
|    | [NORMAL] JSHintBear:
|    | 'x' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 701| »   »   »   »   »   if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 703| »   »   »   »   »   x·+=·side·*·centerGap·/·2;
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 709| »   »   »   »   offsets.push(new·Vector2D(x·+·r1,·z·+·r2));
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 689| »   »   »   if·(!shiftRows·&&·n·>·left)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 690| »   »   »   »   n·=·left;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 695| »   »   »   »   if·(n%2·==·0)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 705| »   »   »   »   var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 715| »   »   »   this.maxColumnsUsed[r]·=·n;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 588| »   sortingClasses.push("Unknown");
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 593| »   for·(var·i·=·0;·i·<·sortingClasses.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 594| »   »   types[sortingClasses[i]]·=·[];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 601| »   »   for·(var·c·=·0;·c·<·sortingClasses.length;·++c)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 603| »   »   »   if·(classes.indexOf(sortingClasses[c])·>·-1)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 605| »   »   »   »   types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 746| »   »   var·t·=·types[sortingClasses[i-1]];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 851| »   var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitMotion' is already defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 517| 517| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 518| 518| 				}
| 519| 519| 				else
| 520|    |-				{
|    | 520|+				
| 521| 521| 					// We couldn't move there, or the target moved away
| 522| 522| 					this.FinishOrder();
| 523|    |-				}
|    | 523|+				
| 524| 524| 				return;
| 525| 525| 			}
| 526| 526| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 			}
| 737| 737| 			// Check if we are already in range, otherwise walk there
| 738| 738| 			if (!this.CheckGarrisonRange(msg.data.target))
| 739|    |-			{
|    | 739|+			
| 740| 740| 				if (!this.CheckTargetVisible(msg.data.target))
| 741| 741| 				{
| 742| 742| 					this.FinishOrder();
| 747| 747| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 748| 					return;
| 749| 749| 				}
| 750|    |-			}
|    | 750|+			
| 751| 751| 
| 752| 752| 			this.SetNextState("GARRISON.GARRISONING");
| 753| 753| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 742| 742| 					this.FinishOrder();
| 743| 743| 					return;
| 744| 744| 				}
| 745|    |-				else
| 746|    |-				{
|    | 745|+				
| 747| 746| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 747| 					return;
| 749|    |-				}
|    | 748|+				
| 750| 749| 			}
| 751| 750| 
| 752| 751| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 765| 765| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 766| 766| 					}
| 767| 767| 					else
| 768|    |-					{
|    | 768|+					
| 769| 769| 						// We couldn't move there, or the target moved away
| 770| 770| 						this.FinishOrder();
| 771|    |-					}
|    | 771|+					
| 772| 772| 					return;
| 773| 773| 				}
| 774| 774| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 998| 998| 			},
| 999| 999| 		},
|1000|1000| 
|1001|    |-		"GARRISON":{
|    |1001|+		"GARRISON": {
|1002|1002| 			"enter": function() {
|1003|1003| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1004|1004| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1211|1211| 			// If the controller handled an order but some members rejected it,
|1212|1212| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1213|1213| 			if (this.orderQueue.length)
|1214|    |-			{
|    |1214|+			
|1215|1215| 				// We're leaving the formation, so stop our FormationWalk order
|1216|1216| 				if (this.FinishOrder())
|1217|1217| 					return;
|1218|    |-			}
|    |1218|+			
|1219|1219| 
|1220|1220| 			// No orders left, we're an individual now
|1221|1221| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1239|1239| 			// Move a tile outside the building
|1240|1240| 			let range = 4;
|1241|1241| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1242|    |-			{
|    |1242|+			
|1243|1243| 				// We are already at the target, or can't move at all
|1244|1244| 				this.FinishOrder();
|1245|    |-			}
|    |1245|+			
|1246|1246| 			else
|1247|1247| 			{
|1248|1248| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1455|1455| 
|1456|1456| 			"LosRangeUpdate": function(msg) {
|1457|1457| 				if (this.GetStance().targetVisibleEnemies)
|1458|    |-				{
|    |1458|+				
|1459|1459| 					// Start attacking one of the newly-seen enemy (if any)
|1460|1460| 					this.AttackEntitiesByPreference(msg.data.added);
|1461|    |-				}
|    |1461|+				
|1462|1462| 			},
|1463|1463| 
|1464|1464| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1488|1488| 				this.SelectAnimation("move");
|1489|1489| 			},
|1490|1490| 
|1491|    |-			"leave": function () {
|    |1491|+			"leave": function() {
|1492|1492| 				this.SelectAnimation("idle");
|1493|1493| 				this.StopMoving();
|1494|1494| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1668|1668| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1669|1669| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1670|1670| 						if (cmpHealth && cmpHealth.IsInjured())
|1671|    |-						{
|    |1671|+						
|1672|1672| 							if (this.CanHeal(this.isGuardOf))
|1673|1673| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1674|1674| 							else if (this.CanRepair(this.isGuardOf))
|1675|1675| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1676|    |-						}
|    |1676|+						
|1677|1677| 					}
|1678|1678| 				},
|1679|1679| 
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1958|1958| 
|1959|1959| 				"Attacked": function(msg) {
|1960|1960| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1961|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1962|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1961|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1962|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1963|1963| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1964|1964| 				},
|1965|1965| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2011|2011| 					this.SelectAnimation("move");
|2012|2012| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2013|2013| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2014|    |-					{
|    |2014|+					
|2015|2015| 						// Run after a fleeing target
|2016|2016| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2017|    |-					}
|    |2017|+					
|2018|2018| 					this.StartTimer(1000, 1000);
|2019|2019| 				},
|2020|2020| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2365|2365| 
|2366|2366| 				"Timer": function(msg) {
|2367|2367| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2368|    |-					{
|    |2368|+					
|2369|2369| 						// Return to our original position unless we have a better order.
|2370|2370| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2371|2371| 							this.WalkToHeldPosition();
|2372|    |-					}
|    |2372|+					
|2373|2373| 				},
|2374|2374| 
|2375|2375| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2399|2399| 					this.StartTimer(prepare, this.healTimers.repeat);
|2400|2400| 
|2401|2401| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2402|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2402|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2403|2403| 
|2404|2404| 					this.FaceTowardsTarget(this.order.data.target);
|2405|2405| 				},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2611|2611| 					{
|2612|2612| 						// The building was already finished/fully repaired before we arrived;
|2613|2613| 						// let the ConstructionFinished handler handle this.
|2614|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2614|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2615|2615| 						return true;
|2616|2616| 					}
|2617|2617| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2611|2611| 					{
|2612|2612| 						// The building was already finished/fully repaired before we arrived;
|2613|2613| 						// let the ConstructionFinished handler handle this.
|2614|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2614|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2615|2615| 						return true;
|2616|2616| 					}
|2617|2617| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2803|2803| 
|2804|2804| 					// Check that we can garrison here
|2805|2805| 					if (this.CanGarrison(target))
|2806|    |-					{
|    |2806|+					
|2807|2807| 						// Check that we're in range of the garrison target
|2808|2808| 						if (this.CheckGarrisonRange(target))
|2809|2809| 						{
|2879|2879| 								return false;
|2880|2880| 							}
|2881|2881| 						}
|2882|    |-					}
|    |2882|+					
|2883|2883| 					// Garrisoning failed for some reason, so finish the order
|2884|2884| 					this.FinishOrder();
|2885|2885| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3000|3000| 		"Attacked": function(msg) {
|3001|3001| 			if (this.template.NaturalBehaviour == "skittish" ||
|3002|3002| 			    this.template.NaturalBehaviour == "passive")
|3003|    |-			{
|    |3003|+			
|3004|3004| 				this.Flee(msg.data.attacker, false);
|3005|    |-			}
|    |3005|+			
|3006|3006| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3007|3007| 			{
|3008|3008| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3009|3009| 					this.Attack(msg.data.attacker, false);
|3010|3010| 			}
|3011|3011| 			else if (this.template.NaturalBehaviour == "domestic")
|3012|    |-			{
|    |3012|+			
|3013|3013| 				// Never flee, stop what we were doing
|3014|3014| 				this.SetNextState("IDLE");
|3015|    |-			}
|    |3015|+			
|3016|3016| 		},
|3017|3017| 
|3018|3018| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3064|3064| 				}
|3065|3065| 				// Start attacking one of the newly-seen enemy (if any)
|3066|3066| 				else if (this.IsDangerousAnimal())
|3067|    |-				{
|    |3067|+				
|3068|3068| 					this.AttackVisibleEntity(msg.data.added);
|3069|    |-				}
|    |3069|+				
|3070|3070| 
|3071|3071| 				// TODO: if two units enter our range together, we'll attack the
|3072|3072| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3107|3107| 				}
|3108|3108| 				// Start attacking one of the newly-seen enemy (if any)
|3109|3109| 				else if (this.template.NaturalBehaviour == "violent")
|3110|    |-				{
|    |3110|+				
|3111|3111| 					this.AttackVisibleEntity(msg.data.added);
|3112|    |-				}
|    |3112|+				
|3113|3113| 			},
|3114|3114| 
|3115|3115| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3122|3122| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3123|3123| 
|3124|3124| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3125|    |-							// only used for domestic animals
|    |3125|+		// only used for domestic animals
|3126|3126| 	},
|3127|3127| };
|3128|3128| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3179|3179| 
|3180|3180| UnitAI.prototype.IsAnimal = function()
|3181|3181| {
|3182|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3182|+	return (!!this.template.NaturalBehaviour);
|3183|3183| };
|3184|3184| 
|3185|3185| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3217|3217| UnitAI.prototype.GetGarrisonHolder = function()
|3218|3218| {
|3219|3219| 	if (this.IsGarrisoned())
|3220|    |-	{
|    |3220|+	
|3221|3221| 		for (let order of this.orderQueue)
|3222|3222| 			if (order.type == "Garrison")
|3223|3223| 				return order.data.target;
|3224|    |-	}
|    |3224|+	
|3225|3225| 	return INVALID_ENTITY;
|3226|3226| };
|3227|3227| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3295|3295| 		{
|3296|3296| 			let index = this.GetCurrentState().indexOf(".");
|3297|3297| 			if (index != -1)
|3298|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3298|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3299|3299| 			this.Stop(false);
|3300|3300| 		}
|3301|3301| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3351|3351| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3352|3352| 			continue;
|3353|3353| 		if (i == 0)
|3354|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3354|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3355|3355| 		else
|3356|3356| 			this.orderQueue.splice(i, 1);
|3357|3357| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3351|3351| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3352|3352| 			continue;
|3353|3353| 		if (i == 0)
|3354|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3354|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3355|3355| 		else
|3356|3356| 			this.orderQueue.splice(i, 1);
|3357|3357| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3435|3435| };
|3436|3436| 
|3437|3437| 
|3438|    |-//// FSM linkage functions ////
|    |3438|+// // FSM linkage functions ////
|3439|3439| 
|3440|3440| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3441|3441| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3607|3607| 				continue;
|3608|3608| 			if (this.orderQueue[i].type == type)
|3609|3609| 				continue;
|3610|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3610|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3611|3611| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3612|3612| 			return;
|3613|3613| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3607|3607| 				continue;
|3608|3608| 			if (this.orderQueue[i].type == type)
|3609|3609| 				continue;
|3610|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3610|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3611|3611| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3612|3612| 			return;
|3613|3613| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3621|3621| {
|3622|3622| 	// Remember the previous work orders to be able to go back to them later if required
|3623|3623| 	if (data && data.force)
|3624|    |-	{
|    |3624|+	
|3625|3625| 		if (this.IsFormationController())
|3626|3626| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3627|3627| 		else
|3628|3628| 			this.UpdateWorkOrders(type);
|3629|    |-	}
|    |3629|+	
|3630|3630| 
|3631|3631| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3632|3632| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3698|3698| 	{
|3699|3699| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3700|3700| 		if (cmpUnitAI)
|3701|    |-		{
|    |3701|+		
|3702|3702| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3703|3703| 			{
|3704|3704| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3707|3707| 					return;
|3708|3708| 				}
|3709|3709| 			}
|3710|    |-		}
|    |3710|+		
|3711|3711| 	}
|3712|3712| 
|3713|3713| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3700|3700| 		if (cmpUnitAI)
|3701|3701| 		{
|3702|3702| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3703|    |-			{
|    |3703|+			
|3704|3704| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3705|3705| 				{
|3706|3706| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3707|3707| 					return;
|3708|3708| 				}
|3709|    |-			}
|    |3709|+			
|3710|3710| 		}
|3711|3711| 	}
|3712|3712| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3712|3712| 
|3713|3713| 	// If nothing found, take the unit orders
|3714|3714| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3715|    |-	{
|    |3715|+	
|3716|3716| 		if (isWorkType(this.orderQueue[i].type))
|3717|3717| 		{
|3718|3718| 			this.workOrders = this.orderQueue.slice(i);
|3719|3719| 			return;
|3720|3720| 		}
|3721|    |-	}
|    |3721|+	
|3722|3722| };
|3723|3723| 
|3724|3724| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3778|3778| 	if (data.timerRepeat === undefined)
|3779|3779| 		this.timer = undefined;
|3780|3780| 
|3781|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3781|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3782|3782| };
|3783|3783| 
|3784|3784| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3778|3778| 	if (data.timerRepeat === undefined)
|3779|3779| 		this.timer = undefined;
|3780|3780| 
|3781|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3781|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3782|3782| };
|3783|3783| 
|3784|3784| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3813|3813| 	this.timer = undefined;
|3814|3814| };
|3815|3815| 
|3816|    |-//// Message handlers /////
|    |3816|+// // Message handlers /////
|3817|3817| 
|3818|3818| UnitAI.prototype.OnMotionChanged = function(msg)
|3819|3819| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3825|3825| 	// TODO: This is a bit inefficient since every unit listens to every
|3826|3826| 	// construction message - ideally we could scope it to only the one we're building
|3827|3827| 
|3828|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3828|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3829|3829| };
|3830|3830| 
|3831|3831| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3825|3825| 	// TODO: This is a bit inefficient since every unit listens to every
|3826|3826| 	// construction message - ideally we could scope it to only the one we're building
|3827|3827| 
|3828|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3828|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3829|3829| };
|3830|3830| 
|3831|3831| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3850|3850| 
|3851|3851| UnitAI.prototype.OnAttacked = function(msg)
|3852|3852| {
|3853|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3853|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3854|3854| };
|3855|3855| 
|3856|3856| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3850|3850| 
|3851|3851| UnitAI.prototype.OnAttacked = function(msg)
|3852|3852| {
|3853|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3853|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3854|3854| };
|3855|3855| 
|3856|3856| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3855|3855| 
|3856|3856| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3857|3857| {
|3858|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3858|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3859|3859| };
|3860|3860| 
|3861|3861| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3855|3855| 
|3856|3856| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3857|3857| {
|3858|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3858|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3859|3859| };
|3860|3860| 
|3861|3861| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3860|3860| 
|3861|3861| UnitAI.prototype.OnHealthChanged = function(msg)
|3862|3862| {
|3863|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3863|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3864|3864| };
|3865|3865| 
|3866|3866| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3860|3860| 
|3861|3861| UnitAI.prototype.OnHealthChanged = function(msg)
|3862|3862| {
|3863|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3863|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3864|3864| };
|3865|3865| 
|3866|3866| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| UnitAI.prototype.OnRangeUpdate = function(msg)
|3867|3867| {
|3868|3868| 	if (msg.tag == this.losRangeQuery)
|3869|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3869|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3870|3870| 	else if (msg.tag == this.losHealRangeQuery)
|3871|3871| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3872|3872| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| UnitAI.prototype.OnRangeUpdate = function(msg)
|3867|3867| {
|3868|3868| 	if (msg.tag == this.losRangeQuery)
|3869|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3869|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3870|3870| 	else if (msg.tag == this.losHealRangeQuery)
|3871|3871| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3872|3872| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3868|3868| 	if (msg.tag == this.losRangeQuery)
|3869|3869| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3870|3870| 	else if (msg.tag == this.losHealRangeQuery)
|3871|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3871|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3872|3872| };
|3873|3873| 
|3874|3874| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3868|3868| 	if (msg.tag == this.losRangeQuery)
|3869|3869| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3870|3870| 	else if (msg.tag == this.losHealRangeQuery)
|3871|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3871|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3872|3872| };
|3873|3873| 
|3874|3874| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3873|3873| 
|3874|3874| UnitAI.prototype.OnPackFinished = function(msg)
|3875|3875| {
|3876|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3876|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3877|3877| };
|3878|3878| 
|3879|3879| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3873|3873| 
|3874|3874| UnitAI.prototype.OnPackFinished = function(msg)
|3875|3875| {
|3876|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3876|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3877|3877| };
|3878|3878| 
|3879|3879| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3876|3876| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3877|3877| };
|3878|3878| 
|3879|    |-//// Helper functions to be called by the FSM ////
|    |3879|+// // Helper functions to be called by the FSM ////
|3880|3880| 
|3881|3881| UnitAI.prototype.GetWalkSpeed = function()
|3882|3882| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4063|4063| 			PlaySound(name, member);
|4064|4064| 	}
|4065|4065| 	else
|4066|    |-	{
|    |4066|+	
|4067|4067| 		// Otherwise use our own sounds
|4068|4068| 		PlaySound(name, this.entity);
|4069|    |-	}
|    |4069|+	
|4070|4070| };
|4071|4071| 
|4072|4072| /*
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4509|4509| UnitAI.prototype.AttackEntityInZone = function(ents)
|4510|4510| {
|4511|4511| 	var target = ents.find(target =>
|4512|    |-		this.CanAttack(target)
|4513|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4512|+		this.CanAttack(target) &&
|    |4513|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4514|4514| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4515|4515| 	);
|4516|4516| 	if (!target)
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4510|4510| {
|4511|4511| 	var target = ents.find(target =>
|4512|4512| 		this.CanAttack(target)
|4513|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4514|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4513|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4514|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4515|4515| 	);
|4516|4516| 	if (!target)
|4517|4517| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4574|4574| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4575|4575| 	if (this.isGuardOf)
|4576|4576| 	{
|4577|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4577|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4578|4578| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4579|4579| 		if (cmpUnitAI && cmpAttack &&
|4580|4580| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4578|4578| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4579|4579| 		if (cmpUnitAI && cmpAttack &&
|4580|4580| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4581|    |-				return false;
|    |4581|+			return false;
|4582|4582| 	}
|4583|4583| 
|4584|4584| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4583|4583| 
|4584|4584| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4585|4585| 	if (this.GetStance().respondHoldGround)
|4586|    |-	{
|    |4586|+	
|4587|4587| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4588|4588| 			return true;
|4589|    |-	}
|    |4589|+	
|4590|4590| 
|4591|4591| 	// Stop if it's left our vision range, unless we're especially persistent
|4592|4592| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4590|4590| 
|4591|4591| 	// Stop if it's left our vision range, unless we're especially persistent
|4592|4592| 	if (!this.GetStance().respondChaseBeyondVision)
|4593|    |-	{
|    |4593|+	
|4594|4594| 		if (!this.CheckTargetIsInVisionRange(target))
|4595|4595| 			return true;
|4596|    |-	}
|    |4596|+	
|4597|4597| 
|4598|4598| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4599|4599| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4616|4616| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4617|4617| 	if (this.isGuardOf)
|4618|4618| 	{
|4619|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4619|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4620|4620| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4621|4621| 		if (cmpUnitAI && cmpAttack &&
|4622|4622| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4629|4629| 	return false;
|4630|4630| };
|4631|4631| 
|4632|    |-//// External interface functions ////
|    |4632|+// // External interface functions ////
|4633|4633| 
|4634|4634| UnitAI.prototype.SetFormationController = function(ent)
|4635|4635| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4639|4639| 	// of our own formation (or ourself if not in formation)
|4640|4640| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4641|4641| 	if (cmpObstruction)
|4642|    |-	{
|    |4642|+	
|4643|4643| 		if (ent == INVALID_ENTITY)
|4644|4644| 			cmpObstruction.SetControlGroup(this.entity);
|4645|4645| 		else
|4646|4646| 			cmpObstruction.SetControlGroup(ent);
|4647|    |-	}
|    |4647|+	
|4648|4648| 
|4649|4649| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4650|4650| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4782|4782| 	// if we already had an old guard order, do nothing if the target is the same
|4783|4783| 	// and the order is running, otherwise remove the previous order
|4784|4784| 	if (this.isGuardOf)
|4785|    |-	{
|    |4785|+	
|4786|4786| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4787|4787| 			return;
|4788|4788| 		else
|4789|4789| 			this.RemoveGuard();
|4790|    |-	}
|    |4790|+	
|4791|4791| 
|4792|4792| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4793|4793| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4785|4785| 	{
|4786|4786| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4787|4787| 			return;
|4788|    |-		else
|4789|    |-			this.RemoveGuard();
|    |4788|+		this.RemoveGuard();
|4790|4789| 	}
|4791|4790| 
|4792|4791| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5117|5117| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5118|5118| 	{
|5119|5119| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5120|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5120|+		if (cmpTrader.HasBothMarkets() &&
|5121|5121| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5122|5122| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5123|5123| 		{
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5398|5398| 				{
|5399|5399| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5400|5400| 					var targetClasses = this.order.data.targetClasses;
|5401|    |-					if (targetClasses.attack && cmpIdentity
|5402|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5401|+					if (targetClasses.attack && cmpIdentity &&
|    |5402|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5403|5403| 						continue;
|5404|5404| 					if (targetClasses.avoid && cmpIdentity
|5405|5405| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5401|5401| 					if (targetClasses.attack && cmpIdentity
|5402|5402| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5403|5403| 						continue;
|5404|    |-					if (targetClasses.avoid && cmpIdentity
|5405|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5404|+					if (targetClasses.avoid && cmpIdentity &&
|    |5405|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5406|5406| 						continue;
|5407|5407| 					// Only used by the AIs to prevent some choices of targets
|5408|5408| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5424|5424| 		{
|5425|5425| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5426|5426| 			var targetClasses = this.order.data.targetClasses;
|5427|    |-			if (cmpIdentity && targetClasses.attack
|5428|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5427|+			if (cmpIdentity && targetClasses.attack &&
|    |5428|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5429|5429| 				continue;
|5430|5430| 			if (cmpIdentity && targetClasses.avoid
|5431|5431| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5427|5427| 			if (cmpIdentity && targetClasses.attack
|5428|5428| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5429|5429| 				continue;
|5430|    |-			if (cmpIdentity && targetClasses.avoid
|5431|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5430|+			if (cmpIdentity && targetClasses.avoid &&
|    |5431|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5432|5432| 				continue;
|5433|5433| 			// Only used by the AIs to prevent some choices of targets
|5434|5434| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5584|5584| 
|5585|5585| UnitAI.prototype.SetHeldPosition = function(x, z)
|5586|5586| {
|5587|    |-	this.heldPosition = {"x": x, "z": z};
|    |5587|+	this.heldPosition = { "x": x, "z": z};
|5588|5588| };
|5589|5589| 
|5590|5590| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5584|5584| 
|5585|5585| UnitAI.prototype.SetHeldPosition = function(x, z)
|5586|5586| {
|5587|    |-	this.heldPosition = {"x": x, "z": z};
|    |5587|+	this.heldPosition = {"x": x, "z": z };
|5588|5588| };
|5589|5589| 
|5590|5590| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5611|5611| 	return false;
|5612|5612| };
|5613|5613| 
|5614|    |-//// Helper functions ////
|    |5614|+// // Helper functions ////
|5615|5615| 
|5616|5616| UnitAI.prototype.CanAttack = function(target)
|5617|5617| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5815|5815| 	return cmpPack && cmpPack.IsPacking();
|5816|5816| };
|5817|5817| 
|5818|    |-//// Formation specific functions ////
|    |5818|+// // Formation specific functions ////
|5819|5819| 
|5820|5820| UnitAI.prototype.IsAttackingAsFormation = function()
|5821|5821| {
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5820|5820| UnitAI.prototype.IsAttackingAsFormation = function()
|5821|5821| {
|5822|5822| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5823|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5824|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5823|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5824|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5825|5825| };
|5826|5826| 
|5827|5827| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5824|5824| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5825|5825| };
|5826|5826| 
|5827|    |-//// Animal specific functions ////
|    |5827|+// // Animal specific functions ////
|5828|5828| 
|5829|5829| UnitAI.prototype.MoveRandomly = function(distance)
|5830|5830| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 327| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 891| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 913| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 960| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1023| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1058| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1090| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1299| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1482| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1503| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1533| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1688| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1739| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1815| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1985| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1990| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1996| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|2001| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2092| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2344| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2462| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2527| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2567| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2773| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2956| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3683| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4496| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4511| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4557| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4580| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
| 354| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1962| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2504| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2805| »   »   »   »   »   if·(this.CanGarrison(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2808| »   »   »   »   »   »   if·(this.CheckGarrisonRange(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2810| »   »   »   »   »   »   »   var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2832| »   »   »   »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2833| »   »   »   »   »   »   »   »   if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2848| »   »   »   »   »   »   »   »   »   var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2849| »   »   »   »   »   »   »   »   »   var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2876| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2876| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3645| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3714| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4513| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4514| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5402| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5405| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5418| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5419| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5426| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5428| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5431| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5506| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5509| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5514| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5517| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5518| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5528| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5531| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5824| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1910/display/redirect

wraitii updated this revision to Diff 8744.Jul 6 2019, 8:57 AM

Xml headers, copyrights

Vulcan added a comment.Jul 6 2019, 9:25 AM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = { "sin": 0, "cos": 0};
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = {"sin": 0, "cos": 0 };
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return { "width": this.width, "depth": this.depth};
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return {"width": this.width, "depth": this.depth };
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return { "width":1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'width'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width": 1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width":1, "depth": 1 };
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = { "width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = {"width": 0, "depth": 0 };
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561|    |-	{
|    | 561|+	
| 562| 562| 		if (shape.type == "circle")
| 563| 563| 		{
| 564| 564| 			r.width += shape.radius * 2;
| 569| 569| 			r.width += shape.width;
| 570| 570| 			r.depth += shape.depth;
| 571| 571| 		}
| 572|    |-	}
|    | 572|+	
| 573| 573| 	r.width /= footprints.length;
| 574| 574| 	r.depth /= footprints.length;
| 575| 575| 	return r;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 582| 582| 	separation.depth *= this.separationMultiplier.depth;
| 583| 583| 
| 584| 584| 	if (this.columnar)
| 585|    |-		var sortingClasses = ["Cavalry","Infantry"];
|    | 585|+		var sortingClasses = ["Cavalry", "Infantry"];
| 586| 586| 	else
| 587| 587| 		var sortingClasses = this.sortingClasses.slice();
| 588| 588| 	sortingClasses.push("Unknown");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 599| 599| 		var classes = cmpIdentity.GetClassesList();
| 600| 600| 		var done = false;
| 601| 601| 		for (var c = 0; c < sortingClasses.length; ++c)
| 602|    |-		{
|    | 602|+		
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605| 605| 				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
| 609|    |-		}
|    | 609|+		
| 610| 610| 		if (!done)
| 611| 611| 			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] });
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["Unknown"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types.Unknown.push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({ "ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({"ent": active[i], "pos": positions[i] });
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 626| 626| 	if (this.columnar)
| 627| 627| 	{
| 628| 628| 		shape = "square";
| 629|    |-		cols = Math.min(count,3);
|    | 629|+		cols = Math.min(count, 3);
| 630| 630| 		shiftRows = false;
| 631| 631| 		centerGap = 0;
| 632| 632| 		sortingOrder = null;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 680| 680| 					n -= r%2;
| 681| 681| 			}
| 682| 682| 			else if (shape == "triangle")
| 683|    |-			{
|    | 683|+			
| 684| 684| 				if (shiftRows)
| 685| 685| 					var n = r + 1;
| 686| 686| 				else
| 687| 687| 					var n = r * 2 + 1;
| 688|    |-			}
|    | 688|+			
| 689| 689| 			if (!shiftRows && n > left)
| 690| 690| 				n = left;
| 691| 691| 			for (var c = 0; c < n && left > 0; ++c)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 721| 721| 	// calculating offset distances without a zero average makes no sense, as the formation
| 722| 722| 	// will jump to a different position any time
| 723| 723| 	var avgoffset = Vector2D.average(offsets);
| 724|    |-	offsets.forEach(function (o) {o.sub(avgoffset);});
|    | 724|+	offsets.forEach(function(o) {o.sub(avgoffset);});
| 725| 725| 
| 726| 726| 	// sort the available places in certain ways
| 727| 727| 	// the places first in the list will contain the heaviest units as defined by the order
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'column'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column };
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var { sin, cos} = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var {sin, cos } = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = { "sin": 0, "cos": 1};
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = {"sin": 0, "cos": 1 };
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 889| 889| 		cmpOtherFormation.RemoveMembers(otherMembers);
| 890| 890| 		this.AddMembers(otherMembers);
| 891| 891| 		Engine.DestroyEntity(this.twinFormations[i]);
| 892|    |-		this.twinFormations.splice(i,1);
|    | 892|+		this.twinFormations.splice(i, 1);
| 893| 893| 	}
| 894| 894| 	// Switch between column and box if necessary
| 895| 895| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);

binaries/data/mods/public/simulation/components/Formation.js
| 326| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 413| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 459| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 500| »   »   var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 535| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 587| »   »   var·sortingClasses·=·this.sortingClasses.slice();
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 596| »   for·(var·i·in·active)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 611| »   »   »   types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | ['Unknown'] is better written in dot notation.

binaries/data/mods/public/simulation/components/Formation.js
| 651| »   »   for·(var·i·=·0;·i·<·count;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 685| »   »   »   »   »   var·n·=·r·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 687| »   »   »   »   »   var·n·=·r·*·2·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 698| »   »   »   »   »   var·x·=·side·*·Math.ceil(c/2)·*·separation.width;
|    | [NORMAL] JSHintBear:
|    | 'x' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 701| »   »   »   »   »   if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 703| »   »   »   »   »   x·+=·side·*·centerGap·/·2;
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 709| »   »   »   »   offsets.push(new·Vector2D(x·+·r1,·z·+·r2));
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 689| »   »   »   if·(!shiftRows·&&·n·>·left)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 690| »   »   »   »   n·=·left;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 695| »   »   »   »   if·(n%2·==·0)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 705| »   »   »   »   var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 715| »   »   »   this.maxColumnsUsed[r]·=·n;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 588| »   sortingClasses.push("Unknown");
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 593| »   for·(var·i·=·0;·i·<·sortingClasses.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 594| »   »   types[sortingClasses[i]]·=·[];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 601| »   »   for·(var·c·=·0;·c·<·sortingClasses.length;·++c)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 603| »   »   »   if·(classes.indexOf(sortingClasses[c])·>·-1)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 605| »   »   »   »   types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 746| »   »   var·t·=·types[sortingClasses[i-1]];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 851| »   var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitMotion' is already defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 517| 517| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 518| 518| 				}
| 519| 519| 				else
| 520|    |-				{
|    | 520|+				
| 521| 521| 					// We couldn't move there, or the target moved away
| 522| 522| 					this.FinishOrder();
| 523|    |-				}
|    | 523|+				
| 524| 524| 				return;
| 525| 525| 			}
| 526| 526| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 			}
| 737| 737| 			// Check if we are already in range, otherwise walk there
| 738| 738| 			if (!this.CheckGarrisonRange(msg.data.target))
| 739|    |-			{
|    | 739|+			
| 740| 740| 				if (!this.CheckTargetVisible(msg.data.target))
| 741| 741| 				{
| 742| 742| 					this.FinishOrder();
| 747| 747| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 748| 					return;
| 749| 749| 				}
| 750|    |-			}
|    | 750|+			
| 751| 751| 
| 752| 752| 			this.SetNextState("GARRISON.GARRISONING");
| 753| 753| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 742| 742| 					this.FinishOrder();
| 743| 743| 					return;
| 744| 744| 				}
| 745|    |-				else
| 746|    |-				{
|    | 745|+				
| 747| 746| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 747| 					return;
| 749|    |-				}
|    | 748|+				
| 750| 749| 			}
| 751| 750| 
| 752| 751| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 765| 765| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 766| 766| 					}
| 767| 767| 					else
| 768|    |-					{
|    | 768|+					
| 769| 769| 						// We couldn't move there, or the target moved away
| 770| 770| 						this.FinishOrder();
| 771|    |-					}
|    | 771|+					
| 772| 772| 					return;
| 773| 773| 				}
| 774| 774| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 998| 998| 			},
| 999| 999| 		},
|1000|1000| 
|1001|    |-		"GARRISON":{
|    |1001|+		"GARRISON": {
|1002|1002| 			"enter": function() {
|1003|1003| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1004|1004| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1211|1211| 			// If the controller handled an order but some members rejected it,
|1212|1212| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1213|1213| 			if (this.orderQueue.length)
|1214|    |-			{
|    |1214|+			
|1215|1215| 				// We're leaving the formation, so stop our FormationWalk order
|1216|1216| 				if (this.FinishOrder())
|1217|1217| 					return;
|1218|    |-			}
|    |1218|+			
|1219|1219| 
|1220|1220| 			// No orders left, we're an individual now
|1221|1221| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1239|1239| 			// Move a tile outside the building
|1240|1240| 			let range = 4;
|1241|1241| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1242|    |-			{
|    |1242|+			
|1243|1243| 				// We are already at the target, or can't move at all
|1244|1244| 				this.FinishOrder();
|1245|    |-			}
|    |1245|+			
|1246|1246| 			else
|1247|1247| 			{
|1248|1248| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1455|1455| 
|1456|1456| 			"LosRangeUpdate": function(msg) {
|1457|1457| 				if (this.GetStance().targetVisibleEnemies)
|1458|    |-				{
|    |1458|+				
|1459|1459| 					// Start attacking one of the newly-seen enemy (if any)
|1460|1460| 					this.AttackEntitiesByPreference(msg.data.added);
|1461|    |-				}
|    |1461|+				
|1462|1462| 			},
|1463|1463| 
|1464|1464| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1488|1488| 				this.SelectAnimation("move");
|1489|1489| 			},
|1490|1490| 
|1491|    |-			"leave": function () {
|    |1491|+			"leave": function() {
|1492|1492| 				this.SelectAnimation("idle");
|1493|1493| 				this.StopMoving();
|1494|1494| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1668|1668| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1669|1669| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1670|1670| 						if (cmpHealth && cmpHealth.IsInjured())
|1671|    |-						{
|    |1671|+						
|1672|1672| 							if (this.CanHeal(this.isGuardOf))
|1673|1673| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1674|1674| 							else if (this.CanRepair(this.isGuardOf))
|1675|1675| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1676|    |-						}
|    |1676|+						
|1677|1677| 					}
|1678|1678| 				},
|1679|1679| 
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1958|1958| 
|1959|1959| 				"Attacked": function(msg) {
|1960|1960| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1961|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1962|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1961|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1962|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1963|1963| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1964|1964| 				},
|1965|1965| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2011|2011| 					this.SelectAnimation("move");
|2012|2012| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2013|2013| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2014|    |-					{
|    |2014|+					
|2015|2015| 						// Run after a fleeing target
|2016|2016| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2017|    |-					}
|    |2017|+					
|2018|2018| 					this.StartTimer(1000, 1000);
|2019|2019| 				},
|2020|2020| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2365|2365| 
|2366|2366| 				"Timer": function(msg) {
|2367|2367| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2368|    |-					{
|    |2368|+					
|2369|2369| 						// Return to our original position unless we have a better order.
|2370|2370| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2371|2371| 							this.WalkToHeldPosition();
|2372|    |-					}
|    |2372|+					
|2373|2373| 				},
|2374|2374| 
|2375|2375| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2399|2399| 					this.StartTimer(prepare, this.healTimers.repeat);
|2400|2400| 
|2401|2401| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2402|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2402|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2403|2403| 
|2404|2404| 					this.FaceTowardsTarget(this.order.data.target);
|2405|2405| 				},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2611|2611| 					{
|2612|2612| 						// The building was already finished/fully repaired before we arrived;
|2613|2613| 						// let the ConstructionFinished handler handle this.
|2614|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2614|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2615|2615| 						return true;
|2616|2616| 					}
|2617|2617| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2611|2611| 					{
|2612|2612| 						// The building was already finished/fully repaired before we arrived;
|2613|2613| 						// let the ConstructionFinished handler handle this.
|2614|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2614|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2615|2615| 						return true;
|2616|2616| 					}
|2617|2617| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2803|2803| 
|2804|2804| 					// Check that we can garrison here
|2805|2805| 					if (this.CanGarrison(target))
|2806|    |-					{
|    |2806|+					
|2807|2807| 						// Check that we're in range of the garrison target
|2808|2808| 						if (this.CheckGarrisonRange(target))
|2809|2809| 						{
|2879|2879| 								return false;
|2880|2880| 							}
|2881|2881| 						}
|2882|    |-					}
|    |2882|+					
|2883|2883| 					// Garrisoning failed for some reason, so finish the order
|2884|2884| 					this.FinishOrder();
|2885|2885| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3000|3000| 		"Attacked": function(msg) {
|3001|3001| 			if (this.template.NaturalBehaviour == "skittish" ||
|3002|3002| 			    this.template.NaturalBehaviour == "passive")
|3003|    |-			{
|    |3003|+			
|3004|3004| 				this.Flee(msg.data.attacker, false);
|3005|    |-			}
|    |3005|+			
|3006|3006| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3007|3007| 			{
|3008|3008| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3009|3009| 					this.Attack(msg.data.attacker, false);
|3010|3010| 			}
|3011|3011| 			else if (this.template.NaturalBehaviour == "domestic")
|3012|    |-			{
|    |3012|+			
|3013|3013| 				// Never flee, stop what we were doing
|3014|3014| 				this.SetNextState("IDLE");
|3015|    |-			}
|    |3015|+			
|3016|3016| 		},
|3017|3017| 
|3018|3018| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3064|3064| 				}
|3065|3065| 				// Start attacking one of the newly-seen enemy (if any)
|3066|3066| 				else if (this.IsDangerousAnimal())
|3067|    |-				{
|    |3067|+				
|3068|3068| 					this.AttackVisibleEntity(msg.data.added);
|3069|    |-				}
|    |3069|+				
|3070|3070| 
|3071|3071| 				// TODO: if two units enter our range together, we'll attack the
|3072|3072| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3107|3107| 				}
|3108|3108| 				// Start attacking one of the newly-seen enemy (if any)
|3109|3109| 				else if (this.template.NaturalBehaviour == "violent")
|3110|    |-				{
|    |3110|+				
|3111|3111| 					this.AttackVisibleEntity(msg.data.added);
|3112|    |-				}
|    |3112|+				
|3113|3113| 			},
|3114|3114| 
|3115|3115| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3122|3122| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3123|3123| 
|3124|3124| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3125|    |-							// only used for domestic animals
|    |3125|+		// only used for domestic animals
|3126|3126| 	},
|3127|3127| };
|3128|3128| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3179|3179| 
|3180|3180| UnitAI.prototype.IsAnimal = function()
|3181|3181| {
|3182|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3182|+	return (!!this.template.NaturalBehaviour);
|3183|3183| };
|3184|3184| 
|3185|3185| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3217|3217| UnitAI.prototype.GetGarrisonHolder = function()
|3218|3218| {
|3219|3219| 	if (this.IsGarrisoned())
|3220|    |-	{
|    |3220|+	
|3221|3221| 		for (let order of this.orderQueue)
|3222|3222| 			if (order.type == "Garrison")
|3223|3223| 				return order.data.target;
|3224|    |-	}
|    |3224|+	
|3225|3225| 	return INVALID_ENTITY;
|3226|3226| };
|3227|3227| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3295|3295| 		{
|3296|3296| 			let index = this.GetCurrentState().indexOf(".");
|3297|3297| 			if (index != -1)
|3298|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3298|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3299|3299| 			this.Stop(false);
|3300|3300| 		}
|3301|3301| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3351|3351| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3352|3352| 			continue;
|3353|3353| 		if (i == 0)
|3354|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3354|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3355|3355| 		else
|3356|3356| 			this.orderQueue.splice(i, 1);
|3357|3357| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3351|3351| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3352|3352| 			continue;
|3353|3353| 		if (i == 0)
|3354|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3354|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3355|3355| 		else
|3356|3356| 			this.orderQueue.splice(i, 1);
|3357|3357| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3435|3435| };
|3436|3436| 
|3437|3437| 
|3438|    |-//// FSM linkage functions ////
|    |3438|+// // FSM linkage functions ////
|3439|3439| 
|3440|3440| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3441|3441| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3607|3607| 				continue;
|3608|3608| 			if (this.orderQueue[i].type == type)
|3609|3609| 				continue;
|3610|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3610|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3611|3611| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3612|3612| 			return;
|3613|3613| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3607|3607| 				continue;
|3608|3608| 			if (this.orderQueue[i].type == type)
|3609|3609| 				continue;
|3610|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3610|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3611|3611| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3612|3612| 			return;
|3613|3613| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3621|3621| {
|3622|3622| 	// Remember the previous work orders to be able to go back to them later if required
|3623|3623| 	if (data && data.force)
|3624|    |-	{
|    |3624|+	
|3625|3625| 		if (this.IsFormationController())
|3626|3626| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3627|3627| 		else
|3628|3628| 			this.UpdateWorkOrders(type);
|3629|    |-	}
|    |3629|+	
|3630|3630| 
|3631|3631| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3632|3632| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3698|3698| 	{
|3699|3699| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3700|3700| 		if (cmpUnitAI)
|3701|    |-		{
|    |3701|+		
|3702|3702| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3703|3703| 			{
|3704|3704| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3707|3707| 					return;
|3708|3708| 				}
|3709|3709| 			}
|3710|    |-		}
|    |3710|+		
|3711|3711| 	}
|3712|3712| 
|3713|3713| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3700|3700| 		if (cmpUnitAI)
|3701|3701| 		{
|3702|3702| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3703|    |-			{
|    |3703|+			
|3704|3704| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3705|3705| 				{
|3706|3706| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3707|3707| 					return;
|3708|3708| 				}
|3709|    |-			}
|    |3709|+			
|3710|3710| 		}
|3711|3711| 	}
|3712|3712| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3712|3712| 
|3713|3713| 	// If nothing found, take the unit orders
|3714|3714| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3715|    |-	{
|    |3715|+	
|3716|3716| 		if (isWorkType(this.orderQueue[i].type))
|3717|3717| 		{
|3718|3718| 			this.workOrders = this.orderQueue.slice(i);
|3719|3719| 			return;
|3720|3720| 		}
|3721|    |-	}
|    |3721|+	
|3722|3722| };
|3723|3723| 
|3724|3724| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3778|3778| 	if (data.timerRepeat === undefined)
|3779|3779| 		this.timer = undefined;
|3780|3780| 
|3781|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3781|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3782|3782| };
|3783|3783| 
|3784|3784| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3778|3778| 	if (data.timerRepeat === undefined)
|3779|3779| 		this.timer = undefined;
|3780|3780| 
|3781|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3781|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3782|3782| };
|3783|3783| 
|3784|3784| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3813|3813| 	this.timer = undefined;
|3814|3814| };
|3815|3815| 
|3816|    |-//// Message handlers /////
|    |3816|+// // Message handlers /////
|3817|3817| 
|3818|3818| UnitAI.prototype.OnMotionChanged = function(msg)
|3819|3819| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3825|3825| 	// TODO: This is a bit inefficient since every unit listens to every
|3826|3826| 	// construction message - ideally we could scope it to only the one we're building
|3827|3827| 
|3828|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3828|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3829|3829| };
|3830|3830| 
|3831|3831| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3825|3825| 	// TODO: This is a bit inefficient since every unit listens to every
|3826|3826| 	// construction message - ideally we could scope it to only the one we're building
|3827|3827| 
|3828|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3828|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3829|3829| };
|3830|3830| 
|3831|3831| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3850|3850| 
|3851|3851| UnitAI.prototype.OnAttacked = function(msg)
|3852|3852| {
|3853|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3853|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3854|3854| };
|3855|3855| 
|3856|3856| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3850|3850| 
|3851|3851| UnitAI.prototype.OnAttacked = function(msg)
|3852|3852| {
|3853|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3853|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3854|3854| };
|3855|3855| 
|3856|3856| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3855|3855| 
|3856|3856| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3857|3857| {
|3858|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3858|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3859|3859| };
|3860|3860| 
|3861|3861| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3855|3855| 
|3856|3856| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3857|3857| {
|3858|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3858|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3859|3859| };
|3860|3860| 
|3861|3861| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3860|3860| 
|3861|3861| UnitAI.prototype.OnHealthChanged = function(msg)
|3862|3862| {
|3863|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3863|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3864|3864| };
|3865|3865| 
|3866|3866| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3860|3860| 
|3861|3861| UnitAI.prototype.OnHealthChanged = function(msg)
|3862|3862| {
|3863|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3863|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3864|3864| };
|3865|3865| 
|3866|3866| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| UnitAI.prototype.OnRangeUpdate = function(msg)
|3867|3867| {
|3868|3868| 	if (msg.tag == this.losRangeQuery)
|3869|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3869|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3870|3870| 	else if (msg.tag == this.losHealRangeQuery)
|3871|3871| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3872|3872| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| UnitAI.prototype.OnRangeUpdate = function(msg)
|3867|3867| {
|3868|3868| 	if (msg.tag == this.losRangeQuery)
|3869|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3869|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3870|3870| 	else if (msg.tag == this.losHealRangeQuery)
|3871|3871| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3872|3872| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3868|3868| 	if (msg.tag == this.losRangeQuery)
|3869|3869| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3870|3870| 	else if (msg.tag == this.losHealRangeQuery)
|3871|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3871|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3872|3872| };
|3873|3873| 
|3874|3874| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3868|3868| 	if (msg.tag == this.losRangeQuery)
|3869|3869| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3870|3870| 	else if (msg.tag == this.losHealRangeQuery)
|3871|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3871|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3872|3872| };
|3873|3873| 
|3874|3874| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3873|3873| 
|3874|3874| UnitAI.prototype.OnPackFinished = function(msg)
|3875|3875| {
|3876|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3876|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3877|3877| };
|3878|3878| 
|3879|3879| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3873|3873| 
|3874|3874| UnitAI.prototype.OnPackFinished = function(msg)
|3875|3875| {
|3876|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3876|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3877|3877| };
|3878|3878| 
|3879|3879| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3876|3876| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3877|3877| };
|3878|3878| 
|3879|    |-//// Helper functions to be called by the FSM ////
|    |3879|+// // Helper functions to be called by the FSM ////
|3880|3880| 
|3881|3881| UnitAI.prototype.GetWalkSpeed = function()
|3882|3882| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4063|4063| 			PlaySound(name, member);
|4064|4064| 	}
|4065|4065| 	else
|4066|    |-	{
|    |4066|+	
|4067|4067| 		// Otherwise use our own sounds
|4068|4068| 		PlaySound(name, this.entity);
|4069|    |-	}
|    |4069|+	
|4070|4070| };
|4071|4071| 
|4072|4072| /*
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4509|4509| UnitAI.prototype.AttackEntityInZone = function(ents)
|4510|4510| {
|4511|4511| 	var target = ents.find(target =>
|4512|    |-		this.CanAttack(target)
|4513|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4512|+		this.CanAttack(target) &&
|    |4513|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4514|4514| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4515|4515| 	);
|4516|4516| 	if (!target)
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4510|4510| {
|4511|4511| 	var target = ents.find(target =>
|4512|4512| 		this.CanAttack(target)
|4513|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4514|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4513|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4514|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4515|4515| 	);
|4516|4516| 	if (!target)
|4517|4517| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4574|4574| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4575|4575| 	if (this.isGuardOf)
|4576|4576| 	{
|4577|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4577|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4578|4578| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4579|4579| 		if (cmpUnitAI && cmpAttack &&
|4580|4580| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4578|4578| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4579|4579| 		if (cmpUnitAI && cmpAttack &&
|4580|4580| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4581|    |-				return false;
|    |4581|+			return false;
|4582|4582| 	}
|4583|4583| 
|4584|4584| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4583|4583| 
|4584|4584| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4585|4585| 	if (this.GetStance().respondHoldGround)
|4586|    |-	{
|    |4586|+	
|4587|4587| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4588|4588| 			return true;
|4589|    |-	}
|    |4589|+	
|4590|4590| 
|4591|4591| 	// Stop if it's left our vision range, unless we're especially persistent
|4592|4592| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4590|4590| 
|4591|4591| 	// Stop if it's left our vision range, unless we're especially persistent
|4592|4592| 	if (!this.GetStance().respondChaseBeyondVision)
|4593|    |-	{
|    |4593|+	
|4594|4594| 		if (!this.CheckTargetIsInVisionRange(target))
|4595|4595| 			return true;
|4596|    |-	}
|    |4596|+	
|4597|4597| 
|4598|4598| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4599|4599| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4616|4616| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4617|4617| 	if (this.isGuardOf)
|4618|4618| 	{
|4619|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4619|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4620|4620| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4621|4621| 		if (cmpUnitAI && cmpAttack &&
|4622|4622| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4629|4629| 	return false;
|4630|4630| };
|4631|4631| 
|4632|    |-//// External interface functions ////
|    |4632|+// // External interface functions ////
|4633|4633| 
|4634|4634| UnitAI.prototype.SetFormationController = function(ent)
|4635|4635| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4639|4639| 	// of our own formation (or ourself if not in formation)
|4640|4640| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4641|4641| 	if (cmpObstruction)
|4642|    |-	{
|    |4642|+	
|4643|4643| 		if (ent == INVALID_ENTITY)
|4644|4644| 			cmpObstruction.SetControlGroup(this.entity);
|4645|4645| 		else
|4646|4646| 			cmpObstruction.SetControlGroup(ent);
|4647|    |-	}
|    |4647|+	
|4648|4648| 
|4649|4649| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4650|4650| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4782|4782| 	// if we already had an old guard order, do nothing if the target is the same
|4783|4783| 	// and the order is running, otherwise remove the previous order
|4784|4784| 	if (this.isGuardOf)
|4785|    |-	{
|    |4785|+	
|4786|4786| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4787|4787| 			return;
|4788|4788| 		else
|4789|4789| 			this.RemoveGuard();
|4790|    |-	}
|    |4790|+	
|4791|4791| 
|4792|4792| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4793|4793| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4785|4785| 	{
|4786|4786| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4787|4787| 			return;
|4788|    |-		else
|4789|    |-			this.RemoveGuard();
|    |4788|+		this.RemoveGuard();
|4790|4789| 	}
|4791|4790| 
|4792|4791| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5117|5117| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5118|5118| 	{
|5119|5119| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5120|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5120|+		if (cmpTrader.HasBothMarkets() &&
|5121|5121| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5122|5122| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5123|5123| 		{
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5398|5398| 				{
|5399|5399| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5400|5400| 					var targetClasses = this.order.data.targetClasses;
|5401|    |-					if (targetClasses.attack && cmpIdentity
|5402|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5401|+					if (targetClasses.attack && cmpIdentity &&
|    |5402|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5403|5403| 						continue;
|5404|5404| 					if (targetClasses.avoid && cmpIdentity
|5405|5405| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5401|5401| 					if (targetClasses.attack && cmpIdentity
|5402|5402| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5403|5403| 						continue;
|5404|    |-					if (targetClasses.avoid && cmpIdentity
|5405|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5404|+					if (targetClasses.avoid && cmpIdentity &&
|    |5405|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5406|5406| 						continue;
|5407|5407| 					// Only used by the AIs to prevent some choices of targets
|5408|5408| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5424|5424| 		{
|5425|5425| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5426|5426| 			var targetClasses = this.order.data.targetClasses;
|5427|    |-			if (cmpIdentity && targetClasses.attack
|5428|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5427|+			if (cmpIdentity && targetClasses.attack &&
|    |5428|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5429|5429| 				continue;
|5430|5430| 			if (cmpIdentity && targetClasses.avoid
|5431|5431| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5427|5427| 			if (cmpIdentity && targetClasses.attack
|5428|5428| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5429|5429| 				continue;
|5430|    |-			if (cmpIdentity && targetClasses.avoid
|5431|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5430|+			if (cmpIdentity && targetClasses.avoid &&
|    |5431|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5432|5432| 				continue;
|5433|5433| 			// Only used by the AIs to prevent some choices of targets
|5434|5434| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5584|5584| 
|5585|5585| UnitAI.prototype.SetHeldPosition = function(x, z)
|5586|5586| {
|5587|    |-	this.heldPosition = {"x": x, "z": z};
|    |5587|+	this.heldPosition = { "x": x, "z": z};
|5588|5588| };
|5589|5589| 
|5590|5590| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5584|5584| 
|5585|5585| UnitAI.prototype.SetHeldPosition = function(x, z)
|5586|5586| {
|5587|    |-	this.heldPosition = {"x": x, "z": z};
|    |5587|+	this.heldPosition = {"x": x, "z": z };
|5588|5588| };
|5589|5589| 
|5590|5590| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5611|5611| 	return false;
|5612|5612| };
|5613|5613| 
|5614|    |-//// Helper functions ////
|    |5614|+// // Helper functions ////
|5615|5615| 
|5616|5616| UnitAI.prototype.CanAttack = function(target)
|5617|5617| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5815|5815| 	return cmpPack && cmpPack.IsPacking();
|5816|5816| };
|5817|5817| 
|5818|    |-//// Formation specific functions ////
|    |5818|+// // Formation specific functions ////
|5819|5819| 
|5820|5820| UnitAI.prototype.IsAttackingAsFormation = function()
|5821|5821| {
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5820|5820| UnitAI.prototype.IsAttackingAsFormation = function()
|5821|5821| {
|5822|5822| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5823|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5824|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5823|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5824|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5825|5825| };
|5826|5826| 
|5827|5827| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5824|5824| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5825|5825| };
|5826|5826| 
|5827|    |-//// Animal specific functions ////
|    |5827|+// // Animal specific functions ////
|5828|5828| 
|5829|5829| UnitAI.prototype.MoveRandomly = function(distance)
|5830|5830| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 327| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 891| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 913| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 960| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1023| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1058| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1090| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1299| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1482| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1503| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1533| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1688| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1739| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1815| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1985| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1990| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1996| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|2001| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2092| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2344| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2462| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2527| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2567| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2773| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2956| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3683| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4496| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4511| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4557| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4580| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
| 354| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1962| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2504| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2805| »   »   »   »   »   if·(this.CanGarrison(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2808| »   »   »   »   »   »   if·(this.CheckGarrisonRange(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2810| »   »   »   »   »   »   »   var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2832| »   »   »   »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2833| »   »   »   »   »   »   »   »   if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2848| »   »   »   »   »   »   »   »   »   var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2849| »   »   »   »   »   »   »   »   »   var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2876| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2876| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3645| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3714| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4513| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4514| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5402| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5405| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5418| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5419| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5426| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5428| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5431| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5506| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5509| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5514| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5517| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5518| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5528| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5531| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5824| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1916/display/redirect

wraitii updated this revision to Diff 8749.Jul 6 2019, 11:09 AM

Upstream animation combat fix from D2048 which belongs better here.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = { "sin": 0, "cos": 0};
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 119| 119| 	this.formationMembersWithAura = []; // Members with a formation aura
| 120| 120| 	this.width = 0;
| 121| 121| 	this.depth = 0;
| 122|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 122|+	this.oldOrientation = {"sin": 0, "cos": 0 };
| 123| 123| 	this.twinFormations = [];
| 124| 124| 	// distance from which two twin formations will merge into one.
| 125| 125| 	this.formationSeparation = 0;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return { "width": this.width, "depth": this.depth};
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 137| 137| 
| 138| 138| Formation.prototype.GetSize = function()
| 139| 139| {
| 140|    |-	return {"width": this.width, "depth": this.depth};
|    | 140|+	return {"width": this.width, "depth": this.depth };
| 141| 141| };
| 142| 142| 
| 143| 143| Formation.prototype.GetSpeedMultiplier = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return { "width":1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'width'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width": 1, "depth": 1};
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 554| 554| 			footprints.push(cmpFootprint.GetShape());
| 555| 555| 	}
| 556| 556| 	if (!footprints.length)
| 557|    |-		return {"width":1, "depth": 1};
|    | 557|+		return {"width":1, "depth": 1 };
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = { "width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 556| 556| 	if (!footprints.length)
| 557| 557| 		return {"width":1, "depth": 1};
| 558| 558| 
| 559|    |-	var r = {"width": 0, "depth": 0};
|    | 559|+	var r = {"width": 0, "depth": 0 };
| 560| 560| 	for (var shape of footprints)
| 561| 561| 	{
| 562| 562| 		if (shape.type == "circle")
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 558| 558| 
| 559| 559| 	var r = {"width": 0, "depth": 0};
| 560| 560| 	for (var shape of footprints)
| 561|    |-	{
|    | 561|+	
| 562| 562| 		if (shape.type == "circle")
| 563| 563| 		{
| 564| 564| 			r.width += shape.radius * 2;
| 569| 569| 			r.width += shape.width;
| 570| 570| 			r.depth += shape.depth;
| 571| 571| 		}
| 572|    |-	}
|    | 572|+	
| 573| 573| 	r.width /= footprints.length;
| 574| 574| 	r.depth /= footprints.length;
| 575| 575| 	return r;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 582| 582| 	separation.depth *= this.separationMultiplier.depth;
| 583| 583| 
| 584| 584| 	if (this.columnar)
| 585|    |-		var sortingClasses = ["Cavalry","Infantry"];
|    | 585|+		var sortingClasses = ["Cavalry", "Infantry"];
| 586| 586| 	else
| 587| 587| 		var sortingClasses = this.sortingClasses.slice();
| 588| 588| 	sortingClasses.push("Unknown");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 599| 599| 		var classes = cmpIdentity.GetClassesList();
| 600| 600| 		var done = false;
| 601| 601| 		for (var c = 0; c < sortingClasses.length; ++c)
| 602|    |-		{
|    | 602|+		
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605| 605| 				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
| 609|    |-		}
|    | 609|+		
| 610| 610| 		if (!done)
| 611| 611| 			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]});
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 602| 602| 		{
| 603| 603| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 604| 604| 			{
| 605|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 605|+				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] });
| 606| 606| 				done = true;
| 607| 607| 				break;
| 608| 608| 			}
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["Unknown"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types.Unknown.push({"ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({ "ent": active[i], "pos": positions[i]});
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 608| 608| 			}
| 609| 609| 		}
| 610| 610| 		if (!done)
| 611|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 611|+			types["Unknown"].push({"ent": active[i], "pos": positions[i] });
| 612| 612| 	}
| 613| 613| 
| 614| 614| 	var count = active.length;
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 626| 626| 	if (this.columnar)
| 627| 627| 	{
| 628| 628| 		shape = "square";
| 629|    |-		cols = Math.min(count,3);
|    | 629|+		cols = Math.min(count, 3);
| 630| 630| 		shiftRows = false;
| 631| 631| 		centerGap = 0;
| 632| 632| 		sortingOrder = null;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 680| 680| 					n -= r%2;
| 681| 681| 			}
| 682| 682| 			else if (shape == "triangle")
| 683|    |-			{
|    | 683|+			
| 684| 684| 				if (shiftRows)
| 685| 685| 					var n = r + 1;
| 686| 686| 				else
| 687| 687| 					var n = r * 2 + 1;
| 688|    |-			}
|    | 688|+			
| 689| 689| 			if (!shiftRows && n > left)
| 690| 690| 				n = left;
| 691| 691| 			for (var c = 0; c < n && left > 0; ++c)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 721| 721| 	// calculating offset distances without a zero average makes no sense, as the formation
| 722| 722| 	// will jump to a different position any time
| 723| 723| 	var avgoffset = Vector2D.average(offsets);
| 724|    |-	offsets.forEach(function (o) {o.sub(avgoffset);});
|    | 724|+	offsets.forEach(function(o) {o.sub(avgoffset);});
| 725| 725| 
| 726| 726| 	// sort the available places in certain ways
| 727| 727| 	// the places first in the list will contain the heaviest units as defined by the order
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'column'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column};
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 780| 780| 			closestOffsetId = i;
| 781| 781| 		}
| 782| 782| 	}
| 783|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 783|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column };
| 784| 784| 	return closestOffsetId;
| 785| 785| };
| 786| 786| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var { sin, cos} = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 790| 790| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 791| 791| {
| 792| 792| 	var offsetPositions = [];
| 793|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 793|+	var {sin, cos } = this.GetEstimatedOrientation(pos);
| 794| 794| 	// calculate the world positions
| 795| 795| 	for (var o of offsets)
| 796| 796| 		offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin));
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = { "sin": 0, "cos": 1};
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 807| 807| Formation.prototype.GetEstimatedOrientation = function(pos)
| 808| 808| {
| 809| 809| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 810|    |-	var r = {"sin": 0, "cos": 1};
|    | 810|+	var r = {"sin": 0, "cos": 1 };
| 811| 811| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 812| 812| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 813| 813| 	{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js
| 889| 889| 		cmpOtherFormation.RemoveMembers(otherMembers);
| 890| 890| 		this.AddMembers(otherMembers);
| 891| 891| 		Engine.DestroyEntity(this.twinFormations[i]);
| 892|    |-		this.twinFormations.splice(i,1);
|    | 892|+		this.twinFormations.splice(i, 1);
| 893| 893| 	}
| 894| 894| 	// Switch between column and box if necessary
| 895| 895| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);

binaries/data/mods/public/simulation/components/Formation.js
| 326| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 413| »   for·(var·ent·of·this.formationMembersWithAura)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 459| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 500| »   »   var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 535| »   var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'cmpPosition' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 587| »   »   var·sortingClasses·=·this.sortingClasses.slice();
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 596| »   for·(var·i·in·active)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 611| »   »   »   types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | ['Unknown'] is better written in dot notation.

binaries/data/mods/public/simulation/components/Formation.js
| 651| »   »   for·(var·i·=·0;·i·<·count;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 685| »   »   »   »   »   var·n·=·r·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 687| »   »   »   »   »   var·n·=·r·*·2·+·1;
|    | [NORMAL] JSHintBear:
|    | 'n' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'c' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 698| »   »   »   »   »   var·x·=·side·*·Math.ceil(c/2)·*·separation.width;
|    | [NORMAL] JSHintBear:
|    | 'x' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 701| »   »   »   »   »   if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 703| »   »   »   »   »   x·+=·side·*·centerGap·/·2;
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 709| »   »   »   »   offsets.push(new·Vector2D(x·+·r1,·z·+·r2));
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 689| »   »   »   if·(!shiftRows·&&·n·>·left)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 690| »   »   »   »   n·=·left;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 691| »   »   »   for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 695| »   »   »   »   if·(n%2·==·0)
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 705| »   »   »   »   var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 715| »   »   »   this.maxColumnsUsed[r]·=·n;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/Formation.js
| 588| »   sortingClasses.push("Unknown");
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 593| »   for·(var·i·=·0;·i·<·sortingClasses.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 594| »   »   types[sortingClasses[i]]·=·[];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 601| »   »   for·(var·c·=·0;·c·<·sortingClasses.length;·++c)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 603| »   »   »   if·(classes.indexOf(sortingClasses[c])·>·-1)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 605| »   »   »   »   types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]});
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 744| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 746| »   »   var·t·=·types[sortingClasses[i-1]];
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

binaries/data/mods/public/simulation/components/Formation.js
| 851| »   var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitMotion' is already defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 517| 517| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 518| 518| 				}
| 519| 519| 				else
| 520|    |-				{
|    | 520|+				
| 521| 521| 					// We couldn't move there, or the target moved away
| 522| 522| 					this.FinishOrder();
| 523|    |-				}
|    | 523|+				
| 524| 524| 				return;
| 525| 525| 			}
| 526| 526| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 			}
| 737| 737| 			// Check if we are already in range, otherwise walk there
| 738| 738| 			if (!this.CheckGarrisonRange(msg.data.target))
| 739|    |-			{
|    | 739|+			
| 740| 740| 				if (!this.CheckTargetVisible(msg.data.target))
| 741| 741| 				{
| 742| 742| 					this.FinishOrder();
| 747| 747| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 748| 					return;
| 749| 749| 				}
| 750|    |-			}
|    | 750|+			
| 751| 751| 
| 752| 752| 			this.SetNextState("GARRISON.GARRISONING");
| 753| 753| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 742| 742| 					this.FinishOrder();
| 743| 743| 					return;
| 744| 744| 				}
| 745|    |-				else
| 746|    |-				{
|    | 745|+				
| 747| 746| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 747| 					return;
| 749|    |-				}
|    | 748|+				
| 750| 749| 			}
| 751| 750| 
| 752| 751| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 765| 765| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 766| 766| 					}
| 767| 767| 					else
| 768|    |-					{
|    | 768|+					
| 769| 769| 						// We couldn't move there, or the target moved away
| 770| 770| 						this.FinishOrder();
| 771|    |-					}
|    | 771|+					
| 772| 772| 					return;
| 773| 773| 				}
| 774| 774| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 998| 998| 			},
| 999| 999| 		},
|1000|1000| 
|1001|    |-		"GARRISON":{
|    |1001|+		"GARRISON": {
|1002|1002| 			"enter": function() {
|1003|1003| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1004|1004| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1211|1211| 			// If the controller handled an order but some members rejected it,
|1212|1212| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1213|1213| 			if (this.orderQueue.length)
|1214|    |-			{
|    |1214|+			
|1215|1215| 				// We're leaving the formation, so stop our FormationWalk order
|1216|1216| 				if (this.FinishOrder())
|1217|1217| 					return;
|1218|    |-			}
|    |1218|+			
|1219|1219| 
|1220|1220| 			// No orders left, we're an individual now
|1221|1221| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1239|1239| 			// Move a tile outside the building
|1240|1240| 			let range = 4;
|1241|1241| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1242|    |-			{
|    |1242|+			
|1243|1243| 				// We are already at the target, or can't move at all
|1244|1244| 				this.FinishOrder();
|1245|    |-			}
|    |1245|+			
|1246|1246| 			else
|1247|1247| 			{
|1248|1248| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1455|1455| 
|1456|1456| 			"LosRangeUpdate": function(msg) {
|1457|1457| 				if (this.GetStance().targetVisibleEnemies)
|1458|    |-				{
|    |1458|+				
|1459|1459| 					// Start attacking one of the newly-seen enemy (if any)
|1460|1460| 					this.AttackEntitiesByPreference(msg.data.added);
|1461|    |-				}
|    |1461|+				
|1462|1462| 			},
|1463|1463| 
|1464|1464| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1488|1488| 				this.SelectAnimation("move");
|1489|1489| 			},
|1490|1490| 
|1491|    |-			"leave": function () {
|    |1491|+			"leave": function() {
|1492|1492| 				this.SelectAnimation("idle");
|1493|1493| 				this.StopMoving();
|1494|1494| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1668|1668| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1669|1669| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1670|1670| 						if (cmpHealth && cmpHealth.IsInjured())
|1671|    |-						{
|    |1671|+						
|1672|1672| 							if (this.CanHeal(this.isGuardOf))
|1673|1673| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1674|1674| 							else if (this.CanRepair(this.isGuardOf))
|1675|1675| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1676|    |-						}
|    |1676|+						
|1677|1677| 					}
|1678|1678| 				},
|1679|1679| 
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1951|1951| 
|1952|1952| 				"Attacked": function(msg) {
|1953|1953| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1954|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1955|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1954|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1955|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1956|1956| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1957|1957| 				},
|1958|1958| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2004|2004| 					this.SelectAnimation("move");
|2005|2005| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2006|2006| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2007|    |-					{
|    |2007|+					
|2008|2008| 						// Run after a fleeing target
|2009|2009| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2010|    |-					}
|    |2010|+					
|2011|2011| 					this.StartTimer(1000, 1000);
|2012|2012| 				},
|2013|2013| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2358|2358| 
|2359|2359| 				"Timer": function(msg) {
|2360|2360| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2361|    |-					{
|    |2361|+					
|2362|2362| 						// Return to our original position unless we have a better order.
|2363|2363| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2364|2364| 							this.WalkToHeldPosition();
|2365|    |-					}
|    |2365|+					
|2366|2366| 				},
|2367|2367| 
|2368|2368| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2392|2392| 					this.StartTimer(prepare, this.healTimers.repeat);
|2393|2393| 
|2394|2394| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2395|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2395|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2396|2396| 
|2397|2397| 					this.FaceTowardsTarget(this.order.data.target);
|2398|2398| 				},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2604|2604| 					{
|2605|2605| 						// The building was already finished/fully repaired before we arrived;
|2606|2606| 						// let the ConstructionFinished handler handle this.
|2607|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2607|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2608|2608| 						return true;
|2609|2609| 					}
|2610|2610| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2604|2604| 					{
|2605|2605| 						// The building was already finished/fully repaired before we arrived;
|2606|2606| 						// let the ConstructionFinished handler handle this.
|2607|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2607|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2608|2608| 						return true;
|2609|2609| 					}
|2610|2610| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2796|2796| 
|2797|2797| 					// Check that we can garrison here
|2798|2798| 					if (this.CanGarrison(target))
|2799|    |-					{
|    |2799|+					
|2800|2800| 						// Check that we're in range of the garrison target
|2801|2801| 						if (this.CheckGarrisonRange(target))
|2802|2802| 						{
|2872|2872| 								return false;
|2873|2873| 							}
|2874|2874| 						}
|2875|    |-					}
|    |2875|+					
|2876|2876| 					// Garrisoning failed for some reason, so finish the order
|2877|2877| 					this.FinishOrder();
|2878|2878| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2993|2993| 		"Attacked": function(msg) {
|2994|2994| 			if (this.template.NaturalBehaviour == "skittish" ||
|2995|2995| 			    this.template.NaturalBehaviour == "passive")
|2996|    |-			{
|    |2996|+			
|2997|2997| 				this.Flee(msg.data.attacker, false);
|2998|    |-			}
|    |2998|+			
|2999|2999| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3000|3000| 			{
|3001|3001| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3002|3002| 					this.Attack(msg.data.attacker, false);
|3003|3003| 			}
|3004|3004| 			else if (this.template.NaturalBehaviour == "domestic")
|3005|    |-			{
|    |3005|+			
|3006|3006| 				// Never flee, stop what we were doing
|3007|3007| 				this.SetNextState("IDLE");
|3008|    |-			}
|    |3008|+			
|3009|3009| 		},
|3010|3010| 
|3011|3011| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3057|3057| 				}
|3058|3058| 				// Start attacking one of the newly-seen enemy (if any)
|3059|3059| 				else if (this.IsDangerousAnimal())
|3060|    |-				{
|    |3060|+				
|3061|3061| 					this.AttackVisibleEntity(msg.data.added);
|3062|    |-				}
|    |3062|+				
|3063|3063| 
|3064|3064| 				// TODO: if two units enter our range together, we'll attack the
|3065|3065| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				}
|3101|3101| 				// Start attacking one of the newly-seen enemy (if any)
|3102|3102| 				else if (this.template.NaturalBehaviour == "violent")
|3103|    |-				{
|    |3103|+				
|3104|3104| 					this.AttackVisibleEntity(msg.data.added);
|3105|    |-				}
|    |3105|+				
|3106|3106| 			},
|3107|3107| 
|3108|3108| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3115|3115| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3116|3116| 
|3117|3117| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3118|    |-							// only used for domestic animals
|    |3118|+		// only used for domestic animals
|3119|3119| 	},
|3120|3120| };
|3121|3121| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3172|3172| 
|3173|3173| UnitAI.prototype.IsAnimal = function()
|3174|3174| {
|3175|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3175|+	return (!!this.template.NaturalBehaviour);
|3176|3176| };
|3177|3177| 
|3178|3178| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3210|3210| UnitAI.prototype.GetGarrisonHolder = function()
|3211|3211| {
|3212|3212| 	if (this.IsGarrisoned())
|3213|    |-	{
|    |3213|+	
|3214|3214| 		for (let order of this.orderQueue)
|3215|3215| 			if (order.type == "Garrison")
|3216|3216| 				return order.data.target;
|3217|    |-	}
|    |3217|+	
|3218|3218| 	return INVALID_ENTITY;
|3219|3219| };
|3220|3220| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3288|3288| 		{
|3289|3289| 			let index = this.GetCurrentState().indexOf(".");
|3290|3290| 			if (index != -1)
|3291|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3291|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3292|3292| 			this.Stop(false);
|3293|3293| 		}
|3294|3294| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3344|3344| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3345|3345| 			continue;
|3346|3346| 		if (i == 0)
|3347|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3347|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3348|3348| 		else
|3349|3349| 			this.orderQueue.splice(i, 1);
|3350|3350| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3344|3344| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3345|3345| 			continue;
|3346|3346| 		if (i == 0)
|3347|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3347|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3348|3348| 		else
|3349|3349| 			this.orderQueue.splice(i, 1);
|3350|3350| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3428|3428| };
|3429|3429| 
|3430|3430| 
|3431|    |-//// FSM linkage functions ////
|    |3431|+// // FSM linkage functions ////
|3432|3432| 
|3433|3433| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3434|3434| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3600|3600| 				continue;
|3601|3601| 			if (this.orderQueue[i].type == type)
|3602|3602| 				continue;
|3603|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3603|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3604|3604| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3605|3605| 			return;
|3606|3606| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3600|3600| 				continue;
|3601|3601| 			if (this.orderQueue[i].type == type)
|3602|3602| 				continue;
|3603|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3603|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3604|3604| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3605|3605| 			return;
|3606|3606| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3614|3614| {
|3615|3615| 	// Remember the previous work orders to be able to go back to them later if required
|3616|3616| 	if (data && data.force)
|3617|    |-	{
|    |3617|+	
|3618|3618| 		if (this.IsFormationController())
|3619|3619| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3620|3620| 		else
|3621|3621| 			this.UpdateWorkOrders(type);
|3622|    |-	}
|    |3622|+	
|3623|3623| 
|3624|3624| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3625|3625| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3691|3691| 	{
|3692|3692| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3693|3693| 		if (cmpUnitAI)
|3694|    |-		{
|    |3694|+		
|3695|3695| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3696|3696| 			{
|3697|3697| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3700|3700| 					return;
|3701|3701| 				}
|3702|3702| 			}
|3703|    |-		}
|    |3703|+		
|3704|3704| 	}
|3705|3705| 
|3706|3706| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3693|3693| 		if (cmpUnitAI)
|3694|3694| 		{
|3695|3695| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3696|    |-			{
|    |3696|+			
|3697|3697| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3698|3698| 				{
|3699|3699| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3700|3700| 					return;
|3701|3701| 				}
|3702|    |-			}
|    |3702|+			
|3703|3703| 		}
|3704|3704| 	}
|3705|3705| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3705|3705| 
|3706|3706| 	// If nothing found, take the unit orders
|3707|3707| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3708|    |-	{
|    |3708|+	
|3709|3709| 		if (isWorkType(this.orderQueue[i].type))
|3710|3710| 		{
|3711|3711| 			this.workOrders = this.orderQueue.slice(i);
|3712|3712| 			return;
|3713|3713| 		}
|3714|    |-	}
|    |3714|+	
|3715|3715| };
|3716|3716| 
|3717|3717| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3771|3771| 	if (data.timerRepeat === undefined)
|3772|3772| 		this.timer = undefined;
|3773|3773| 
|3774|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3774|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3775|3775| };
|3776|3776| 
|3777|3777| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3771|3771| 	if (data.timerRepeat === undefined)
|3772|3772| 		this.timer = undefined;
|3773|3773| 
|3774|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3774|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3775|3775| };
|3776|3776| 
|3777|3777| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3806|3806| 	this.timer = undefined;
|3807|3807| };
|3808|3808| 
|3809|    |-//// Message handlers /////
|    |3809|+// // Message handlers /////
|3810|3810| 
|3811|3811| UnitAI.prototype.OnMotionChanged = function(msg)
|3812|3812| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3818|3818| 	// TODO: This is a bit inefficient since every unit listens to every
|3819|3819| 	// construction message - ideally we could scope it to only the one we're building
|3820|3820| 
|3821|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3821|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3822|3822| };
|3823|3823| 
|3824|3824| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3818|3818| 	// TODO: This is a bit inefficient since every unit listens to every
|3819|3819| 	// construction message - ideally we could scope it to only the one we're building
|3820|3820| 
|3821|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3821|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3822|3822| };
|3823|3823| 
|3824|3824| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3843|3843| 
|3844|3844| UnitAI.prototype.OnAttacked = function(msg)
|3845|3845| {
|3846|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3846|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3847|3847| };
|3848|3848| 
|3849|3849| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3843|3843| 
|3844|3844| UnitAI.prototype.OnAttacked = function(msg)
|3845|3845| {
|3846|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3846|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3847|3847| };
|3848|3848| 
|3849|3849| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3848|3848| 
|3849|3849| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3850|3850| {
|3851|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3851|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3852|3852| };
|3853|3853| 
|3854|3854| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3848|3848| 
|3849|3849| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3850|3850| {
|3851|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3851|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3852|3852| };
|3853|3853| 
|3854|3854| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3853|3853| 
|3854|3854| UnitAI.prototype.OnHealthChanged = function(msg)
|3855|3855| {
|3856|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3856|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3857|3857| };
|3858|3858| 
|3859|3859| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3853|3853| 
|3854|3854| UnitAI.prototype.OnHealthChanged = function(msg)
|3855|3855| {
|3856|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3856|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3857|3857| };
|3858|3858| 
|3859|3859| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3859|3859| UnitAI.prototype.OnRangeUpdate = function(msg)
|3860|3860| {
|3861|3861| 	if (msg.tag == this.losRangeQuery)
|3862|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3862|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3863|3863| 	else if (msg.tag == this.losHealRangeQuery)
|3864|3864| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3865|3865| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3859|3859| UnitAI.prototype.OnRangeUpdate = function(msg)
|3860|3860| {
|3861|3861| 	if (msg.tag == this.losRangeQuery)
|3862|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3862|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3863|3863| 	else if (msg.tag == this.losHealRangeQuery)
|3864|3864| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3865|3865| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3861|3861| 	if (msg.tag == this.losRangeQuery)
|3862|3862| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3863|3863| 	else if (msg.tag == this.losHealRangeQuery)
|3864|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3864|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3865|3865| };
|3866|3866| 
|3867|3867| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3861|3861| 	if (msg.tag == this.losRangeQuery)
|3862|3862| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3863|3863| 	else if (msg.tag == this.losHealRangeQuery)
|3864|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3864|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3865|3865| };
|3866|3866| 
|3867|3867| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| 
|3867|3867| UnitAI.prototype.OnPackFinished = function(msg)
|3868|3868| {
|3869|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3869|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3870|3870| };
|3871|3871| 
|3872|3872| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| 
|3867|3867| UnitAI.prototype.OnPackFinished = function(msg)
|3868|3868| {
|3869|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3869|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3870|3870| };
|3871|3871| 
|3872|3872| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3869|3869| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3870|3870| };
|3871|3871| 
|3872|    |-//// Helper functions to be called by the FSM ////
|    |3872|+// // Helper functions to be called by the FSM ////
|3873|3873| 
|3874|3874| UnitAI.prototype.GetWalkSpeed = function()
|3875|3875| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4056|4056| 			PlaySound(name, member);
|4057|4057| 	}
|4058|4058| 	else
|4059|    |-	{
|    |4059|+	
|4060|4060| 		// Otherwise use our own sounds
|4061|4061| 		PlaySound(name, this.entity);
|4062|    |-	}
|    |4062|+	
|4063|4063| };
|4064|4064| 
|4065|4065| /*
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4502|4502| UnitAI.prototype.AttackEntityInZone = function(ents)
|4503|4503| {
|4504|4504| 	var target = ents.find(target =>
|4505|    |-		this.CanAttack(target)
|4506|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4505|+		this.CanAttack(target) &&
|    |4506|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4507|4507| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4508|4508| 	);
|4509|4509| 	if (!target)
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4503|4503| {
|4504|4504| 	var target = ents.find(target =>
|4505|4505| 		this.CanAttack(target)
|4506|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4507|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4506|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4507|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4508|4508| 	);
|4509|4509| 	if (!target)
|4510|4510| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4567|4567| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4568|4568| 	if (this.isGuardOf)
|4569|4569| 	{
|4570|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4570|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4571|4571| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4572|4572| 		if (cmpUnitAI && cmpAttack &&
|4573|4573| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4571|4571| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4572|4572| 		if (cmpUnitAI && cmpAttack &&
|4573|4573| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4574|    |-				return false;
|    |4574|+			return false;
|4575|4575| 	}
|4576|4576| 
|4577|4577| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4576|4576| 
|4577|4577| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4578|4578| 	if (this.GetStance().respondHoldGround)
|4579|    |-	{
|    |4579|+	
|4580|4580| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4581|4581| 			return true;
|4582|    |-	}
|    |4582|+	
|4583|4583| 
|4584|4584| 	// Stop if it's left our vision range, unless we're especially persistent
|4585|4585| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4583|4583| 
|4584|4584| 	// Stop if it's left our vision range, unless we're especially persistent
|4585|4585| 	if (!this.GetStance().respondChaseBeyondVision)
|4586|    |-	{
|    |4586|+	
|4587|4587| 		if (!this.CheckTargetIsInVisionRange(target))
|4588|4588| 			return true;
|4589|    |-	}
|    |4589|+	
|4590|4590| 
|4591|4591| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4592|4592| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4609|4609| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4610|4610| 	if (this.isGuardOf)
|4611|4611| 	{
|4612|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4612|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4613|4613| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4614|4614| 		if (cmpUnitAI && cmpAttack &&
|4615|4615| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4622|4622| 	return false;
|4623|4623| };
|4624|4624| 
|4625|    |-//// External interface functions ////
|    |4625|+// // External interface functions ////
|4626|4626| 
|4627|4627| UnitAI.prototype.SetFormationController = function(ent)
|4628|4628| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4632|4632| 	// of our own formation (or ourself if not in formation)
|4633|4633| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4634|4634| 	if (cmpObstruction)
|4635|    |-	{
|    |4635|+	
|4636|4636| 		if (ent == INVALID_ENTITY)
|4637|4637| 			cmpObstruction.SetControlGroup(this.entity);
|4638|4638| 		else
|4639|4639| 			cmpObstruction.SetControlGroup(ent);
|4640|    |-	}
|    |4640|+	
|4641|4641| 
|4642|4642| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4643|4643| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4775|4775| 	// if we already had an old guard order, do nothing if the target is the same
|4776|4776| 	// and the order is running, otherwise remove the previous order
|4777|4777| 	if (this.isGuardOf)
|4778|    |-	{
|    |4778|+	
|4779|4779| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4780|4780| 			return;
|4781|4781| 		else
|4782|4782| 			this.RemoveGuard();
|4783|    |-	}
|    |4783|+	
|4784|4784| 
|4785|4785| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4786|4786| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4778|4778| 	{
|4779|4779| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4780|4780| 			return;
|4781|    |-		else
|4782|    |-			this.RemoveGuard();
|    |4781|+		this.RemoveGuard();
|4783|4782| 	}
|4784|4783| 
|4785|4784| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5110|5110| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5111|5111| 	{
|5112|5112| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5113|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5113|+		if (cmpTrader.HasBothMarkets() &&
|5114|5114| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5115|5115| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5116|5116| 		{
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5391|5391| 				{
|5392|5392| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5393|5393| 					var targetClasses = this.order.data.targetClasses;
|5394|    |-					if (targetClasses.attack && cmpIdentity
|5395|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5394|+					if (targetClasses.attack && cmpIdentity &&
|    |5395|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5396|5396| 						continue;
|5397|5397| 					if (targetClasses.avoid && cmpIdentity
|5398|5398| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5394|5394| 					if (targetClasses.attack && cmpIdentity
|5395|5395| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5396|5396| 						continue;
|5397|    |-					if (targetClasses.avoid && cmpIdentity
|5398|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5397|+					if (targetClasses.avoid && cmpIdentity &&
|    |5398|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5399|5399| 						continue;
|5400|5400| 					// Only used by the AIs to prevent some choices of targets
|5401|5401| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5417|5417| 		{
|5418|5418| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5419|5419| 			var targetClasses = this.order.data.targetClasses;
|5420|    |-			if (cmpIdentity && targetClasses.attack
|5421|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5420|+			if (cmpIdentity && targetClasses.attack &&
|    |5421|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5422|5422| 				continue;
|5423|5423| 			if (cmpIdentity && targetClasses.avoid
|5424|5424| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5420|5420| 			if (cmpIdentity && targetClasses.attack
|5421|5421| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5422|5422| 				continue;
|5423|    |-			if (cmpIdentity && targetClasses.avoid
|5424|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5423|+			if (cmpIdentity && targetClasses.avoid &&
|    |5424|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5425|5425| 				continue;
|5426|5426| 			// Only used by the AIs to prevent some choices of targets
|5427|5427| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5577|5577| 
|5578|5578| UnitAI.prototype.SetHeldPosition = function(x, z)
|5579|5579| {
|5580|    |-	this.heldPosition = {"x": x, "z": z};
|    |5580|+	this.heldPosition = { "x": x, "z": z};
|5581|5581| };
|5582|5582| 
|5583|5583| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5577|5577| 
|5578|5578| UnitAI.prototype.SetHeldPosition = function(x, z)
|5579|5579| {
|5580|    |-	this.heldPosition = {"x": x, "z": z};
|    |5580|+	this.heldPosition = {"x": x, "z": z };
|5581|5581| };
|5582|5582| 
|5583|5583| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5604|5604| 	return false;
|5605|5605| };
|5606|5606| 
|5607|    |-//// Helper functions ////
|    |5607|+// // Helper functions ////
|5608|5608| 
|5609|5609| UnitAI.prototype.CanAttack = function(target)
|5610|5610| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5808|5808| 	return cmpPack && cmpPack.IsPacking();
|5809|5809| };
|5810|5810| 
|5811|    |-//// Formation specific functions ////
|    |5811|+// // Formation specific functions ////
|5812|5812| 
|5813|5813| UnitAI.prototype.IsAttackingAsFormation = function()
|5814|5814| {
|    | [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/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5813|5813| UnitAI.prototype.IsAttackingAsFormation = function()
|5814|5814| {
|5815|5815| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5816|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5817|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5816|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5817|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5818|5818| };
|5819|5819| 
|5820|5820| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5817|5817| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5818|5818| };
|5819|5819| 
|5820|    |-//// Animal specific functions ////
|    |5820|+// // Animal specific functions ////
|5821|5821| 
|5822|5822| UnitAI.prototype.MoveRandomly = function(distance)
|5823|5823| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 327| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 891| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 913| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 960| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1023| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1058| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1090| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1299| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1482| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1503| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1533| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1688| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1739| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1815| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1978| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1983| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1989| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1994| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2085| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2337| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2455| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2520| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2560| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2766| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2949| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3676| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4489| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4504| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4550| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4573| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
| 354| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1955| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2497| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2798| »   »   »   »   »   if·(this.CanGarrison(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2801| »   »   »   »   »   »   if·(this.CheckGarrisonRange(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2803| »   »   »   »   »   »   »   var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2825| »   »   »   »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2826| »   »   »   »   »   »   »   »   if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2841| »   »   »   »   »   »   »   »   »   var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2842| »   »   »   »   »   »   »   »   »   var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2869| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|2869| »   »   »   »   »   »   »   if·(!this.CheckTargetRangeExplicit(target,·0,·0)·&&·this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3638| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3707| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4506| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4507| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5395| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5398| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5411| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5412| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5419| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5421| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5424| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5499| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5502| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5507| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5510| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5511| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5521| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5524| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5817| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1921/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Jul 8 2019, 8:24 PM
This revision was automatically updated to reflect the committed changes.