Page MenuHomeWildfire Games

Remove formation minimum range
ClosedPublic

Authored by temple on Mar 31 2018, 2:35 AM.

Details

Summary

Formations have a minimum attack range that makes them move away from a target if they're too close. This doesn't really work well, so let's remove it for the moment.
Also let's stop the formation controller from moving while its members are doing something (like attacking).

Test Plan

Mainly trying to get the behavior on Jebel Barkal to look better.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

temple created this revision.Mar 31 2018, 2:35 AM

I use this patch to select the formation controller during a game and see what it's doing.

temple added inline comments.Mar 31 2018, 3:08 AM
binaries/data/mods/public/simulation/components/UnitAI.js
3325–3329 ↗(On Diff #6291)

Probably should remove this. We get this error sometimes:

ERROR: Error in timer on entity 2413, IID95, function TimerHandler: TypeError: this.order is undefined
  UnitAI.prototype.FindWalkAndFightTargets@simulation/components/UnitAI.js:5453:1
  UnitAI.prototype.UnitFsmSpec.INDIVIDUAL.COMBAT.ATTACKING.Timer@simulation/components/UnitAI.js:1986:8
  FSM.prototype.ProcessMessage@simulation/helpers/FSM.js:274:12
  UnitAI.prototype.TimerHandler@simulation/components/UnitAI.js:3862:2
  Timer.prototype.OnUpdate@simulation/components/Timer.js:120:4

Because the formation controller goes back to Patrol right as an individual unit finishes his attack and wonders if he should look for new targets. But he doesn't have an attack order (the formation controller has it) so he doesn't know targetClasses or allowCapture. (Etc., meh.)

elexis added a subscriber: elexis.Apr 6 2018, 12:29 PM

Strongly agree with units moving away from the attacker while getting attacked, they should attack instantly, which does equate to setting minimum range to 0.
This will cause less lag on maps that spawn gaia attackers in formation, because units become more effective, which means that we need less of them.
But it is also crucial for competitive multiplayer and noncompetitive singleplayer, because units often in the middle of the fight decide to stop attacking and walk away while getting slaughtered.
I'm just not sure if the comment should be updated or a TODO added. (It needs some design I suppose)

I have tested with this r21666 replay

We can see the red formation walking while getting attacked after attacking themselves.
The minimum range change itself doesn't fix the issue, the UnitAI one apparently does.

But there are some side effect of the latter

  • There are two formation controllers at two points in the replay
  • The formation controller stopping to move as soon as attackers are in sight means the units disband immediately, which is much sooner, thus resulting in more "ant-movements" rather than being more grouped while attacking. But that might be acceptable.

(The patch to select the formation controller is nice, I wonder if we shouldn't commit some of the conditions to make it easier in the future.)

binaries/data/mods/public/simulation/components/UnitAI.js
3325–3329 ↗(On Diff #6291)

(Unrelated and was done in rP21655 / D1425 / #5108)

temple updated this revision to Diff 6358.Apr 9 2018, 2:48 AM

Fix a huge bug that prevented units from picking new targets. (How does such a bug exist for so long?)

Vulcan added a subscriber: Vulcan.Apr 9 2018, 2:51 AM

Build failure - The Moirai have given mortals hearts that can endure.

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/FormationAttack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|  17|  17| 
|  18|  18| FormationAttack.prototype.GetRange = function(target)
|  19|  19| {
|  20|    |-	var result = {"min": 0, "max": this.canAttackAsFormation ? -1 : 0};
|    |  20|+	var result = { "min": 0, "max": this.canAttackAsFormation ? -1 : 0};
|  21|  21| 	var cmpFormation = Engine.QueryInterface(this.entity, IID_Formation);
|  22|  22| 	if (!cmpFormation)
|  23|  23| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|  17|  17| 
|  18|  18| FormationAttack.prototype.GetRange = function(target)
|  19|  19| {
|  20|    |-	var result = {"min": 0, "max": this.canAttackAsFormation ? -1 : 0};
|    |  20|+	var result = {"min": 0, "max": this.canAttackAsFormation ? -1 : 0 };
|  21|  21| 	var cmpFormation = Engine.QueryInterface(this.entity, IID_Formation);
|  22|  22| 	if (!cmpFormation)
|  23|  23| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|  46|  46| 				result.max = range.max;
|  47|  47| 		}
|  48|  48| 		else
|  49|    |-		{
|    |  49|+		
|  50|  50| 			if (range.max > result.max || range.max < 0)
|  51|  51| 				result.max = range.max;
|  52|    |-		}
|    |  52|+		
|  53|  53| 		if (range.min < result.min)
|  54|  54| 			result.min = range.min;
|  55|  55| 	}
|    | [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
| 126| 126| 	this.formationMembersWithAura = []; // Members with a formation aura
| 127| 127| 	this.width = 0;
| 128| 128| 	this.depth = 0;
| 129|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 129|+	this.oldOrientation = { "sin": 0, "cos": 0};
| 130| 130| 	this.twinFormations = [];
| 131| 131| 	// distance from which two twin formations will merge into one.
| 132| 132| 	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
| 126| 126| 	this.formationMembersWithAura = []; // Members with a formation aura
| 127| 127| 	this.width = 0;
| 128| 128| 	this.depth = 0;
| 129|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 129|+	this.oldOrientation = {"sin": 0, "cos": 0 };
| 130| 130| 	this.twinFormations = [];
| 131| 131| 	// distance from which two twin formations will merge into one.
| 132| 132| 	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
| 144| 144| 
| 145| 145| Formation.prototype.GetSize = function()
| 146| 146| {
| 147|    |-	return {"width": this.width, "depth": this.depth};
|    | 147|+	return { "width": this.width, "depth": this.depth};
| 148| 148| };
| 149| 149| 
| 150| 150| 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
| 144| 144| 
| 145| 145| Formation.prototype.GetSize = function()
| 146| 146| {
| 147|    |-	return {"width": this.width, "depth": this.depth};
|    | 147|+	return {"width": this.width, "depth": this.depth };
| 148| 148| };
| 149| 149| 
| 150| 150| 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
| 563| 563| 			footprints.push(cmpFootprint.GetShape());
| 564| 564| 	}
| 565| 565| 	if (!footprints.length)
| 566|    |-		return {"width":1, "depth": 1};
|    | 566|+		return { "width":1, "depth": 1};
| 567| 567| 
| 568| 568| 	var r = {"width": 0, "depth": 0};
| 569| 569| 	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
| 563| 563| 			footprints.push(cmpFootprint.GetShape());
| 564| 564| 	}
| 565| 565| 	if (!footprints.length)
| 566|    |-		return {"width":1, "depth": 1};
|    | 566|+		return {"width": 1, "depth": 1};
| 567| 567| 
| 568| 568| 	var r = {"width": 0, "depth": 0};
| 569| 569| 	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
| 563| 563| 			footprints.push(cmpFootprint.GetShape());
| 564| 564| 	}
| 565| 565| 	if (!footprints.length)
| 566|    |-		return {"width":1, "depth": 1};
|    | 566|+		return {"width":1, "depth": 1 };
| 567| 567| 
| 568| 568| 	var r = {"width": 0, "depth": 0};
| 569| 569| 	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
| 565| 565| 	if (!footprints.length)
| 566| 566| 		return {"width":1, "depth": 1};
| 567| 567| 
| 568|    |-	var r = {"width": 0, "depth": 0};
|    | 568|+	var r = { "width": 0, "depth": 0};
| 569| 569| 	for (var shape of footprints)
| 570| 570| 	{
| 571| 571| 		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
| 565| 565| 	if (!footprints.length)
| 566| 566| 		return {"width":1, "depth": 1};
| 567| 567| 
| 568|    |-	var r = {"width": 0, "depth": 0};
|    | 568|+	var r = {"width": 0, "depth": 0 };
| 569| 569| 	for (var shape of footprints)
| 570| 570| 	{
| 571| 571| 		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
| 567| 567| 
| 568| 568| 	var r = {"width": 0, "depth": 0};
| 569| 569| 	for (var shape of footprints)
| 570|    |-	{
|    | 570|+	
| 571| 571| 		if (shape.type == "circle")
| 572| 572| 		{
| 573| 573| 			r.width += shape.radius * 2;
| 578| 578| 			r.width += shape.width;
| 579| 579| 			r.depth += shape.depth;
| 580| 580| 		}
| 581|    |-	}
|    | 581|+	
| 582| 582| 	r.width /= footprints.length;
| 583| 583| 	r.depth /= footprints.length;
| 584| 584| 	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
| 591| 591| 	separation.depth *= this.separationMultiplier.depth;
| 592| 592| 
| 593| 593| 	if (this.columnar)
| 594|    |-		var sortingClasses = ["Cavalry","Infantry"];
|    | 594|+		var sortingClasses = ["Cavalry", "Infantry"];
| 595| 595| 	else
| 596| 596| 		var sortingClasses = this.sortingClasses.slice();
| 597| 597| 	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
| 608| 608| 		var classes = cmpIdentity.GetClassesList();
| 609| 609| 		var done = false;
| 610| 610| 		for (var c = 0; c < sortingClasses.length; ++c)
| 611|    |-		{
|    | 611|+		
| 612| 612| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 613| 613| 			{
| 614| 614| 				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
| 615| 615| 				done = true;
| 616| 616| 				break;
| 617| 617| 			}
| 618|    |-		}
|    | 618|+		
| 619| 619| 		if (!done)
| 620| 620| 			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
| 621| 621| 	}
|    | [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
| 611| 611| 		{
| 612| 612| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 613| 613| 			{
| 614|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 614|+				types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]});
| 615| 615| 				done = true;
| 616| 616| 				break;
| 617| 617| 			}
|    | [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
| 611| 611| 		{
| 612| 612| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 613| 613| 			{
| 614|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 614|+				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] });
| 615| 615| 				done = true;
| 616| 616| 				break;
| 617| 617| 			}
|    | [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
| 617| 617| 			}
| 618| 618| 		}
| 619| 619| 		if (!done)
| 620|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 620|+			types.Unknown.push({"ent": active[i], "pos": positions[i]});
| 621| 621| 	}
| 622| 622| 
| 623| 623| 	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
| 617| 617| 			}
| 618| 618| 		}
| 619| 619| 		if (!done)
| 620|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 620|+			types["Unknown"].push({ "ent": active[i], "pos": positions[i]});
| 621| 621| 	}
| 622| 622| 
| 623| 623| 	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
| 617| 617| 			}
| 618| 618| 		}
| 619| 619| 		if (!done)
| 620|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 620|+			types["Unknown"].push({"ent": active[i], "pos": positions[i] });
| 621| 621| 	}
| 622| 622| 
| 623| 623| 	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
| 635| 635| 	if (this.columnar)
| 636| 636| 	{
| 637| 637| 		shape = "square";
| 638|    |-		cols = Math.min(count,3);
|    | 638|+		cols = Math.min(count, 3);
| 639| 639| 		shiftRows = false;
| 640| 640| 		centerGap = 0;
| 641| 641| 		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
| 689| 689| 					n -= r%2;
| 690| 690| 			}
| 691| 691| 			else if (shape == "triangle")
| 692|    |-			{
|    | 692|+			
| 693| 693| 				if (shiftRows)
| 694| 694| 					var n = r + 1;
| 695| 695| 				else
| 696| 696| 					var n = r * 2 + 1;
| 697|    |-			}
|    | 697|+			
| 698| 698| 			if (!shiftRows && n > left)
| 699| 699| 				n = left;
| 700| 700| 			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
| 730| 730| 	// calculating offset distances without a zero average makes no sense, as the formation
| 731| 731| 	// will jump to a different position any time
| 732| 732| 	var avgoffset = Vector2D.average(offsets);
| 733|    |-	offsets.forEach(function (o) {o.sub(avgoffset);});
|    | 733|+	offsets.forEach(function(o) {o.sub(avgoffset);});
| 734| 734| 
| 735| 735| 	// sort the available places in certain ways
| 736| 736| 	// 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
| 789| 789| 			closestOffsetId = i;
| 790| 790| 		}
| 791| 791| 	}
| 792|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 792|+	this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
| 793| 793| 	return closestOffsetId;
| 794| 794| };
| 795| 795| 
|    | [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
| 789| 789| 			closestOffsetId = i;
| 790| 790| 		}
| 791| 791| 	}
| 792|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 792|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column};
| 793| 793| 	return closestOffsetId;
| 794| 794| };
| 795| 795| 
|    | [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
| 789| 789| 			closestOffsetId = i;
| 790| 790| 		}
| 791| 791| 	}
| 792|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 792|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column };
| 793| 793| 	return closestOffsetId;
| 794| 794| };
| 795| 795| 
|    | [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
| 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 800| 800| {
| 801| 801| 	var offsetPositions = [];
| 802|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 802|+	var { sin, cos} = this.GetEstimatedOrientation(pos);
| 803| 803| 	// calculate the world positions
| 804| 804| 	for (var o of offsets)
| 805| 805| 		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
| 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 800| 800| {
| 801| 801| 	var offsetPositions = [];
| 802|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 802|+	var {sin, cos } = this.GetEstimatedOrientation(pos);
| 803| 803| 	// calculate the world positions
| 804| 804| 	for (var o of offsets)
| 805| 805| 		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
| 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos)
| 817| 817| {
| 818| 818| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 819|    |-	var r = {"sin": 0, "cos": 1};
|    | 819|+	var r = { "sin": 0, "cos": 1};
| 820| 820| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 821| 821| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 822| 822| 	{
|    | [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
| 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos)
| 817| 817| {
| 818| 818| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 819|    |-	var r = {"sin": 0, "cos": 1};
|    | 819|+	var r = {"sin": 0, "cos": 1 };
| 820| 820| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 821| 821| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 822| 822| 	{
|    | [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
| 898| 898| 		cmpOtherFormation.RemoveMembers(otherMembers);
| 899| 899| 		this.AddMembers(otherMembers);
| 900| 900| 		Engine.DestroyEntity(this.twinFormations[i]);
| 901|    |-		this.twinFormations.splice(i,1);
|    | 901|+		this.twinFormations.splice(i, 1);
| 902| 902| 	}
| 903| 903| 	// Switch between column and box if necessary
| 904| 904| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/Formation.js
| 620| »   »   »   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
| 660| »   »   for·(var·i·=·0;·i·<·count;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

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

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

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

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

binaries/data/mods/public/simulation/components/Formation.js
| 710| »   »   »   »   »   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
| 712| »   »   »   »   »   x·+=·side·*·centerGap·/·2;
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

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

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

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

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

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

binaries/data/mods/public/simulation/components/Formation.js
| 714| »   »   »   »   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
| 724| »   »   »   this.maxColumnsUsed[r]·=·n;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/Formation.js
| 614| »   »   »   »   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
| 753| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

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

binaries/data/mods/public/simulation/components/Formation.js
| 860| »   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
| 228| 228| 		// Move a tile outside the building
| 229| 229| 		let range = 4;
| 230| 230| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 231|    |-		{
|    | 231|+		
| 232| 232| 			// We've started walking to the given point
| 233| 233| 			this.SetNextState("INDIVIDUAL.WALKING");
| 234|    |-		}
|    | 234|+		
| 235| 235| 		else
| 236| 236| 		{
| 237| 237| 			// 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
| 233| 233| 			this.SetNextState("INDIVIDUAL.WALKING");
| 234| 234| 		}
| 235| 235| 		else
| 236|    |-		{
|    | 236|+		
| 237| 237| 			// We are already at the target, or can't move at all
| 238| 238| 			this.FinishOrder();
| 239|    |-		}
|    | 239|+		
| 240| 240| 	},
| 241| 241| 
| 242| 242| 	// 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
| 335| 335| 
| 336| 336| 		var ok = this.MoveToTarget(this.order.data.target);
| 337| 337| 		if (ok)
| 338|    |-		{
|    | 338|+		
| 339| 339| 			// We've started walking to the given point
| 340| 340| 			if (this.IsAnimal())
| 341| 341| 				this.SetNextState("ANIMAL.WALKING");
| 342| 342| 			else
| 343| 343| 				this.SetNextState("INDIVIDUAL.WALKING");
| 344|    |-		}
|    | 344|+		
| 345| 345| 		else
| 346| 346| 		{
| 347| 347| 			// 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
| 363| 363| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 364| 364| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 365| 365| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 366|    |-		{
|    | 366|+		
| 367| 367| 			// we were already on the shoreline, and have not moved since
| 368| 368| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 369| 369| 				needToMove = false;
| 370|    |-		}
|    | 370|+		
| 371| 371| 
| 372| 372| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 373| 373| 		// 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
| 361| 361| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 362| 362| 		var needToMove = true;
| 363| 363| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 364|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 365|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 364|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 365|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 366| 366| 		{
| 367| 367| 			// we were already on the shoreline, and have not moved since
| 368| 368| 			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
| 372| 372| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 373| 373| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 374| 374| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 375|    |-		{
|    | 375|+		
| 376| 376| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 377|    |-		}
|    | 377|+		
| 378| 378| 		else
| 379| 379| 		{
| 380| 380| 			// 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
| 401| 401| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 402| 402| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 403| 403| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 404|    |-		{
|    | 404|+		
| 405| 405| 			// We've started fleeing from the given target
| 406| 406| 			if (this.IsAnimal())
| 407| 407| 				this.SetNextState("ANIMAL.FLEEING");
| 408| 408| 			else
| 409| 409| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 410|    |-		}
|    | 410|+		
| 411| 411| 		else
| 412| 412| 		{
| 413| 413| 			// 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
| 448| 448| 			}
| 449| 449| 
| 450| 450| 			if (this.order.data.attackType == this.oldAttackType)
| 451|    |-			{
|    | 451|+			
| 452| 452| 				if (this.IsAnimal())
| 453| 453| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 454| 454| 				else
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456|    |-			}
|    | 456|+			
| 457| 457| 			else
| 458| 458| 			{
| 459| 459| 				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
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456| 456| 			}
| 457| 457| 			else
| 458|    |-			{
|    | 458|+			
| 459| 459| 				if (this.IsAnimal())
| 460| 460| 					this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
| 461| 461| 				else
| 462| 462| 					this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
| 463|    |-			}
|    | 463|+			
| 464| 464| 			return;
| 465| 465| 		}
| 466| 466| 
|    | [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
| 580| 580| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 581| 581| 				}
| 582| 582| 				else
| 583|    |-				{
|    | 583|+				
| 584| 584| 					// We couldn't move there, or the target moved away
| 585| 585| 					this.FinishOrder();
| 586|    |-				}
|    | 586|+				
| 587| 587| 				return;
| 588| 588| 			}
| 589| 589| 
|    | [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
| 593| 593| 
| 594| 594| 		// Try to move within range
| 595| 595| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 596|    |-		{
|    | 596|+		
| 597| 597| 			// We've started walking to the given point
| 598| 598| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 599|    |-		}
|    | 599|+		
| 600| 600| 		else
| 601| 601| 		{
| 602| 602| 			// 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
| 670| 670| 	"Order.Repair": function(msg) {
| 671| 671| 		// Try to move within range
| 672| 672| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 673|    |-		{
|    | 673|+		
| 674| 674| 			// We've started walking to the given point
| 675| 675| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 676|    |-		}
|    | 676|+		
| 677| 677| 		else
| 678| 678| 		{
| 679| 679| 			// 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
| 706| 706| 		}
| 707| 707| 
| 708| 708| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 709|    |-		{
|    | 709|+		
| 710| 710| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 711|    |-		}
|    | 711|+		
| 712| 712| 		else
| 713| 713| 		{
| 714| 714| 			// 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
| 834| 834| 			if (!this.CheckTargetAttackRange(target, target))
| 835| 835| 			{
| 836| 836| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 837|    |-				{
|    | 837|+				
| 838| 838| 					if (this.MoveToTargetAttackRange(target, target))
| 839| 839| 					{
| 840| 840| 						this.SetNextState("COMBAT.APPROACHING");
| 841| 841| 						return;
| 842| 842| 					}
| 843|    |-				}
|    | 843|+				
| 844| 844| 				this.FinishOrder();
| 845| 845| 				return;
| 846| 846| 			}
|    | [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
| 859| 859| 			}
| 860| 860| 			// Check if we are already in range, otherwise walk there
| 861| 861| 			if (!this.CheckGarrisonRange(msg.data.target))
| 862|    |-			{
|    | 862|+			
| 863| 863| 				if (!this.CheckTargetVisible(msg.data.target))
| 864| 864| 				{
| 865| 865| 					this.FinishOrder();
| 874| 874| 						return;
| 875| 875| 					}
| 876| 876| 				}
| 877|    |-			}
|    | 877|+			
| 878| 878| 
| 879| 879| 			this.SetNextState("GARRISON.GARRISONING");
| 880| 880| 		},
|    | [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
| 866| 866| 					return;
| 867| 867| 				}
| 868| 868| 				else
| 869|    |-				{
|    | 869|+				
| 870| 870| 					// Out of range; move there in formation
| 871| 871| 					if (this.MoveToGarrisonRange(msg.data.target))
| 872| 872| 					{
| 873| 873| 						this.SetNextState("GARRISON.APPROACHING");
| 874| 874| 						return;
| 875| 875| 					}
| 876|    |-				}
|    | 876|+				
| 877| 877| 			}
| 878| 878| 
| 879| 879| 			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
| 865| 865| 					this.FinishOrder();
| 866| 866| 					return;
| 867| 867| 				}
| 868|    |-				else
| 869|    |-				{
|    | 868|+				
| 870| 869| 					// Out of range; move there in formation
| 871| 870| 					if (this.MoveToGarrisonRange(msg.data.target))
| 872| 871| 					{
| 873| 872| 						this.SetNextState("GARRISON.APPROACHING");
| 874| 873| 						return;
| 875| 874| 					}
| 876|    |-				}
|    | 875|+				
| 877| 876| 			}
| 878| 877| 
| 879| 878| 			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
| 892| 892| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 893| 893| 					}
| 894| 894| 					else
| 895|    |-					{
|    | 895|+					
| 896| 896| 						// We couldn't move there, or the target moved away
| 897| 897| 						this.FinishOrder();
| 898|    |-					}
|    | 898|+					
| 899| 899| 					return;
| 900| 900| 				}
| 901| 901| 
|    | [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
|1113|1113| 			},
|1114|1114| 		},
|1115|1115| 
|1116|    |-		"GARRISON":{
|    |1116|+		"GARRISON": {
|1117|1117| 			"enter": function() {
|1118|1118| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1119|1119| 				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
|1297|1297| 			// If the controller handled an order but some members rejected it,
|1298|1298| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1299|1299| 			if (this.orderQueue.length)
|1300|    |-			{
|    |1300|+			
|1301|1301| 				// We're leaving the formation, so stop our FormationWalk order
|1302|1302| 				if (this.FinishOrder())
|1303|1303| 					return;
|1304|    |-			}
|    |1304|+			
|1305|1305| 
|1306|1306| 			// No orders left, we're an individual now
|1307|1307| 			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
|1325|1325| 			// Move a tile outside the building
|1326|1326| 			let range = 4;
|1327|1327| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1328|    |-			{
|    |1328|+			
|1329|1329| 				// We've started walking to the given point
|1330|1330| 				this.SetNextState("WALKINGTOPOINT");
|1331|    |-			}
|    |1331|+			
|1332|1332| 			else
|1333|1333| 			{
|1334|1334| 				// 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
|1330|1330| 				this.SetNextState("WALKINGTOPOINT");
|1331|1331| 			}
|1332|1332| 			else
|1333|    |-			{
|    |1333|+			
|1334|1334| 				// We are already at the target, or can't move at all
|1335|1335| 				this.FinishOrder();
|1336|    |-			}
|    |1336|+			
|1337|1337| 		},
|1338|1338| 
|1339|1339| 
|    | [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
|1531|1531| 
|1532|1532| 			"LosRangeUpdate": function(msg) {
|1533|1533| 				if (this.GetStance().targetVisibleEnemies)
|1534|    |-				{
|    |1534|+				
|1535|1535| 					// Start attacking one of the newly-seen enemy (if any)
|1536|1536| 					this.AttackEntitiesByPreference(msg.data.added);
|1537|    |-				}
|    |1537|+				
|1538|1538| 			},
|1539|1539| 
|1540|1540| 			"LosHealRangeUpdate": 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
|1717|1717| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1718|1718| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1719|1719| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1720|    |-						{
|    |1720|+						
|1721|1721| 							if (this.CanHeal(this.isGuardOf))
|1722|1722| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1723|1723| 							else if (this.CanRepair(this.isGuardOf))
|1724|1724| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1725|    |-						}
|    |1725|+						
|1726|1726| 					}
|1727|1727| 				},
|1728|1728| 
|    | [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
|1805|1805| 				"MoveCompleted": function() {
|1806|1806| 
|1807|1807| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1808|    |-					{
|    |1808|+					
|1809|1809| 						// If the unit needs to unpack, do so
|1810|1810| 						if (this.CanUnpack())
|1811|1811| 						{
|1814|1814| 						}
|1815|1815| 						else
|1816|1816| 							this.SetNextState("ATTACKING");
|1817|    |-					}
|    |1817|+					
|1818|1818| 					else
|1819|1819| 					{
|1820|1820| 						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
|1812|1812| 							this.PushOrderFront("Unpack", { "force": true });
|1813|1813| 							return;
|1814|1814| 						}
|1815|    |-						else
|1816|    |-							this.SetNextState("ATTACKING");
|    |1815|+						this.SetNextState("ATTACKING");
|1817|1816| 					}
|1818|1817| 					else
|1819|1818| 					{
|    | [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
|1816|1816| 							this.SetNextState("ATTACKING");
|1817|1817| 					}
|1818|1818| 					else
|1819|    |-					{
|    |1819|+					
|1820|1820| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1821|1821| 						{
|1822|1822| 							this.SetNextState("APPROACHING");
|1826|1826| 							// Give up
|1827|1827| 							this.FinishOrder();
|1828|1828| 						}
|1829|    |-					}
|    |1829|+					
|1830|1830| 				},
|1831|1831| 			},
|1832|1832| 
|    | [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
|1818|1818| 					else
|1819|1819| 					{
|1820|1820| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1821|    |-						{
|    |1821|+						
|1822|1822| 							this.SetNextState("APPROACHING");
|1823|    |-						}
|    |1823|+						
|1824|1824| 						else
|1825|1825| 						{
|1826|1826| 							// 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
|1822|1822| 							this.SetNextState("APPROACHING");
|1823|1823| 						}
|1824|1824| 						else
|1825|    |-						{
|    |1825|+						
|1826|1826| 							// Give up
|1827|1827| 							this.FinishOrder();
|1828|    |-						}
|    |1828|+						
|1829|1829| 					}
|1830|1830| 				},
|1831|1831| 			},
|    | [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
|1843|1843| 					}
|1844|1844| 					// Check the target is still alive and attackable
|1845|1845| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1846|    |-					{
|    |1846|+					
|1847|1847| 						// Can't reach it - try to chase after it
|1848|1848| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1849|1849| 						{
|1853|1853| 								return;
|1854|1854| 							}
|1855|1855| 						}
|1856|    |-					}
|    |1856|+					
|1857|1857| 
|1858|1858| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1859|1859| 					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
|1846|1846| 					{
|1847|1847| 						// Can't reach it - try to chase after it
|1848|1848| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1849|    |-						{
|    |1849|+						
|1850|1850| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1851|1851| 							{
|1852|1852| 								this.SetNextState("COMBAT.CHASING");
|1853|1853| 								return;
|1854|1854| 							}
|1855|    |-						}
|    |1855|+						
|1856|1856| 					}
|1857|1857| 
|1858|1858| 					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
|1884|1884| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1885|1885| 
|1886|1886| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1887|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1887|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1888|1888| 
|1889|1889| 					this.FaceTowardsTarget(this.order.data.target);
|1890|1890| 
|    | [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
|1959|1959| 
|1960|1960| 						// Can't reach it - try to chase after it
|1961|1961| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1962|    |-						{
|    |1962|+						
|1963|1963| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1964|1964| 							{
|1965|1965| 								this.SetNextState("COMBAT.CHASING");
|1966|1966| 								return;
|1967|1967| 							}
|1968|    |-						}
|    |1968|+						
|1969|1969| 					}
|1970|1970| 
|1971|1971| 					// 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
|2008|2008| 
|2009|2009| 				"Attacked": function(msg) {
|2010|2010| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2011|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2012|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2011|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2012|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2013|2013| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2014|2014| 				},
|2015|2015| 			},
|    | [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
|2092|2092| 						// Also don't switch to a different type of huntable animal
|2093|2093| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2094|2094| 							return (
|2095|    |-								ent != oldTarget
|2096|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2095|+								ent != oldTarget &&
|    |2096|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2097|2097| 								 || (type.specific == oldType.specific
|2098|2098| 								 && (type.specific != "meat" || oldTemplate == template)))
|2099|2099| 							);
|    | [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
|2093|2093| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2094|2094| 							return (
|2095|2095| 								ent != oldTarget
|2096|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2097|    |-								 || (type.specific == oldType.specific
|    |2096|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2097|+								 (type.specific == oldType.specific
|2098|2098| 								 && (type.specific != "meat" || oldTemplate == template)))
|2099|2099| 							);
|2100|2100| 						}, 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
|2094|2094| 							return (
|2095|2095| 								ent != oldTarget
|2096|2096| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2097|    |-								 || (type.specific == oldType.specific
|2098|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2097|+								 || (type.specific == oldType.specific &&
|    |2098|+								 (type.specific != "meat" || oldTemplate == template)))
|2099|2099| 							);
|2100|2100| 						}, oldTarget);
|2101|2101| 						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
|2103|2103| 							this.PerformGather(nearby, false, false);
|2104|2104| 							return true;
|2105|2105| 						}
|2106|    |-						else
|2107|    |-						{
|    |2106|+						
|2108|2107| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2109|2108| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2110|2109| 							// to order it to GatherNear the resource position.
|2125|2124| 									return true;
|2126|2125| 								}
|2127|2126| 							}
|2128|    |-						}
|    |2127|+						
|2129|2128| 						return true;
|2130|2129| 					}
|2131|2130| 					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
|2115|2115| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2116|2116| 								return true;
|2117|2117| 							}
|2118|    |-							else
|2119|    |-							{
|    |2118|+							
|2120|2119| 								// we're kind of stuck here. Return resource.
|2121|2120| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2122|2121| 								if (nearby)
|2124|2123| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2125|2124| 									return true;
|2126|2125| 								}
|2127|    |-							}
|    |2126|+							
|2128|2127| 						}
|2129|2128| 						return true;
|2130|2129| 					}
|    | [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
|2157|2157| 						// Also don't switch to a different type of huntable animal
|2158|2158| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2159|2159| 							return (
|2160|    |-								ent != oldTarget
|2161|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2160|+								ent != oldTarget &&
|    |2161|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2162|2162| 								|| (type.specific == oldType.specific
|2163|2163| 								&& (type.specific != "meat" || oldTemplate == template)))
|2164|2164| 							);
|    | [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
|2158|2158| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2159|2159| 							return (
|2160|2160| 								ent != oldTarget
|2161|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2162|    |-								|| (type.specific == oldType.specific
|    |2161|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2162|+								(type.specific == oldType.specific
|2163|2163| 								&& (type.specific != "meat" || oldTemplate == template)))
|2164|2164| 							);
|2165|2165| 						});
|    | [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
|2159|2159| 							return (
|2160|2160| 								ent != oldTarget
|2161|2161| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2162|    |-								|| (type.specific == oldType.specific
|2163|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2162|+								|| (type.specific == oldType.specific &&
|    |2163|+								(type.specific != "meat" || oldTemplate == template)))
|2164|2164| 							);
|2165|2165| 						});
|2166|2166| 						if (nearby)
|    | [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
|2204|2204| 					// Also don't switch to a different type of huntable animal
|2205|2205| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2206|2206| 						return (
|2207|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2208|    |-							|| (type.specific == resourceType.specific
|    |2207|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2208|+							(type.specific == resourceType.specific
|2209|2209| 							&& (type.specific != "meat" || resourceTemplate == template))
|2210|2210| 						);
|2211|2211| 					});
|    | [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
|2205|2205| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2206|2206| 						return (
|2207|2207| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2208|    |-							|| (type.specific == resourceType.specific
|2209|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2208|+							|| (type.specific == resourceType.specific &&
|    |2209|+							(type.specific != "meat" || resourceTemplate == template))
|2210|2210| 						);
|2211|2211| 					});
|2212|2212| 
|    | [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
|2321|2321| 
|2322|2322| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2323|2323| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2324|    |-					{
|    |2324|+					
|2325|2325| 						// Check we can still reach and gather from the target
|2326|2326| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2327|2327| 						{
|2387|2387| 								return;
|2388|2388| 							}
|2389|2389| 						}
|2390|    |-					}
|    |2390|+					
|2391|2391| 
|2392|2392| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2393|2393| 
|    | [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
|2413|2413| 					// Also don't switch to a different type of huntable animal
|2414|2414| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2415|2415| 						return (
|2416|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2417|    |-							|| (type.specific == resourceType.specific
|    |2416|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2417|+							(type.specific == resourceType.specific
|2418|2418| 							&& (type.specific != "meat" || resourceTemplate == template))
|2419|2419| 						);
|2420|2420| 					});
|    | [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
|2414|2414| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2415|2415| 						return (
|2416|2416| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2417|    |-							|| (type.specific == resourceType.specific
|2418|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2417|+							|| (type.specific == resourceType.specific &&
|    |2418|+							(type.specific != "meat" || resourceTemplate == template))
|2419|2419| 						);
|2420|2420| 					});
|2421|2421| 					if (nearby)
|    | [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
|2501|2501| 					this.StartTimer(prepare, this.healTimers.repeat);
|2502|2502| 
|2503|2503| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2504|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2504|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2505|2505| 
|2506|2506| 					this.FaceTowardsTarget(this.order.data.target);
|2507|2507| 				},
|    | [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
|2534|2534| 						}
|2535|2535| 						// Can't reach it - try to chase after it
|2536|2536| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|2537|    |-						{
|    |2537|+						
|2538|2538| 							if (this.MoveToTargetRange(target, IID_Heal))
|2539|2539| 							{
|2540|2540| 								this.SetNextState("HEAL.CHASING");
|2541|2541| 								return;
|2542|2542| 							}
|2543|    |-						}
|    |2543|+						
|2544|2544| 					}
|2545|2545| 					// Can't reach it, healed to max hp or doesn't exist any more - give up
|2546|2546| 					if (this.FinishOrder())
|    | [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
|2711|2711| 					{
|2712|2712| 						// The building was already finished/fully repaired before we arrived;
|2713|2713| 						// let the ConstructionFinished handler handle this.
|2714|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2714|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2715|2715| 						return true;
|2716|2716| 					}
|2717|2717| 
|    | [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
|2711|2711| 					{
|2712|2712| 						// The building was already finished/fully repaired before we arrived;
|2713|2713| 						// let the ConstructionFinished handler handle this.
|2714|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2714|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2715|2715| 						return true;
|2716|2716| 					}
|2717|2717| 
|    | [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
|2751|2751| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2752|2752| 						this.SetNextState("APPROACHING");
|2753|2753| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2754|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2754|+						this.FinishOrder(); // can't approach and isn't in reach
|2755|2755| 				},
|2756|2756| 			},
|2757|2757| 
|    | [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
|2838|2838| 
|2839|2839| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2840|2840| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2841|    |-				{
|    |2841|+				
|2842|2842| 					// We're already walking to the given point, so add this as a order.
|2843|2843| 					this.WalkToTarget(msg.data.newentity, true);
|2844|    |-				}
|    |2844|+				
|2845|2845| 			},
|2846|2846| 		},
|2847|2847| 
|    | [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
|2891|2891| 
|2892|2892| 					// Check that we can garrison here
|2893|2893| 					if (this.CanGarrison(target))
|2894|    |-					{
|    |2894|+					
|2895|2895| 						// Check that we're in range of the garrison target
|2896|2896| 						if (this.CheckGarrisonRange(target))
|2897|2897| 						{
|2967|2967| 								return false;
|2968|2968| 							}
|2969|2969| 						}
|2970|    |-					}
|    |2970|+					
|2971|2971| 					// Garrisoning failed for some reason, so finish the order
|2972|2972| 					this.FinishOrder();
|2973|2973| 					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
|3074|3074| 		"Attacked": function(msg) {
|3075|3075| 			if (this.template.NaturalBehaviour == "skittish" ||
|3076|3076| 			    this.template.NaturalBehaviour == "passive")
|3077|    |-			{
|    |3077|+			
|3078|3078| 				this.Flee(msg.data.attacker, false);
|3079|    |-			}
|    |3079|+			
|3080|3080| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3081|3081| 			{
|3082|3082| 				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
|3083|3083| 					this.Attack(msg.data.attacker, false);
|3084|3084| 			}
|3085|3085| 			else if (this.template.NaturalBehaviour == "domestic")
|3086|    |-			{
|    |3086|+			
|3087|3087| 				// Never flee, stop what we were doing
|3088|3088| 				this.SetNextState("IDLE");
|3089|    |-			}
|    |3089|+			
|3090|3090| 		},
|3091|3091| 
|3092|3092| 		"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
|3093|3093| 			// Move a tile outside the building
|3094|3094| 			var range = 4;
|3095|3095| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3096|    |-			{
|    |3096|+			
|3097|3097| 				// We've started walking to the given point
|3098|3098| 				this.SetNextState("WALKING");
|3099|    |-			}
|    |3099|+			
|3100|3100| 			else
|3101|3101| 			{
|3102|3102| 				// 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
|3098|3098| 				this.SetNextState("WALKING");
|3099|3099| 			}
|3100|3100| 			else
|3101|    |-			{
|    |3101|+			
|3102|3102| 				// We are already at the target, or can't move at all
|3103|3103| 				this.FinishOrder();
|3104|    |-			}
|    |3104|+			
|3105|3105| 		},
|3106|3106| 
|3107|3107| 		"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
|3140|3140| 				}
|3141|3141| 				// Start attacking one of the newly-seen enemy (if any)
|3142|3142| 				else if (this.IsDangerousAnimal())
|3143|    |-				{
|    |3143|+				
|3144|3144| 					this.AttackVisibleEntity(msg.data.added);
|3145|    |-				}
|    |3145|+				
|3146|3146| 
|3147|3147| 				// TODO: if two units enter our range together, we'll attack the
|3148|3148| 				// 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
|3183|3183| 				}
|3184|3184| 				// Start attacking one of the newly-seen enemy (if any)
|3185|3185| 				else if (this.template.NaturalBehaviour == "violent")
|3186|    |-				{
|    |3186|+				
|3187|3187| 					this.AttackVisibleEntity(msg.data.added);
|3188|    |-				}
|    |3188|+				
|3189|3189| 			},
|3190|3190| 
|3191|3191| 			"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
|3200|3200| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3201|3201| 
|3202|3202| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3203|    |-							// only used for domestic animals
|    |3203|+		// only used for domestic animals
|3204|3204| 	},
|3205|3205| };
|3206|3206| 
|    | [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
|3257|3257| 
|3258|3258| UnitAI.prototype.IsAnimal = function()
|3259|3259| {
|3260|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3260|+	return (!!this.template.NaturalBehaviour);
|3261|3261| };
|3262|3262| 
|3263|3263| 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
|3295|3295| UnitAI.prototype.GetGarrisonHolder = function()
|3296|3296| {
|3297|3297| 	if (this.IsGarrisoned())
|3298|    |-	{
|    |3298|+	
|3299|3299| 		for (let order of this.orderQueue)
|3300|3300| 			if (order.type == "Garrison")
|3301|3301| 				return order.data.target;
|3302|    |-	}
|    |3302|+	
|3303|3303| 	return INVALID_ENTITY;
|3304|3304| };
|3305|3305| 
|    | [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
|3373|3373| 		{
|3374|3374| 			let index = this.GetCurrentState().indexOf(".");
|3375|3375| 			if (index != -1)
|3376|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3376|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3377|3377| 			this.Stop(false);
|3378|3378| 		}
|3379|3379| 
|    | [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
|3429|3429| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3430|3430| 			continue;
|3431|3431| 		if (i == 0)
|3432|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3432|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3433|3433| 		else
|3434|3434| 			this.orderQueue.splice(i, 1);
|3435|3435| 		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
|3429|3429| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3430|3430| 			continue;
|3431|3431| 		if (i == 0)
|3432|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3432|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3433|3433| 		else
|3434|3434| 			this.orderQueue.splice(i, 1);
|3435|3435| 		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
|3513|3513| };
|3514|3514| 
|3515|3515| 
|3516|    |-//// FSM linkage functions ////
|    |3516|+// // FSM linkage functions ////
|3517|3517| 
|3518|3518| UnitAI.prototype.SetNextState = function(state)
|3519|3519| {
|    | [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
|3615|3615| 	{
|3616|3616| 		this.order = order;
|3617|3617| 		let ret = this.UnitFsm.ProcessMessage(this,
|3618|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3618|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3619|3619| 		);
|3620|3620| 
|3621|3621| 		// 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
|3615|3615| 	{
|3616|3616| 		this.order = order;
|3617|3617| 		let ret = this.UnitFsm.ProcessMessage(this,
|3618|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3618|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3619|3619| 		);
|3620|3620| 
|3621|3621| 		// 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
|3651|3651| 		this.orderQueue.unshift(order);
|3652|3652| 		this.order = order;
|3653|3653| 		let ret = this.UnitFsm.ProcessMessage(this,
|3654|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3654|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3655|3655| 		);
|3656|3656| 
|3657|3657| 		// 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
|3651|3651| 		this.orderQueue.unshift(order);
|3652|3652| 		this.order = order;
|3653|3653| 		let ret = this.UnitFsm.ProcessMessage(this,
|3654|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3654|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3655|3655| 		);
|3656|3656| 
|3657|3657| 		// 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
|3685|3685| 				continue;
|3686|3686| 			if (this.orderQueue[i].type == type)
|3687|3687| 				continue;
|3688|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3688|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3689|3689| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3690|3690| 			return;
|3691|3691| 		}
|    | [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
|3685|3685| 				continue;
|3686|3686| 			if (this.orderQueue[i].type == type)
|3687|3687| 				continue;
|3688|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3688|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3689|3689| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3690|3690| 			return;
|3691|3691| 		}
|    | [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
|3699|3699| {
|3700|3700| 	// Remember the previous work orders to be able to go back to them later if required
|3701|3701| 	if (data && data.force)
|3702|    |-	{
|    |3702|+	
|3703|3703| 		if (this.IsFormationController())
|3704|3704| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3705|3705| 		else
|3706|3706| 			this.UpdateWorkOrders(type);
|3707|    |-	}
|    |3707|+	
|3708|3708| 
|3709|3709| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3710|3710| 
|    | [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
|3776|3776| 	{
|3777|3777| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3778|3778| 		if (cmpUnitAI)
|3779|    |-		{
|    |3779|+		
|3780|3780| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3781|3781| 			{
|3782|3782| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3785|3785| 					return;
|3786|3786| 				}
|3787|3787| 			}
|3788|    |-		}
|    |3788|+		
|3789|3789| 	}
|3790|3790| 
|3791|3791| 	// 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
|3778|3778| 		if (cmpUnitAI)
|3779|3779| 		{
|3780|3780| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3781|    |-			{
|    |3781|+			
|3782|3782| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3783|3783| 				{
|3784|3784| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3785|3785| 					return;
|3786|3786| 				}
|3787|    |-			}
|    |3787|+			
|3788|3788| 		}
|3789|3789| 	}
|3790|3790| 
|    | [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
|3790|3790| 
|3791|3791| 	// If nothing found, take the unit orders
|3792|3792| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3793|    |-	{
|    |3793|+	
|3794|3794| 		if (isWorkType(this.orderQueue[i].type))
|3795|3795| 		{
|3796|3796| 			this.workOrders = this.orderQueue.slice(i);
|3797|3797| 			return;
|3798|3798| 		}
|3799|    |-	}
|    |3799|+	
|3800|3800| };
|3801|3801| 
|3802|3802| 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
|3856|3856| 	if (data.timerRepeat === undefined)
|3857|3857| 		this.timer = undefined;
|3858|3858| 
|3859|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3859|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3860|3860| };
|3861|3861| 
|3862|3862| /**
|    | [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
|3856|3856| 	if (data.timerRepeat === undefined)
|3857|3857| 		this.timer = undefined;
|3858|3858| 
|3859|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3859|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3860|3860| };
|3861|3861| 
|3862|3862| /**
|    | [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
|3891|3891| 	this.timer = undefined;
|3892|3892| };
|3893|3893| 
|3894|    |-//// Message handlers /////
|    |3894|+// // Message handlers /////
|3895|3895| 
|3896|3896| UnitAI.prototype.OnMotionChanged = function(msg)
|3897|3897| {
|    | [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
|3896|3896| UnitAI.prototype.OnMotionChanged = function(msg)
|3897|3897| {
|3898|3898| 	if (msg.starting && !msg.error)
|3899|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3899|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3900|3900| 	else if (!msg.starting || msg.error)
|3901|3901| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3902|3902| };
|    | [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
|3896|3896| UnitAI.prototype.OnMotionChanged = function(msg)
|3897|3897| {
|3898|3898| 	if (msg.starting && !msg.error)
|3899|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3899|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3900|3900| 	else if (!msg.starting || msg.error)
|3901|3901| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3902|3902| };
|    | [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
|3898|3898| 	if (msg.starting && !msg.error)
|3899|3899| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3900|3900| 	else if (!msg.starting || msg.error)
|3901|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3901|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3902|3902| };
|3903|3903| 
|3904|3904| 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
|3898|3898| 	if (msg.starting && !msg.error)
|3899|3899| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3900|3900| 	else if (!msg.starting || msg.error)
|3901|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3901|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3902|3902| };
|3903|3903| 
|3904|3904| 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
|3906|3906| 	// TODO: This is a bit inefficient since every unit listens to every
|3907|3907| 	// construction message - ideally we could scope it to only the one we're building
|3908|3908| 
|3909|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3909|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3910|3910| };
|3911|3911| 
|3912|3912| 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
|3906|3906| 	// TODO: This is a bit inefficient since every unit listens to every
|3907|3907| 	// construction message - ideally we could scope it to only the one we're building
|3908|3908| 
|3909|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3909|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3910|3910| };
|3911|3911| 
|3912|3912| 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
|3931|3931| 
|3932|3932| UnitAI.prototype.OnAttacked = function(msg)
|3933|3933| {
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3931|3931| 
|3932|3932| UnitAI.prototype.OnAttacked = function(msg)
|3933|3933| {
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3936|3936| 
|3937|3937| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3938|3938| {
|3939|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3939|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3940|3940| };
|3941|3941| 
|3942|3942| 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
|3936|3936| 
|3937|3937| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3938|3938| {
|3939|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3939|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3940|3940| };
|3941|3941| 
|3942|3942| 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
|3941|3941| 
|3942|3942| UnitAI.prototype.OnHealthChanged = function(msg)
|3943|3943| {
|3944|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3944|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3945|3945| };
|3946|3946| 
|3947|3947| 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
|3941|3941| 
|3942|3942| UnitAI.prototype.OnHealthChanged = function(msg)
|3943|3943| {
|3944|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3944|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3945|3945| };
|3946|3946| 
|3947|3947| 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
|3947|3947| UnitAI.prototype.OnRangeUpdate = function(msg)
|3948|3948| {
|3949|3949| 	if (msg.tag == this.losRangeQuery)
|3950|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3950|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3951|3951| 	else if (msg.tag == this.losHealRangeQuery)
|3952|3952| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3953|3953| };
|    | [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
|3947|3947| UnitAI.prototype.OnRangeUpdate = function(msg)
|3948|3948| {
|3949|3949| 	if (msg.tag == this.losRangeQuery)
|3950|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3950|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3951|3951| 	else if (msg.tag == this.losHealRangeQuery)
|3952|3952| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3953|3953| };
|    | [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| 	if (msg.tag == this.losRangeQuery)
|3950|3950| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3951|3951| 	else if (msg.tag == this.losHealRangeQuery)
|3952|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3952|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3949|3949| 	if (msg.tag == this.losRangeQuery)
|3950|3950| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3951|3951| 	else if (msg.tag == this.losHealRangeQuery)
|3952|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3952|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3954|3954| 
|3955|3955| UnitAI.prototype.OnPackFinished = function(msg)
|3956|3956| {
|3957|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3957|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3958|3958| };
|3959|3959| 
|3960|3960| //// 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
|3954|3954| 
|3955|3955| UnitAI.prototype.OnPackFinished = function(msg)
|3956|3956| {
|3957|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3957|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3958|3958| };
|3959|3959| 
|3960|3960| //// 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
|3957|3957| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3958|3958| };
|3959|3959| 
|3960|    |-//// Helper functions to be called by the FSM ////
|    |3960|+// // Helper functions to be called by the FSM ////
|3961|3961| 
|3962|3962| UnitAI.prototype.GetWalkSpeed = function()
|3963|3963| {
|    | [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
|4061|4061| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4062|4062| 		return undefined;
|4063|4063| 
|4064|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4064|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4065|4065| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4066|4066| 		return undefined;
|4067|4067| 
|    | [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
|4146|4146| 			PlaySound(name, member);
|4147|4147| 	}
|4148|4148| 	else
|4149|    |-	{
|    |4149|+	
|4150|4150| 		// Otherwise use our own sounds
|4151|4151| 		PlaySound(name, this.entity);
|4152|    |-	}
|    |4152|+	
|4153|4153| };
|4154|4154| 
|4155|4155| /*
|    | [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
|4315|4315| 	else
|4316|4316| 		// return false? Or hope you come close enough?
|4317|4317| 		var parabolicMaxRange = 0;
|4318|    |-		//return false;
|    |4318|+		// return false;
|4319|4319| 
|4320|4320| 	// the parabole changes while walking, take something in the middle
|4321|4321| 	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
|4380|4380| 	if (this.IsFormationMember())
|4381|4381| 	{
|4382|4382| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4383|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4384|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4383|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4384|+			cmpFormationUnitAI.order.data.target == target)
|4385|4385| 			return true;
|4386|4386| 	}
|4387|4387| 
|    | [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
|4548|4548| UnitAI.prototype.AttackEntityInZone = function(ents)
|4549|4549| {
|4550|4550| 	var target = ents.find(target =>
|4551|    |-		this.CanAttack(target)
|4552|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4551|+		this.CanAttack(target) &&
|    |4552|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4553|4553| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4554|4554| 	);
|4555|4555| 	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
|4549|4549| {
|4550|4550| 	var target = ents.find(target =>
|4551|4551| 		this.CanAttack(target)
|4552|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4553|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4552|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4553|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4554|4554| 	);
|4555|4555| 	if (!target)
|4556|4556| 		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
|4613|4613| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4614|4614| 	if (this.isGuardOf)
|4615|4615| 	{
|4616|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4616|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4617|4617| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4618|4618| 		if (cmpUnitAI && cmpAttack &&
|4619|4619| 		    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
|4617|4617| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4618|4618| 		if (cmpUnitAI && cmpAttack &&
|4619|4619| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4620|    |-				return false;
|    |4620|+			return false;
|4621|4621| 	}
|4622|4622| 
|4623|4623| 	// 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
|4622|4622| 
|4623|4623| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4624|4624| 	if (this.GetStance().respondHoldGround)
|4625|    |-	{
|    |4625|+	
|4626|4626| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4627|4627| 			return true;
|4628|    |-	}
|    |4628|+	
|4629|4629| 
|4630|4630| 	// Stop if it's left our vision range, unless we're especially persistent
|4631|4631| 	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
|4629|4629| 
|4630|4630| 	// Stop if it's left our vision range, unless we're especially persistent
|4631|4631| 	if (!this.GetStance().respondChaseBeyondVision)
|4632|    |-	{
|    |4632|+	
|4633|4633| 		if (!this.CheckTargetIsInVisionRange(target))
|4634|4634| 			return true;
|4635|    |-	}
|    |4635|+	
|4636|4636| 
|4637|4637| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4638|4638| 	// 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
|4655|4655| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4656|4656| 	if (this.isGuardOf)
|4657|4657| 	{
|4658|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4658|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4659|4659| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4660|4660| 		if (cmpUnitAI && cmpAttack &&
|4661|4661| 		    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
|4668|4668| 	return false;
|4669|4669| };
|4670|4670| 
|4671|    |-//// External interface functions ////
|    |4671|+// // External interface functions ////
|4672|4672| 
|4673|4673| UnitAI.prototype.SetFormationController = function(ent)
|4674|4674| {
|    | [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
|4678|4678| 	// of our own formation (or ourself if not in formation)
|4679|4679| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4680|4680| 	if (cmpObstruction)
|4681|    |-	{
|    |4681|+	
|4682|4682| 		if (ent == INVALID_ENTITY)
|4683|4683| 			cmpObstruction.SetControlGroup(this.entity);
|4684|4684| 		else
|4685|4685| 			cmpObstruction.SetControlGroup(ent);
|4686|    |-	}
|    |4686|+	
|4687|4687| 
|4688|4688| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4689|4689| 	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
|4821|4821| 	// if we already had an old guard order, do nothing if the target is the same
|4822|4822| 	// and the order is running, otherwise remove the previous order
|4823|4823| 	if (this.isGuardOf)
|4824|    |-	{
|    |4824|+	
|4825|4825| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4826|4826| 			return;
|4827|4827| 		else
|4828|4828| 			this.RemoveGuard();
|4829|    |-	}
|    |4829|+	
|4830|4830| 
|4831|4831| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4832|4832| };
|    | [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
|4824|4824| 	{
|4825|4825| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4826|4826| 			return;
|4827|    |-		else
|4828|    |-			this.RemoveGuard();
|    |4827|+		this.RemoveGuard();
|4829|4828| 	}
|4830|4829| 
|4831|4830| 	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
|4866|4866| 		return;
|4867|4867| 
|4868|4868| 	if (this.order.type == "Guard")
|4869|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4869|+		this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"});
|4870|4870| 	else
|4871|4871| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4872|4872| 			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
|4866|4866| 		return;
|4867|4867| 
|4868|4868| 	if (this.order.type == "Guard")
|4869|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4869|+		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" });
|4870|4870| 	else
|4871|4871| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4872|4872| 			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
|4995|4995| 			this.WalkToTarget(target, queued);
|4996|4996| 		return;
|4997|4997| 	}
|4998|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4998|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4999|4999| };
|5000|5000| 
|5001|5001| /**
|    | [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
|5144|5144| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5145|5145| 	{
|5146|5146| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5147|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5147|+		if (cmpTrader.HasBothMarkets() &&
|5148|5148| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5149|5149| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5150|5150| 		{
|    | [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
|5425|5425| 				{
|5426|5426| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5427|5427| 					var targetClasses = this.order.data.targetClasses;
|5428|    |-					if (targetClasses.attack && cmpIdentity
|5429|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5428|+					if (targetClasses.attack && cmpIdentity &&
|    |5429|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5430|5430| 						continue;
|5431|5431| 					if (targetClasses.avoid && cmpIdentity
|5432|5432| 						&& 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
|5428|5428| 					if (targetClasses.attack && cmpIdentity
|5429|5429| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5430|5430| 						continue;
|5431|    |-					if (targetClasses.avoid && cmpIdentity
|5432|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5431|+					if (targetClasses.avoid && cmpIdentity &&
|    |5432|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5433|5433| 						continue;
|5434|5434| 					// Only used by the AIs to prevent some choices of targets
|5435|5435| 					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
|5451|5451| 		{
|5452|5452| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5453|5453| 			var targetClasses = this.order.data.targetClasses;
|5454|    |-			if (cmpIdentity && targetClasses.attack
|5455|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5454|+			if (cmpIdentity && targetClasses.attack &&
|    |5455|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5456|5456| 				continue;
|5457|5457| 			if (cmpIdentity && targetClasses.avoid
|5458|5458| 				&& 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
|5454|5454| 			if (cmpIdentity && targetClasses.attack
|5455|5455| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5456|5456| 				continue;
|5457|    |-			if (cmpIdentity && targetClasses.avoid
|5458|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5457|+			if (cmpIdentity && targetClasses.avoid &&
|    |5458|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5459|5459| 				continue;
|5460|5460| 			// Only used by the AIs to prevent some choices of targets
|5461|5461| 			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
|5587|5587| 
|5588|5588| UnitAI.prototype.SetHeldPosition = function(x, z)
|5589|5589| {
|5590|    |-	this.heldPosition = {"x": x, "z": z};
|    |5590|+	this.heldPosition = { "x": x, "z": z};
|5591|5591| };
|5592|5592| 
|5593|5593| 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
|5587|5587| 
|5588|5588| UnitAI.prototype.SetHeldPosition = function(x, z)
|5589|5589| {
|5590|    |-	this.heldPosition = {"x": x, "z": z};
|    |5590|+	this.heldPosition = {"x": x, "z": z };
|5591|5591| };
|5592|5592| 
|5593|5593| 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
|5614|5614| 	return false;
|5615|5615| };
|5616|5616| 
|5617|    |-//// Helper functions ////
|    |5617|+// // Helper functions ////
|5618|5618| 
|5619|5619| UnitAI.prototype.CanAttack = function(target)
|5620|5620| {
|    | [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
|5818|5818| 	return cmpPack && cmpPack.IsPacking();
|5819|5819| };
|5820|5820| 
|5821|    |-//// Formation specific functions ////
|    |5821|+// // Formation specific functions ////
|5822|5822| 
|5823|5823| UnitAI.prototype.IsAttackingAsFormation = function()
|5824|5824| {
|    | [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
|5823|5823| UnitAI.prototype.IsAttackingAsFormation = function()
|5824|5824| {
|5825|5825| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5826|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5827|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5826|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5827|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5828|5828| };
|5829|5829| 
|5830|5830| //// 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
|5827|5827| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5828|5828| };
|5829|5829| 
|5830|    |-//// Animal specific functions ////
|    |5830|+// // Animal specific functions ////
|5831|5831| 
|5832|5832| UnitAI.prototype.MoveRandomly = function(distance)
|5833|5833| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2403| »   »   »   »   »   »   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
|3761| »   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
|4535| »   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
|4550| »   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
|4596| »   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
|4619| »   »   ····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
|5075| »   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
| 365| »   »   ····&&·(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
|1876| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2012| »   »   »   »   »   »   &&·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
|2096| »   »   »   »   »   »   »   »   ·&&·((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
|2097| »   »   »   »   »   »   »   »   ·||·(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
|2098| »   »   »   »   »   »   »   »   ·&&·(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
|2121| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2161| »   »   »   »   »   »   »   »   &&·((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
|2162| »   »   »   »   »   »   »   »   ||·(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
|2163| »   »   »   »   »   »   »   »   &&·(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
|2208| »   »   »   »   »   »   »   ||·(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
|2209| »   »   »   »   »   »   »   &&·(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
|2225| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2417| »   »   »   »   »   »   »   ||·(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
|2418| »   »   »   »   »   »   »   &&·(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
|2438| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4328| »   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
|4384| »   »   »   &&·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
|4552| »   »   &&·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
|4553| »   »   &&·(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
|5075| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

binaries/data/mods/public/simulation/components/UnitAI.js
|5429| »   »   »   »   »   »   &&·!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
|5432| »   »   »   »   »   »   &&·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
|5445| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5455| »   »   »   »   &&·!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
|5458| »   »   »   »   &&·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
|5533| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5544| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [MAJOR] JSHintBear:
|    | Too many errors. (93% scanned).

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

temple added a comment.Apr 9 2018, 2:54 AM

GetClosestMember appears four times in UnitAI, only once with a filter. So probably we should use the filter in each of those, or maybe call it GetClosestAttackableMember or something and do it in Formation rather than passing the filter.

In D1423#58551, @elexis wrote:
  • There are two formation controllers at two points in the replay

The first one is normal: twin formations, when units are too far apart to line up in the same formation they'll instead group together where they are and then combine to form a big formation once the groups get close enough to each other.

The second one you selected all but one of the units and told them to attack, and they formed a new formation. (Well, you didn't actually do this, since the replay is from svn rather than the patch, and a unit died there but didn't die here.) The remaining member stayed in the old formation by himself (we have a minimum member count when creating a formation, but nothing when units are removed, so you can have a formation with only one member).

temple updated this revision to Diff 6359.Apr 9 2018, 2:59 AM

fix test

Vulcan added a comment.Apr 9 2018, 3:01 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/FormationAttack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|  17|  17| 
|  18|  18| FormationAttack.prototype.GetRange = function(target)
|  19|  19| {
|  20|    |-	var result = {"min": 0, "max": this.canAttackAsFormation ? -1 : 0};
|    |  20|+	var result = { "min": 0, "max": this.canAttackAsFormation ? -1 : 0};
|  21|  21| 	var cmpFormation = Engine.QueryInterface(this.entity, IID_Formation);
|  22|  22| 	if (!cmpFormation)
|  23|  23| 	{
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|  17|  17| 
|  18|  18| FormationAttack.prototype.GetRange = function(target)
|  19|  19| {
|  20|    |-	var result = {"min": 0, "max": this.canAttackAsFormation ? -1 : 0};
|    |  20|+	var result = {"min": 0, "max": this.canAttackAsFormation ? -1 : 0 };
|  21|  21| 	var cmpFormation = Engine.QueryInterface(this.entity, IID_Formation);
|  22|  22| 	if (!cmpFormation)
|  23|  23| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/FormationAttack.js
|  46|  46| 				result.max = range.max;
|  47|  47| 		}
|  48|  48| 		else
|  49|    |-		{
|    |  49|+		
|  50|  50| 			if (range.max > result.max || range.max < 0)
|  51|  51| 				result.max = range.max;
|  52|    |-		}
|    |  52|+		
|  53|  53| 		if (range.min < result.min)
|  54|  54| 			result.min = range.min;
|  55|  55| 	}
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetInterval' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  34|  34| 
|  35|  35| 
|  36|  36| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
|  37|    |-		SetInterval: function() { },
|    |  37|+		"SetInterval": function() { },
|  38|  38| 		SetTimeout: function() { },
|  39|  39| 	});
|  40|  40| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetTimeout' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  35|  35| 
|  36|  36| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
|  37|  37| 		SetInterval: function() { },
|  38|    |-		SetTimeout: function() { },
|    |  38|+		"SetTimeout": function() { },
|  39|  39| 	});
|  40|  40| 
|  41|  41| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CreateActiveQuery' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  39|  39| 	});
|  40|  40| 
|  41|  41| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
|  42|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    |  42|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'EnableActiveQuery' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  42|  42| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|    |-		EnableActiveQuery: function(id) { },
|    |  45|+		"EnableActiveQuery": function(id) { },
|  46|  46| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'ResetActiveQuery' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  46|+		"ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|  49|  49| 	});
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  46|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|  49|  49| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'DisableActiveQuery' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|  46| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  47|    |-		DisableActiveQuery: function(id) { },
|    |  47|+		"DisableActiveQuery": function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|  49|  49| 	});
|  50|  50| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEntityFlagMask' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|  46| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|    |-		GetEntityFlagMask: function(identifier) { },
|    |  48|+		"GetEntityFlagMask": function(identifier) { },
|  49|  49| 	});
|  50|  50| 
|  51|  51| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetCurrentTemplateName' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  49|  49| 	});
|  50|  50| 
|  51|  51| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|  52|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    |  52|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
|  53|  53| 	});
|  54|  54| 
|  55|  55| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPlayerByID' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  53|  53| 	});
|  54|  54| 
|  55|  55| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|  56|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    |  56|+		"GetPlayerByID": function(id) { return playerEntity; },
|  57|  57| 		GetNumPlayers: function() { return 2; },
|  58|  58| 	});
|  59|  59| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetNumPlayers' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  54|  54| 
|  55|  55| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|  56|  56| 		GetPlayerByID: function(id) { return playerEntity; },
|  57|    |-		GetNumPlayers: function() { return 2; },
|    |  57|+		"GetNumPlayers": function() { return 2; },
|  58|  58| 	});
|  59|  59| 
|  60|  60| 	AddMock(playerEntity, IID_Player, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAlly' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  58|  58| 	});
|  59|  59| 
|  60|  60| 	AddMock(playerEntity, IID_Player, {
|  61|    |-		IsAlly: function() { return false; },
|    |  61|+		"IsAlly": function() { return false; },
|  62|  62| 		IsEnemy: function() { return true; },
|  63|  63| 		GetEnemies: function() { return []; },
|  64|  64| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsEnemy' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  59|  59| 
|  60|  60| 	AddMock(playerEntity, IID_Player, {
|  61|  61| 		IsAlly: function() { return false; },
|  62|    |-		IsEnemy: function() { return true; },
|    |  62|+		"IsEnemy": function() { return true; },
|  63|  63| 		GetEnemies: function() { return []; },
|  64|  64| 	});
|  65|  65| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  60|  60| 	AddMock(playerEntity, IID_Player, {
|  61|  61| 		IsAlly: function() { return false; },
|  62|  62| 		IsEnemy: function() { return true; },
|  63|    |-		GetEnemies: function() { return []; },
|    |  63|+		"GetEnemies": function() { return []; },
|  64|  64| 	});
|  65|  65| 
|  66|  66| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetClassesList' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  67|  67| 	var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
|  68|  68| 
|  69|  69| 	AddMock(unit, IID_Identity, {
|  70|    |-		GetClassesList: function() { return []; },
|    |  70|+		"GetClassesList": function() { return []; },
|  71|  71| 	});
|  72|  72| 
|  73|  73| 	AddMock(unit, IID_Ownership, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetOwner' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  71|  71| 	});
|  72|  72| 
|  73|  73| 	AddMock(unit, IID_Ownership, {
|  74|    |-		GetOwner: function() { return 1; },
|    |  74|+		"GetOwner": function() { return 1; },
|  75|  75| 	});
|  76|  76| 
|  77|  77| 	AddMock(unit, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  75|  75| 	});
|  76|  76| 
|  77|  77| 	AddMock(unit, IID_Position, {
|  78|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    |  78|+		"GetTurretParent": function() { return INVALID_ENTITY; },
|  79|  79| 		GetPosition: function() { return new Vector3D(); },
|  80|  80| 		GetPosition2D: function() { return new Vector2D(); },
|  81|  81| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  76|  76| 
|  77|  77| 	AddMock(unit, IID_Position, {
|  78|  78| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  79|    |-		GetPosition: function() { return new Vector3D(); },
|    |  79|+		"GetPosition": function() { return new Vector3D(); },
|  80|  80| 		GetPosition2D: function() { return new Vector2D(); },
|  81|  81| 		GetRotation: function() { return { "y": 0 }; },
|  82|  82| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  77|  77| 	AddMock(unit, IID_Position, {
|  78|  78| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  79|  79| 		GetPosition: function() { return new Vector3D(); },
|  80|    |-		GetPosition2D: function() { return new Vector2D(); },
|    |  80|+		"GetPosition2D": function() { return new Vector2D(); },
|  81|  81| 		GetRotation: function() { return { "y": 0 }; },
|  82|  82| 		IsInWorld: function() { return true; },
|  83|  83| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  78|  78| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  79|  79| 		GetPosition: function() { return new Vector3D(); },
|  80|  80| 		GetPosition2D: function() { return new Vector2D(); },
|  81|    |-		GetRotation: function() { return { "y": 0 }; },
|    |  81|+		"GetRotation": function() { return { "y": 0 }; },
|  82|  82| 		IsInWorld: function() { return true; },
|  83|  83| 	});
|  84|  84| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  79|  79| 		GetPosition: function() { return new Vector3D(); },
|  80|  80| 		GetPosition2D: function() { return new Vector2D(); },
|  81|  81| 		GetRotation: function() { return { "y": 0 }; },
|  82|    |-		IsInWorld: function() { return true; },
|    |  82|+		"IsInWorld": function() { return true; },
|  83|  83| 	});
|  84|  84| 
|  85|  85| 	AddMock(unit, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetWalkSpeed' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  83|  83| 	});
|  84|  84| 
|  85|  85| 	AddMock(unit, IID_UnitMotion, {
|  86|    |-		GetWalkSpeed: function() { return 1; },
|    |  86|+		"GetWalkSpeed": function() { return 1; },
|  87|  87| 		MoveToFormationOffset: function(target, x, z) { },
|  88|  88| 		IsInTargetRange: function(target, min, max) { return true; },
|  89|  89| 		MoveToTargetRange: function(target, min, max) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'MoveToFormationOffset' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  84|  84| 
|  85|  85| 	AddMock(unit, IID_UnitMotion, {
|  86|  86| 		GetWalkSpeed: function() { return 1; },
|  87|    |-		MoveToFormationOffset: function(target, x, z) { },
|    |  87|+		"MoveToFormationOffset": function(target, x, z) { },
|  88|  88| 		IsInTargetRange: function(target, min, max) { return true; },
|  89|  89| 		MoveToTargetRange: function(target, min, max) { },
|  90|  90| 		StopMoving: function() { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInTargetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  85|  85| 	AddMock(unit, IID_UnitMotion, {
|  86|  86| 		GetWalkSpeed: function() { return 1; },
|  87|  87| 		MoveToFormationOffset: function(target, x, z) { },
|  88|    |-		IsInTargetRange: function(target, min, max) { return true; },
|    |  88|+		"IsInTargetRange": function(target, min, max) { return true; },
|  89|  89| 		MoveToTargetRange: function(target, min, max) { },
|  90|  90| 		StopMoving: function() { },
|  91|  91| 		GetPassabilityClassName: function() { return "default"; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'MoveToTargetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  86|  86| 		GetWalkSpeed: function() { return 1; },
|  87|  87| 		MoveToFormationOffset: function(target, x, z) { },
|  88|  88| 		IsInTargetRange: function(target, min, max) { return true; },
|  89|    |-		MoveToTargetRange: function(target, min, max) { },
|    |  89|+		"MoveToTargetRange": function(target, min, max) { },
|  90|  90| 		StopMoving: function() { },
|  91|  91| 		GetPassabilityClassName: function() { return "default"; },
|  92|  92| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'StopMoving' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  87|  87| 		MoveToFormationOffset: function(target, x, z) { },
|  88|  88| 		IsInTargetRange: function(target, min, max) { return true; },
|  89|  89| 		MoveToTargetRange: function(target, min, max) { },
|  90|    |-		StopMoving: function() { },
|    |  90|+		"StopMoving": function() { },
|  91|  91| 		GetPassabilityClassName: function() { return "default"; },
|  92|  92| 	});
|  93|  93| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPassabilityClassName' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  88|  88| 		IsInTargetRange: function(target, min, max) { return true; },
|  89|  89| 		MoveToTargetRange: function(target, min, max) { },
|  90|  90| 		StopMoving: function() { },
|  91|    |-		GetPassabilityClassName: function() { return "default"; },
|    |  91|+		"GetPassabilityClassName": function() { return "default"; },
|  92|  92| 	});
|  93|  93| 
|  94|  94| 	AddMock(unit, IID_Vision, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  92|  92| 	});
|  93|  93| 
|  94|  94| 	AddMock(unit, IID_Vision, {
|  95|    |-		GetRange: function() { return 10; },
|    |  95|+		"GetRange": function() { return 10; },
|  96|  96| 	});
|  97|  97| 
|  98|  98| 	AddMock(unit, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  96|  96| 	});
|  97|  97| 
|  98|  98| 	AddMock(unit, IID_Attack, {
|  99|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    |  99|+		"GetRange": function() { return { "max": 10, "min": 0}; },
| 100| 100| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 101| 101| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 102| 102| 		GetPreference: function(t) { return 0; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  96|  96| 	});
|  97|  97| 
|  98|  98| 	AddMock(unit, IID_Attack, {
|  99|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    |  99|+		GetRange: function() { return { "max": 10, "min": 0 }; },
| 100| 100| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 101| 101| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 102| 102| 		GetPreference: function(t) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetFullAttackRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  97|  97| 
|  98|  98| 	AddMock(unit, IID_Attack, {
|  99|  99| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 100|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 100|+		"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 101| 101| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 102| 102| 		GetPreference: function(t) { return 0; },
| 103| 103| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  97|  97| 
|  98|  98| 	AddMock(unit, IID_Attack, {
|  99|  99| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 100|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 100|+		GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 101| 101| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 102| 102| 		GetPreference: function(t) { return 0; },
| 103| 103| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetBestAttackAgainst' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  98|  98| 	AddMock(unit, IID_Attack, {
|  99|  99| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 100| 100| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 101|    |-		GetBestAttackAgainst: function(t) { return "melee"; },
|    | 101|+		"GetBestAttackAgainst": function(t) { return "melee"; },
| 102| 102| 		GetPreference: function(t) { return 0; },
| 103| 103| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 104| 104| 		CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPreference' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  99|  99| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 100| 100| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 101| 101| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 102|    |-		GetPreference: function(t) { return 0; },
|    | 102|+		"GetPreference": function(t) { return 0; },
| 103| 103| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 104| 104| 		CanAttack: function(v) { return true; },
| 105| 105| 		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTimers' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 100| 100| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 101| 101| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 102| 102| 		GetPreference: function(t) { return 0; },
| 103|    |-		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 103|+		"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 104| 104| 		CanAttack: function(v) { return true; },
| 105| 105| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 106| 106| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttack' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 101| 101| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 102| 102| 		GetPreference: function(t) { return 0; },
| 103| 103| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 104|    |-		CanAttack: function(v) { return true; },
|    | 104|+		"CanAttack": function(v) { return true; },
| 105| 105| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 106| 106| 	});
| 107| 107| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CompareEntitiesByPreference' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 102| 102| 		GetPreference: function(t) { return 0; },
| 103| 103| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 104| 104| 		CanAttack: function(v) { return true; },
| 105|    |-		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 105|+		"CompareEntitiesByPreference": function(a, b) { return 0; },
| 106| 106| 	});
| 107| 107| 
| 108| 108| 	unitAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 113| 113| 	if (mode == 1)
| 114| 114| 	{
| 115| 115| 		AddMock(enemy, IID_Health, {
| 116|    |-			GetHitpoints: function() { return 10; },
|    | 116|+			"GetHitpoints": function() { return 10; },
| 117| 117| 		});
| 118| 118| 		AddMock(enemy, IID_UnitAI, {
| 119| 119| 			IsAnimal: function() { return false; }
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAnimal' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 116| 116| 			GetHitpoints: function() { return 10; },
| 117| 117| 		});
| 118| 118| 		AddMock(enemy, IID_UnitAI, {
| 119|    |-			IsAnimal: function() { return false; }
|    | 119|+			"IsAnimal": function() { return false; }
| 120| 120| 		});
| 121| 121| 	}
| 122| 122| 	else if (mode == 2)
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 121| 121| 	}
| 122| 122| 	else if (mode == 2)
| 123| 123| 		AddMock(enemy, IID_Health, {
| 124|    |-			GetHitpoints: function() { return 0; },
|    | 124|+			"GetHitpoints": function() { return 0; },
| 125| 125| 		});
| 126| 126| 
| 127| 127| 	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 124| 124| 			GetHitpoints: function() { return 0; },
| 125| 125| 		});
| 126| 126| 
| 127|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 127|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 128| 128| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 129| 129| 
| 130| 130| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 124| 124| 			GetHitpoints: function() { return 0; },
| 125| 125| 		});
| 126| 126| 
| 127|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 127|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 128| 128| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 129| 129| 
| 130| 130| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'JumpTo' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 128| 128| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 129| 129| 
| 130| 130| 	AddMock(controller, IID_Position, {
| 131|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 131|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 132| 132| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 133| 133| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 134| 134| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 129| 129| 
| 130| 130| 	AddMock(controller, IID_Position, {
| 131| 131| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 132|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 132|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 133| 133| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 134| 134| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 135| 135| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 130| 130| 	AddMock(controller, IID_Position, {
| 131| 131| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 132| 132| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 133|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 133|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 134| 134| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 135| 135| 		GetRotation: function() { return { "y": 0 }; },
| 136| 136| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 131| 131| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 132| 132| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 133| 133| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 134|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 134|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 135| 135| 		GetRotation: function() { return { "y": 0 }; },
| 136| 136| 		IsInWorld: function() { return true; },
| 137| 137| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 132| 132| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 133| 133| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 134| 134| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 135|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 135|+		"GetRotation": function() { return { "y": 0 }; },
| 136| 136| 		IsInWorld: function() { return true; },
| 137| 137| 	});
| 138| 138| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 133| 133| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 134| 134| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 135| 135| 		GetRotation: function() { return { "y": 0 }; },
| 136|    |-		IsInWorld: function() { return true; },
|    | 136|+		"IsInWorld": function() { return true; },
| 137| 137| 	});
| 138| 138| 
| 139| 139| 	AddMock(controller, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetSpeed' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 137| 137| 	});
| 138| 138| 
| 139| 139| 	AddMock(controller, IID_UnitMotion, {
| 140|    |-		SetSpeed: function(speed) { },
|    | 140|+		"SetSpeed": function(speed) { },
| 141| 141| 		MoveToPointRange: function(x, z, minRange, maxRange) { },
| 142| 142| 		GetPassabilityClassName: function() { return "default"; },
| 143| 143| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'MoveToPointRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 138| 138| 
| 139| 139| 	AddMock(controller, IID_UnitMotion, {
| 140| 140| 		SetSpeed: function(speed) { },
| 141|    |-		MoveToPointRange: function(x, z, minRange, maxRange) { },
|    | 141|+		"MoveToPointRange": function(x, z, minRange, maxRange) { },
| 142| 142| 		GetPassabilityClassName: function() { return "default"; },
| 143| 143| 	});
| 144| 144| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPassabilityClassName' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 139| 139| 	AddMock(controller, IID_UnitMotion, {
| 140| 140| 		SetSpeed: function(speed) { },
| 141| 141| 		MoveToPointRange: function(x, z, minRange, maxRange) { },
| 142|    |-		GetPassabilityClassName: function() { return "default"; },
|    | 142|+		"GetPassabilityClassName": function() { return "default"; },
| 143| 143| 	});
| 144| 144| 
| 145| 145| 	controllerAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetInterval' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 180| 180| 	var unitAIs = [];
| 181| 181| 
| 182| 182| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 183|    |-		SetInterval: function() { },
|    | 183|+		"SetInterval": function() { },
| 184| 184| 		SetTimeout: function() { },
| 185| 185| 	});
| 186| 186| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetTimeout' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 181| 181| 
| 182| 182| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 183| 183| 		SetInterval: function() { },
| 184|    |-		SetTimeout: function() { },
|    | 184|+		"SetTimeout": function() { },
| 185| 185| 	});
| 186| 186| 
| 187| 187| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CreateActiveQuery' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 186| 186| 
| 187| 187| 
| 188| 188| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 189|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 189|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 190| 190| 			return 1;
| 191| 191| 		},
| 192| 192| 		EnableActiveQuery: function(id) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'EnableActiveQuery' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 189| 189| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 190| 190| 			return 1;
| 191| 191| 		},
| 192|    |-		EnableActiveQuery: function(id) { },
|    | 192|+		"EnableActiveQuery": function(id) { },
| 193| 193| 		ResetActiveQuery: function(id) { return [enemy]; },
| 194| 194| 		DisableActiveQuery: function(id) { },
| 195| 195| 		GetEntityFlagMask: function(identifier) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'ResetActiveQuery' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 190| 190| 			return 1;
| 191| 191| 		},
| 192| 192| 		EnableActiveQuery: function(id) { },
| 193|    |-		ResetActiveQuery: function(id) { return [enemy]; },
|    | 193|+		"ResetActiveQuery": function(id) { return [enemy]; },
| 194| 194| 		DisableActiveQuery: function(id) { },
| 195| 195| 		GetEntityFlagMask: function(identifier) { },
| 196| 196| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'DisableActiveQuery' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 191| 191| 		},
| 192| 192| 		EnableActiveQuery: function(id) { },
| 193| 193| 		ResetActiveQuery: function(id) { return [enemy]; },
| 194|    |-		DisableActiveQuery: function(id) { },
|    | 194|+		"DisableActiveQuery": function(id) { },
| 195| 195| 		GetEntityFlagMask: function(identifier) { },
| 196| 196| 	});
| 197| 197| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEntityFlagMask' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 192| 192| 		EnableActiveQuery: function(id) { },
| 193| 193| 		ResetActiveQuery: function(id) { return [enemy]; },
| 194| 194| 		DisableActiveQuery: function(id) { },
| 195|    |-		GetEntityFlagMask: function(identifier) { },
|    | 195|+		"GetEntityFlagMask": function(identifier) { },
| 196| 196| 	});
| 197| 197| 
| 198| 198| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetCurrentTemplateName' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 196| 196| 	});
| 197| 197| 
| 198| 198| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 199|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 199|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 200| 200| 	});
| 201| 201| 
| 202| 202| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPlayerByID' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 200| 200| 	});
| 201| 201| 
| 202| 202| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 203|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 203|+		"GetPlayerByID": function(id) { return playerEntity; },
| 204| 204| 		GetNumPlayers: function() { return 2; },
| 205| 205| 	});
| 206| 206| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetNumPlayers' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 201| 201| 
| 202| 202| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 203| 203| 		GetPlayerByID: function(id) { return playerEntity; },
| 204|    |-		GetNumPlayers: function() { return 2; },
|    | 204|+		"GetNumPlayers": function() { return 2; },
| 205| 205| 	});
| 206| 206| 
| 207| 207| 	AddMock(playerEntity, IID_Player, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAlly' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 205| 205| 	});
| 206| 206| 
| 207| 207| 	AddMock(playerEntity, IID_Player, {
| 208|    |-		IsAlly: function() { return false; },
|    | 208|+		"IsAlly": function() { return false; },
| 209| 209| 		IsEnemy: function() { return true; },
| 210| 210| 		GetEnemies: function() { return []; },
| 211| 211| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsEnemy' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 206| 206| 
| 207| 207| 	AddMock(playerEntity, IID_Player, {
| 208| 208| 		IsAlly: function() { return false; },
| 209|    |-		IsEnemy: function() { return true; },
|    | 209|+		"IsEnemy": function() { return true; },
| 210| 210| 		GetEnemies: function() { return []; },
| 211| 211| 	});
| 212| 212| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 207| 207| 	AddMock(playerEntity, IID_Player, {
| 208| 208| 		IsAlly: function() { return false; },
| 209| 209| 		IsEnemy: function() { return true; },
| 210|    |-		GetEnemies: function() { return []; },
|    | 210|+		"GetEnemies": function() { return []; },
| 211| 211| 	});
| 212| 212| 
| 213| 213| 	// create units
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetClassesList' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 218| 218| 		var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 219| 219| 
| 220| 220| 		AddMock(unit + i, IID_Identity, {
| 221|    |-			GetClassesList: function() { return []; },
|    | 221|+			"GetClassesList": function() { return []; },
| 222| 222| 		});
| 223| 223| 
| 224| 224| 		AddMock(unit + i, IID_Ownership, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetOwner' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 222| 222| 		});
| 223| 223| 
| 224| 224| 		AddMock(unit + i, IID_Ownership, {
| 225|    |-			GetOwner: function() { return 1; },
|    | 225|+			"GetOwner": function() { return 1; },
| 226| 226| 		});
| 227| 227| 
| 228| 228| 		AddMock(unit + i, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 226| 226| 		});
| 227| 227| 
| 228| 228| 		AddMock(unit + i, IID_Position, {
| 229|    |-			GetTurretParent: function() { return INVALID_ENTITY; },
|    | 229|+			"GetTurretParent": function() { return INVALID_ENTITY; },
| 230| 230| 			GetPosition: function() { return new Vector3D(); },
| 231| 231| 			GetPosition2D: function() { return new Vector2D(); },
| 232| 232| 			GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 227| 227| 
| 228| 228| 		AddMock(unit + i, IID_Position, {
| 229| 229| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 230|    |-			GetPosition: function() { return new Vector3D(); },
|    | 230|+			"GetPosition": function() { return new Vector3D(); },
| 231| 231| 			GetPosition2D: function() { return new Vector2D(); },
| 232| 232| 			GetRotation: function() { return { "y": 0 }; },
| 233| 233| 			IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 228| 228| 		AddMock(unit + i, IID_Position, {
| 229| 229| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 230| 230| 			GetPosition: function() { return new Vector3D(); },
| 231|    |-			GetPosition2D: function() { return new Vector2D(); },
|    | 231|+			"GetPosition2D": function() { return new Vector2D(); },
| 232| 232| 			GetRotation: function() { return { "y": 0 }; },
| 233| 233| 			IsInWorld: function() { return true; },
| 234| 234| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 229| 229| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 230| 230| 			GetPosition: function() { return new Vector3D(); },
| 231| 231| 			GetPosition2D: function() { return new Vector2D(); },
| 232|    |-			GetRotation: function() { return { "y": 0 }; },
|    | 232|+			"GetRotation": function() { return { "y": 0 }; },
| 233| 233| 			IsInWorld: function() { return true; },
| 234| 234| 		});
| 235| 235| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 230| 230| 			GetPosition: function() { return new Vector3D(); },
| 231| 231| 			GetPosition2D: function() { return new Vector2D(); },
| 232| 232| 			GetRotation: function() { return { "y": 0 }; },
| 233|    |-			IsInWorld: function() { return true; },
|    | 233|+			"IsInWorld": function() { return true; },
| 234| 234| 		});
| 235| 235| 
| 236| 236| 		AddMock(unit + i, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetWalkSpeed' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 234| 234| 		});
| 235| 235| 
| 236| 236| 		AddMock(unit + i, IID_UnitMotion, {
| 237|    |-			GetWalkSpeed: function() { return 1; },
|    | 237|+			"GetWalkSpeed": function() { return 1; },
| 238| 238| 			MoveToFormationOffset: function(target, x, z) { },
| 239| 239| 			IsInTargetRange: function(target, min, max) { return true; },
| 240| 240| 			MoveToTargetRange: function(target, min, max) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'MoveToFormationOffset' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 235| 235| 
| 236| 236| 		AddMock(unit + i, IID_UnitMotion, {
| 237| 237| 			GetWalkSpeed: function() { return 1; },
| 238|    |-			MoveToFormationOffset: function(target, x, z) { },
|    | 238|+			"MoveToFormationOffset": function(target, x, z) { },
| 239| 239| 			IsInTargetRange: function(target, min, max) { return true; },
| 240| 240| 			MoveToTargetRange: function(target, min, max) { },
| 241| 241| 			StopMoving: function() { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInTargetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 236| 236| 		AddMock(unit + i, IID_UnitMotion, {
| 237| 237| 			GetWalkSpeed: function() { return 1; },
| 238| 238| 			MoveToFormationOffset: function(target, x, z) { },
| 239|    |-			IsInTargetRange: function(target, min, max) { return true; },
|    | 239|+			"IsInTargetRange": function(target, min, max) { return true; },
| 240| 240| 			MoveToTargetRange: function(target, min, max) { },
| 241| 241| 			StopMoving: function() { },
| 242| 242| 			GetPassabilityClassName: function() { return "default"; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'MoveToTargetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 237| 237| 			GetWalkSpeed: function() { return 1; },
| 238| 238| 			MoveToFormationOffset: function(target, x, z) { },
| 239| 239| 			IsInTargetRange: function(target, min, max) { return true; },
| 240|    |-			MoveToTargetRange: function(target, min, max) { },
|    | 240|+			"MoveToTargetRange": function(target, min, max) { },
| 241| 241| 			StopMoving: function() { },
| 242| 242| 			GetPassabilityClassName: function() { return "default"; },
| 243| 243| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'StopMoving' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 238| 238| 			MoveToFormationOffset: function(target, x, z) { },
| 239| 239| 			IsInTargetRange: function(target, min, max) { return true; },
| 240| 240| 			MoveToTargetRange: function(target, min, max) { },
| 241|    |-			StopMoving: function() { },
|    | 241|+			"StopMoving": function() { },
| 242| 242| 			GetPassabilityClassName: function() { return "default"; },
| 243| 243| 		});
| 244| 244| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPassabilityClassName' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 239| 239| 			IsInTargetRange: function(target, min, max) { return true; },
| 240| 240| 			MoveToTargetRange: function(target, min, max) { },
| 241| 241| 			StopMoving: function() { },
| 242|    |-			GetPassabilityClassName: function() { return "default"; },
|    | 242|+			"GetPassabilityClassName": function() { return "default"; },
| 243| 243| 		});
| 244| 244| 
| 245| 245| 		AddMock(unit + i, IID_Vision, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 243| 243| 		});
| 244| 244| 
| 245| 245| 		AddMock(unit + i, IID_Vision, {
| 246|    |-			GetRange: function() { return 10; },
|    | 246|+			"GetRange": function() { return 10; },
| 247| 247| 		});
| 248| 248| 
| 249| 249| 		AddMock(unit + i, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 247| 247| 		});
| 248| 248| 
| 249| 249| 		AddMock(unit + i, IID_Attack, {
| 250|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 250|+			"GetRange": function() { return {"max":10, "min": 0}; },
| 251| 251| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 247| 247| 		});
| 248| 248| 
| 249| 249| 		AddMock(unit + i, IID_Attack, {
| 250|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 250|+			GetRange: function() { return { "max":10, "min": 0}; },
| 251| 251| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'max'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 247| 247| 		});
| 248| 248| 
| 249| 249| 		AddMock(unit + i, IID_Attack, {
| 250|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 250|+			GetRange: function() { return {"max": 10, "min": 0}; },
| 251| 251| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 247| 247| 		});
| 248| 248| 
| 249| 249| 		AddMock(unit + i, IID_Attack, {
| 250|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 250|+			GetRange: function() { return {"max":10, "min": 0 }; },
| 251| 251| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetFullAttackRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 248| 248| 
| 249| 249| 		AddMock(unit + i, IID_Attack, {
| 250| 250| 			GetRange: function() { return {"max":10, "min": 0}; },
| 251|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 251|+			"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 254| 254| 			CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 248| 248| 
| 249| 249| 		AddMock(unit + i, IID_Attack, {
| 250| 250| 			GetRange: function() { return {"max":10, "min": 0}; },
| 251|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 251|+			GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 254| 254| 			CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetBestAttackAgainst' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 249| 249| 		AddMock(unit + i, IID_Attack, {
| 250| 250| 			GetRange: function() { return {"max":10, "min": 0}; },
| 251| 251| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 252|    |-			GetBestAttackAgainst: function(t) { return "melee"; },
|    | 252|+			"GetBestAttackAgainst": function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 254| 254| 			CanAttack: function(v) { return true; },
| 255| 255| 			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTimers' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 250| 250| 			GetRange: function() { return {"max":10, "min": 0}; },
| 251| 251| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253|    |-			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 253|+			"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 254| 254| 			CanAttack: function(v) { return true; },
| 255| 255| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 256| 256| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttack' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 251| 251| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 254|    |-			CanAttack: function(v) { return true; },
|    | 254|+			"CanAttack": function(v) { return true; },
| 255| 255| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 256| 256| 		});
| 257| 257| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CompareEntitiesByPreference' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 252| 252| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 253| 253| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 254| 254| 			CanAttack: function(v) { return true; },
| 255|    |-			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 255|+			"CompareEntitiesByPreference": function(a, b) { return 0; },
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		unitAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 264| 264| 
| 265| 265| 	// create enemy
| 266| 266| 	AddMock(enemy, IID_Health, {
| 267|    |-		GetHitpoints: function() { return 40; },
|    | 267|+		"GetHitpoints": function() { return 40; },
| 268| 268| 	});
| 269| 269| 
| 270| 270| 	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 267| 267| 		GetHitpoints: function() { return 40; },
| 268| 268| 	});
| 269| 269| 
| 270|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 270|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 271| 271| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 272| 272| 
| 273| 273| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 267| 267| 		GetHitpoints: function() { return 40; },
| 268| 268| 	});
| 269| 269| 
| 270|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 270|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 271| 271| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 272| 272| 
| 273| 273| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 271| 271| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 272| 272| 
| 273| 273| 	AddMock(controller, IID_Position, {
| 274|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 274|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 275| 275| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 276| 276| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 277| 277| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'JumpTo' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 272| 272| 
| 273| 273| 	AddMock(controller, IID_Position, {
| 274| 274| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 275|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 275|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 276| 276| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 277| 277| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 278| 278| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 273| 273| 	AddMock(controller, IID_Position, {
| 274| 274| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 275| 275| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 276|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 276|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 277| 277| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 278| 278| 		GetRotation: function() { return { "y": 0 }; },
| 279| 279| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 274| 274| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 275| 275| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 276| 276| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 277|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 277|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 278| 278| 		GetRotation: function() { return { "y": 0 }; },
| 279| 279| 		IsInWorld: function() { return true; },
| 280| 280| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 275| 275| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 276| 276| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 277| 277| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 278|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 278|+		"GetRotation": function() { return { "y": 0 }; },
| 279| 279| 		IsInWorld: function() { return true; },
| 280| 280| 	});
| 281| 281| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 276| 276| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 277| 277| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 278| 278| 		GetRotation: function() { return { "y": 0 }; },
| 279|    |-		IsInWorld: function() { return true; },
|    | 279|+		"IsInWorld": function() { return true; },
| 280| 280| 	});
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetSpeed' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 280| 280| 	});
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_UnitMotion, {
| 283|    |-		SetSpeed: function(speed) { },
|    | 283|+		"SetSpeed": function(speed) { },
| 284| 284| 		MoveToPointRange: function(x, z, minRange, maxRange) { },
| 285| 285| 		IsInTargetRange: function(target, min, max) { return true; },
| 286| 286| 		StopMoving: function() { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'MoveToPointRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_UnitMotion, {
| 283| 283| 		SetSpeed: function(speed) { },
| 284|    |-		MoveToPointRange: function(x, z, minRange, maxRange) { },
|    | 284|+		"MoveToPointRange": function(x, z, minRange, maxRange) { },
| 285| 285| 		IsInTargetRange: function(target, min, max) { return true; },
| 286| 286| 		StopMoving: function() { },
| 287| 287| 		GetPassabilityClassName: function() { return "default"; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInTargetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 282| 282| 	AddMock(controller, IID_UnitMotion, {
| 283| 283| 		SetSpeed: function(speed) { },
| 284| 284| 		MoveToPointRange: function(x, z, minRange, maxRange) { },
| 285|    |-		IsInTargetRange: function(target, min, max) { return true; },
|    | 285|+		"IsInTargetRange": function(target, min, max) { return true; },
| 286| 286| 		StopMoving: function() { },
| 287| 287| 		GetPassabilityClassName: function() { return "default"; },
| 288| 288| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'StopMoving' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 283| 283| 		SetSpeed: function(speed) { },
| 284| 284| 		MoveToPointRange: function(x, z, minRange, maxRange) { },
| 285| 285| 		IsInTargetRange: function(target, min, max) { return true; },
| 286|    |-		StopMoving: function() { },
|    | 286|+		"StopMoving": function() { },
| 287| 287| 		GetPassabilityClassName: function() { return "default"; },
| 288| 288| 	});
| 289| 289| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPassabilityClassName' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 284| 284| 		MoveToPointRange: function(x, z, minRange, maxRange) { },
| 285| 285| 		IsInTargetRange: function(target, min, max) { return true; },
| 286| 286| 		StopMoving: function() { },
| 287|    |-		GetPassabilityClassName: function() { return "default"; },
|    | 287|+		"GetPassabilityClassName": function() { return "default"; },
| 288| 288| 	});
| 289| 289| 
| 290| 290| 	AddMock(controller, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 288| 288| 	});
| 289| 289| 
| 290| 290| 	AddMock(controller, IID_Attack, {
| 291|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 291|+		"GetRange": function() { return {"max":10, "min": 0}; },
| 292| 292| 		CanAttackAsFormation: function() { return false; },
| 293| 293| 	});
| 294| 294| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 288| 288| 	});
| 289| 289| 
| 290| 290| 	AddMock(controller, IID_Attack, {
| 291|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 291|+		GetRange: function() { return { "max":10, "min": 0}; },
| 292| 292| 		CanAttackAsFormation: function() { return false; },
| 293| 293| 	});
| 294| 294| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'max'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 288| 288| 	});
| 289| 289| 
| 290| 290| 	AddMock(controller, IID_Attack, {
| 291|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 291|+		GetRange: function() { return {"max": 10, "min": 0}; },
| 292| 292| 		CanAttackAsFormation: function() { return false; },
| 293| 293| 	});
| 294| 294| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 288| 288| 	});
| 289| 289| 
| 290| 290| 	AddMock(controller, IID_Attack, {
| 291|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 291|+		GetRange: function() { return {"max":10, "min": 0 }; },
| 292| 292| 		CanAttackAsFormation: function() { return false; },
| 293| 293| 	});
| 294| 294| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttackAsFormation' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 289| 289| 
| 290| 290| 	AddMock(controller, IID_Attack, {
| 291| 291| 		GetRange: function() { return {"max":10, "min": 0}; },
| 292|    |-		CanAttackAsFormation: function() { return false; },
|    | 292|+		"CanAttackAsFormation": function() { return false; },
| 293| 293| 	});
| 294| 294| 
| 295| 295| 	controllerAI.OnCreate();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 301| 301| 	for (var ent of unitAIs)
| 302| 302| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 303| 303| 
| 304|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 304|+	controllerAI.MoveIntoFormation({ "name": "Circle"});
| 305| 305| 
| 306| 306| 	// let all units be in position
| 307| 307| 	for (var ent of unitAIs)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 301| 301| 	for (var ent of unitAIs)
| 302| 302| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 303| 303| 
| 304|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 304|+	controllerAI.MoveIntoFormation({"name": "Circle" });
| 305| 305| 
| 306| 306| 	// let all units be in position
| 307| 307| 	for (var ent of unitAIs)

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  46| »   »   ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·},
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Closing curly brace appears on the same line as the subsequent block.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 214| »   for·(var·i·=·0;·i·<·unitCount;·i++)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 307| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 310| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 302| »   »   TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING");
|    | [NORMAL] JSHintBear:
|    | 'unitAI' used out of scope.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 311| »   »   TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING");
|    | [NORMAL] JSHintBear:
|    | 'unitAI' used out of scope.
|    | [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
| 126| 126| 	this.formationMembersWithAura = []; // Members with a formation aura
| 127| 127| 	this.width = 0;
| 128| 128| 	this.depth = 0;
| 129|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 129|+	this.oldOrientation = { "sin": 0, "cos": 0};
| 130| 130| 	this.twinFormations = [];
| 131| 131| 	// distance from which two twin formations will merge into one.
| 132| 132| 	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
| 126| 126| 	this.formationMembersWithAura = []; // Members with a formation aura
| 127| 127| 	this.width = 0;
| 128| 128| 	this.depth = 0;
| 129|    |-	this.oldOrientation = {"sin": 0, "cos": 0};
|    | 129|+	this.oldOrientation = {"sin": 0, "cos": 0 };
| 130| 130| 	this.twinFormations = [];
| 131| 131| 	// distance from which two twin formations will merge into one.
| 132| 132| 	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
| 144| 144| 
| 145| 145| Formation.prototype.GetSize = function()
| 146| 146| {
| 147|    |-	return {"width": this.width, "depth": this.depth};
|    | 147|+	return { "width": this.width, "depth": this.depth};
| 148| 148| };
| 149| 149| 
| 150| 150| 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
| 144| 144| 
| 145| 145| Formation.prototype.GetSize = function()
| 146| 146| {
| 147|    |-	return {"width": this.width, "depth": this.depth};
|    | 147|+	return {"width": this.width, "depth": this.depth };
| 148| 148| };
| 149| 149| 
| 150| 150| 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
| 563| 563| 			footprints.push(cmpFootprint.GetShape());
| 564| 564| 	}
| 565| 565| 	if (!footprints.length)
| 566|    |-		return {"width":1, "depth": 1};
|    | 566|+		return { "width":1, "depth": 1};
| 567| 567| 
| 568| 568| 	var r = {"width": 0, "depth": 0};
| 569| 569| 	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
| 563| 563| 			footprints.push(cmpFootprint.GetShape());
| 564| 564| 	}
| 565| 565| 	if (!footprints.length)
| 566|    |-		return {"width":1, "depth": 1};
|    | 566|+		return {"width": 1, "depth": 1};
| 567| 567| 
| 568| 568| 	var r = {"width": 0, "depth": 0};
| 569| 569| 	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
| 563| 563| 			footprints.push(cmpFootprint.GetShape());
| 564| 564| 	}
| 565| 565| 	if (!footprints.length)
| 566|    |-		return {"width":1, "depth": 1};
|    | 566|+		return {"width":1, "depth": 1 };
| 567| 567| 
| 568| 568| 	var r = {"width": 0, "depth": 0};
| 569| 569| 	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
| 565| 565| 	if (!footprints.length)
| 566| 566| 		return {"width":1, "depth": 1};
| 567| 567| 
| 568|    |-	var r = {"width": 0, "depth": 0};
|    | 568|+	var r = { "width": 0, "depth": 0};
| 569| 569| 	for (var shape of footprints)
| 570| 570| 	{
| 571| 571| 		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
| 565| 565| 	if (!footprints.length)
| 566| 566| 		return {"width":1, "depth": 1};
| 567| 567| 
| 568|    |-	var r = {"width": 0, "depth": 0};
|    | 568|+	var r = {"width": 0, "depth": 0 };
| 569| 569| 	for (var shape of footprints)
| 570| 570| 	{
| 571| 571| 		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
| 567| 567| 
| 568| 568| 	var r = {"width": 0, "depth": 0};
| 569| 569| 	for (var shape of footprints)
| 570|    |-	{
|    | 570|+	
| 571| 571| 		if (shape.type == "circle")
| 572| 572| 		{
| 573| 573| 			r.width += shape.radius * 2;
| 578| 578| 			r.width += shape.width;
| 579| 579| 			r.depth += shape.depth;
| 580| 580| 		}
| 581|    |-	}
|    | 581|+	
| 582| 582| 	r.width /= footprints.length;
| 583| 583| 	r.depth /= footprints.length;
| 584| 584| 	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
| 591| 591| 	separation.depth *= this.separationMultiplier.depth;
| 592| 592| 
| 593| 593| 	if (this.columnar)
| 594|    |-		var sortingClasses = ["Cavalry","Infantry"];
|    | 594|+		var sortingClasses = ["Cavalry", "Infantry"];
| 595| 595| 	else
| 596| 596| 		var sortingClasses = this.sortingClasses.slice();
| 597| 597| 	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
| 608| 608| 		var classes = cmpIdentity.GetClassesList();
| 609| 609| 		var done = false;
| 610| 610| 		for (var c = 0; c < sortingClasses.length; ++c)
| 611|    |-		{
|    | 611|+		
| 612| 612| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 613| 613| 			{
| 614| 614| 				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
| 615| 615| 				done = true;
| 616| 616| 				break;
| 617| 617| 			}
| 618|    |-		}
|    | 618|+		
| 619| 619| 		if (!done)
| 620| 620| 			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
| 621| 621| 	}
|    | [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
| 611| 611| 		{
| 612| 612| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 613| 613| 			{
| 614|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 614|+				types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]});
| 615| 615| 				done = true;
| 616| 616| 				break;
| 617| 617| 			}
|    | [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
| 611| 611| 		{
| 612| 612| 			if (classes.indexOf(sortingClasses[c]) > -1)
| 613| 613| 			{
| 614|    |-				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]});
|    | 614|+				types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] });
| 615| 615| 				done = true;
| 616| 616| 				break;
| 617| 617| 			}
|    | [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
| 617| 617| 			}
| 618| 618| 		}
| 619| 619| 		if (!done)
| 620|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 620|+			types.Unknown.push({"ent": active[i], "pos": positions[i]});
| 621| 621| 	}
| 622| 622| 
| 623| 623| 	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
| 617| 617| 			}
| 618| 618| 		}
| 619| 619| 		if (!done)
| 620|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 620|+			types["Unknown"].push({ "ent": active[i], "pos": positions[i]});
| 621| 621| 	}
| 622| 622| 
| 623| 623| 	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
| 617| 617| 			}
| 618| 618| 		}
| 619| 619| 		if (!done)
| 620|    |-			types["Unknown"].push({"ent": active[i], "pos": positions[i]});
|    | 620|+			types["Unknown"].push({"ent": active[i], "pos": positions[i] });
| 621| 621| 	}
| 622| 622| 
| 623| 623| 	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
| 635| 635| 	if (this.columnar)
| 636| 636| 	{
| 637| 637| 		shape = "square";
| 638|    |-		cols = Math.min(count,3);
|    | 638|+		cols = Math.min(count, 3);
| 639| 639| 		shiftRows = false;
| 640| 640| 		centerGap = 0;
| 641| 641| 		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
| 689| 689| 					n -= r%2;
| 690| 690| 			}
| 691| 691| 			else if (shape == "triangle")
| 692|    |-			{
|    | 692|+			
| 693| 693| 				if (shiftRows)
| 694| 694| 					var n = r + 1;
| 695| 695| 				else
| 696| 696| 					var n = r * 2 + 1;
| 697|    |-			}
|    | 697|+			
| 698| 698| 			if (!shiftRows && n > left)
| 699| 699| 				n = left;
| 700| 700| 			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
| 730| 730| 	// calculating offset distances without a zero average makes no sense, as the formation
| 731| 731| 	// will jump to a different position any time
| 732| 732| 	var avgoffset = Vector2D.average(offsets);
| 733|    |-	offsets.forEach(function (o) {o.sub(avgoffset);});
|    | 733|+	offsets.forEach(function(o) {o.sub(avgoffset);});
| 734| 734| 
| 735| 735| 	// sort the available places in certain ways
| 736| 736| 	// 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
| 789| 789| 			closestOffsetId = i;
| 790| 790| 		}
| 791| 791| 	}
| 792|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 792|+	this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
| 793| 793| 	return closestOffsetId;
| 794| 794| };
| 795| 795| 
|    | [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
| 789| 789| 			closestOffsetId = i;
| 790| 790| 		}
| 791| 791| 	}
| 792|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 792|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column};
| 793| 793| 	return closestOffsetId;
| 794| 794| };
| 795| 795| 
|    | [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
| 789| 789| 			closestOffsetId = i;
| 790| 790| 		}
| 791| 791| 	}
| 792|    |-	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column};
|    | 792|+	this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column };
| 793| 793| 	return closestOffsetId;
| 794| 794| };
| 795| 795| 
|    | [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
| 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 800| 800| {
| 801| 801| 	var offsetPositions = [];
| 802|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 802|+	var { sin, cos} = this.GetEstimatedOrientation(pos);
| 803| 803| 	// calculate the world positions
| 804| 804| 	for (var o of offsets)
| 805| 805| 		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
| 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos)
| 800| 800| {
| 801| 801| 	var offsetPositions = [];
| 802|    |-	var {sin, cos} = this.GetEstimatedOrientation(pos);
|    | 802|+	var {sin, cos } = this.GetEstimatedOrientation(pos);
| 803| 803| 	// calculate the world positions
| 804| 804| 	for (var o of offsets)
| 805| 805| 		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
| 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos)
| 817| 817| {
| 818| 818| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 819|    |-	var r = {"sin": 0, "cos": 1};
|    | 819|+	var r = { "sin": 0, "cos": 1};
| 820| 820| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 821| 821| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 822| 822| 	{
|    | [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
| 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos)
| 817| 817| {
| 818| 818| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
| 819|    |-	var r = {"sin": 0, "cos": 1};
|    | 819|+	var r = {"sin": 0, "cos": 1 };
| 820| 820| 	var unitAIState = cmpUnitAI.GetCurrentState();
| 821| 821| 	if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING")
| 822| 822| 	{
|    | [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
| 898| 898| 		cmpOtherFormation.RemoveMembers(otherMembers);
| 899| 899| 		this.AddMembers(otherMembers);
| 900| 900| 		Engine.DestroyEntity(this.twinFormations[i]);
| 901|    |-		this.twinFormations.splice(i,1);
|    | 901|+		this.twinFormations.splice(i, 1);
| 902| 902| 	}
| 903| 903| 	// Switch between column and box if necessary
| 904| 904| 	var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/Formation.js
| 620| »   »   »   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
| 660| »   »   for·(var·i·=·0;·i·<·count;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

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

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

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

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

binaries/data/mods/public/simulation/components/Formation.js
| 710| »   »   »   »   »   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
| 712| »   »   »   »   »   x·+=·side·*·centerGap·/·2;
|    | [NORMAL] JSHintBear:
|    | 'x' used out of scope.

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

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

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

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

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

binaries/data/mods/public/simulation/components/Formation.js
| 714| »   »   »   »   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
| 724| »   »   »   this.maxColumnsUsed[r]·=·n;
|    | [NORMAL] JSHintBear:
|    | 'n' used out of scope.

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/Formation.js
| 614| »   »   »   »   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
| 753| »   for·(var·i·=·sortingClasses.length;·i;·--i)
|    | [NORMAL] JSHintBear:
|    | 'sortingClasses' used out of scope.

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

binaries/data/mods/public/simulation/components/Formation.js
| 860| »   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
| 228| 228| 		// Move a tile outside the building
| 229| 229| 		let range = 4;
| 230| 230| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 231|    |-		{
|    | 231|+		
| 232| 232| 			// We've started walking to the given point
| 233| 233| 			this.SetNextState("INDIVIDUAL.WALKING");
| 234|    |-		}
|    | 234|+		
| 235| 235| 		else
| 236| 236| 		{
| 237| 237| 			// 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
| 233| 233| 			this.SetNextState("INDIVIDUAL.WALKING");
| 234| 234| 		}
| 235| 235| 		else
| 236|    |-		{
|    | 236|+		
| 237| 237| 			// We are already at the target, or can't move at all
| 238| 238| 			this.FinishOrder();
| 239|    |-		}
|    | 239|+		
| 240| 240| 	},
| 241| 241| 
| 242| 242| 	// 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
| 335| 335| 
| 336| 336| 		var ok = this.MoveToTarget(this.order.data.target);
| 337| 337| 		if (ok)
| 338|    |-		{
|    | 338|+		
| 339| 339| 			// We've started walking to the given point
| 340| 340| 			if (this.IsAnimal())
| 341| 341| 				this.SetNextState("ANIMAL.WALKING");
| 342| 342| 			else
| 343| 343| 				this.SetNextState("INDIVIDUAL.WALKING");
| 344|    |-		}
|    | 344|+		
| 345| 345| 		else
| 346| 346| 		{
| 347| 347| 			// 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
| 363| 363| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 364| 364| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 365| 365| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 366|    |-		{
|    | 366|+		
| 367| 367| 			// we were already on the shoreline, and have not moved since
| 368| 368| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 369| 369| 				needToMove = false;
| 370|    |-		}
|    | 370|+		
| 371| 371| 
| 372| 372| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 373| 373| 		// 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
| 361| 361| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 362| 362| 		var needToMove = true;
| 363| 363| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 364|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 365|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 364|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 365|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 366| 366| 		{
| 367| 367| 			// we were already on the shoreline, and have not moved since
| 368| 368| 			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
| 372| 372| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 373| 373| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 374| 374| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 375|    |-		{
|    | 375|+		
| 376| 376| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 377|    |-		}
|    | 377|+		
| 378| 378| 		else
| 379| 379| 		{
| 380| 380| 			// 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
| 401| 401| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 402| 402| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 403| 403| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 404|    |-		{
|    | 404|+		
| 405| 405| 			// We've started fleeing from the given target
| 406| 406| 			if (this.IsAnimal())
| 407| 407| 				this.SetNextState("ANIMAL.FLEEING");
| 408| 408| 			else
| 409| 409| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 410|    |-		}
|    | 410|+		
| 411| 411| 		else
| 412| 412| 		{
| 413| 413| 			// 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
| 448| 448| 			}
| 449| 449| 
| 450| 450| 			if (this.order.data.attackType == this.oldAttackType)
| 451|    |-			{
|    | 451|+			
| 452| 452| 				if (this.IsAnimal())
| 453| 453| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 454| 454| 				else
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456|    |-			}
|    | 456|+			
| 457| 457| 			else
| 458| 458| 			{
| 459| 459| 				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
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456| 456| 			}
| 457| 457| 			else
| 458|    |-			{
|    | 458|+			
| 459| 459| 				if (this.IsAnimal())
| 460| 460| 					this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
| 461| 461| 				else
| 462| 462| 					this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
| 463|    |-			}
|    | 463|+			
| 464| 464| 			return;
| 465| 465| 		}
| 466| 466| 
|    | [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
| 580| 580| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 581| 581| 				}
| 582| 582| 				else
| 583|    |-				{
|    | 583|+				
| 584| 584| 					// We couldn't move there, or the target moved away
| 585| 585| 					this.FinishOrder();
| 586|    |-				}
|    | 586|+				
| 587| 587| 				return;
| 588| 588| 			}
| 589| 589| 
|    | [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
| 593| 593| 
| 594| 594| 		// Try to move within range
| 595| 595| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 596|    |-		{
|    | 596|+		
| 597| 597| 			// We've started walking to the given point
| 598| 598| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 599|    |-		}
|    | 599|+		
| 600| 600| 		else
| 601| 601| 		{
| 602| 602| 			// 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
| 670| 670| 	"Order.Repair": function(msg) {
| 671| 671| 		// Try to move within range
| 672| 672| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 673|    |-		{
|    | 673|+		
| 674| 674| 			// We've started walking to the given point
| 675| 675| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 676|    |-		}
|    | 676|+		
| 677| 677| 		else
| 678| 678| 		{
| 679| 679| 			// 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
| 706| 706| 		}
| 707| 707| 
| 708| 708| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 709|    |-		{
|    | 709|+		
| 710| 710| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 711|    |-		}
|    | 711|+		
| 712| 712| 		else
| 713| 713| 		{
| 714| 714| 			// 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
| 834| 834| 			if (!this.CheckTargetAttackRange(target, target))
| 835| 835| 			{
| 836| 836| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 837|    |-				{
|    | 837|+				
| 838| 838| 					if (this.MoveToTargetAttackRange(target, target))
| 839| 839| 					{
| 840| 840| 						this.SetNextState("COMBAT.APPROACHING");
| 841| 841| 						return;
| 842| 842| 					}
| 843|    |-				}
|    | 843|+				
| 844| 844| 				this.FinishOrder();
| 845| 845| 				return;
| 846| 846| 			}
|    | [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
| 859| 859| 			}
| 860| 860| 			// Check if we are already in range, otherwise walk there
| 861| 861| 			if (!this.CheckGarrisonRange(msg.data.target))
| 862|    |-			{
|    | 862|+			
| 863| 863| 				if (!this.CheckTargetVisible(msg.data.target))
| 864| 864| 				{
| 865| 865| 					this.FinishOrder();
| 874| 874| 						return;
| 875| 875| 					}
| 876| 876| 				}
| 877|    |-			}
|    | 877|+			
| 878| 878| 
| 879| 879| 			this.SetNextState("GARRISON.GARRISONING");
| 880| 880| 		},
|    | [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
| 866| 866| 					return;
| 867| 867| 				}
| 868| 868| 				else
| 869|    |-				{
|    | 869|+				
| 870| 870| 					// Out of range; move there in formation
| 871| 871| 					if (this.MoveToGarrisonRange(msg.data.target))
| 872| 872| 					{
| 873| 873| 						this.SetNextState("GARRISON.APPROACHING");
| 874| 874| 						return;
| 875| 875| 					}
| 876|    |-				}
|    | 876|+				
| 877| 877| 			}
| 878| 878| 
| 879| 879| 			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
| 865| 865| 					this.FinishOrder();
| 866| 866| 					return;
| 867| 867| 				}
| 868|    |-				else
| 869|    |-				{
|    | 868|+				
| 870| 869| 					// Out of range; move there in formation
| 871| 870| 					if (this.MoveToGarrisonRange(msg.data.target))
| 872| 871| 					{
| 873| 872| 						this.SetNextState("GARRISON.APPROACHING");
| 874| 873| 						return;
| 875| 874| 					}
| 876|    |-				}
|    | 875|+				
| 877| 876| 			}
| 878| 877| 
| 879| 878| 			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
| 892| 892| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 893| 893| 					}
| 894| 894| 					else
| 895|    |-					{
|    | 895|+					
| 896| 896| 						// We couldn't move there, or the target moved away
| 897| 897| 						this.FinishOrder();
| 898|    |-					}
|    | 898|+					
| 899| 899| 					return;
| 900| 900| 				}
| 901| 901| 
|    | [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
|1113|1113| 			},
|1114|1114| 		},
|1115|1115| 
|1116|    |-		"GARRISON":{
|    |1116|+		"GARRISON": {
|1117|1117| 			"enter": function() {
|1118|1118| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1119|1119| 				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
|1297|1297| 			// If the controller handled an order but some members rejected it,
|1298|1298| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1299|1299| 			if (this.orderQueue.length)
|1300|    |-			{
|    |1300|+			
|1301|1301| 				// We're leaving the formation, so stop our FormationWalk order
|1302|1302| 				if (this.FinishOrder())
|1303|1303| 					return;
|1304|    |-			}
|    |1304|+			
|1305|1305| 
|1306|1306| 			// No orders left, we're an individual now
|1307|1307| 			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
|1325|1325| 			// Move a tile outside the building
|1326|1326| 			let range = 4;
|1327|1327| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1328|    |-			{
|    |1328|+			
|1329|1329| 				// We've started walking to the given point
|1330|1330| 				this.SetNextState("WALKINGTOPOINT");
|1331|    |-			}
|    |1331|+			
|1332|1332| 			else
|1333|1333| 			{
|1334|1334| 				// 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
|1330|1330| 				this.SetNextState("WALKINGTOPOINT");
|1331|1331| 			}
|1332|1332| 			else
|1333|    |-			{
|    |1333|+			
|1334|1334| 				// We are already at the target, or can't move at all
|1335|1335| 				this.FinishOrder();
|1336|    |-			}
|    |1336|+			
|1337|1337| 		},
|1338|1338| 
|1339|1339| 
|    | [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
|1531|1531| 
|1532|1532| 			"LosRangeUpdate": function(msg) {
|1533|1533| 				if (this.GetStance().targetVisibleEnemies)
|1534|    |-				{
|    |1534|+				
|1535|1535| 					// Start attacking one of the newly-seen enemy (if any)
|1536|1536| 					this.AttackEntitiesByPreference(msg.data.added);
|1537|    |-				}
|    |1537|+				
|1538|1538| 			},
|1539|1539| 
|1540|1540| 			"LosHealRangeUpdate": 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
|1717|1717| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1718|1718| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1719|1719| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1720|    |-						{
|    |1720|+						
|1721|1721| 							if (this.CanHeal(this.isGuardOf))
|1722|1722| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1723|1723| 							else if (this.CanRepair(this.isGuardOf))
|1724|1724| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1725|    |-						}
|    |1725|+						
|1726|1726| 					}
|1727|1727| 				},
|1728|1728| 
|    | [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
|1805|1805| 				"MoveCompleted": function() {
|1806|1806| 
|1807|1807| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1808|    |-					{
|    |1808|+					
|1809|1809| 						// If the unit needs to unpack, do so
|1810|1810| 						if (this.CanUnpack())
|1811|1811| 						{
|1814|1814| 						}
|1815|1815| 						else
|1816|1816| 							this.SetNextState("ATTACKING");
|1817|    |-					}
|    |1817|+					
|1818|1818| 					else
|1819|1819| 					{
|1820|1820| 						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
|1812|1812| 							this.PushOrderFront("Unpack", { "force": true });
|1813|1813| 							return;
|1814|1814| 						}
|1815|    |-						else
|1816|    |-							this.SetNextState("ATTACKING");
|    |1815|+						this.SetNextState("ATTACKING");
|1817|1816| 					}
|1818|1817| 					else
|1819|1818| 					{
|    | [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
|1816|1816| 							this.SetNextState("ATTACKING");
|1817|1817| 					}
|1818|1818| 					else
|1819|    |-					{
|    |1819|+					
|1820|1820| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1821|1821| 						{
|1822|1822| 							this.SetNextState("APPROACHING");
|1826|1826| 							// Give up
|1827|1827| 							this.FinishOrder();
|1828|1828| 						}
|1829|    |-					}
|    |1829|+					
|1830|1830| 				},
|1831|1831| 			},
|1832|1832| 
|    | [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
|1818|1818| 					else
|1819|1819| 					{
|1820|1820| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1821|    |-						{
|    |1821|+						
|1822|1822| 							this.SetNextState("APPROACHING");
|1823|    |-						}
|    |1823|+						
|1824|1824| 						else
|1825|1825| 						{
|1826|1826| 							// 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
|1822|1822| 							this.SetNextState("APPROACHING");
|1823|1823| 						}
|1824|1824| 						else
|1825|    |-						{
|    |1825|+						
|1826|1826| 							// Give up
|1827|1827| 							this.FinishOrder();
|1828|    |-						}
|    |1828|+						
|1829|1829| 					}
|1830|1830| 				},
|1831|1831| 			},
|    | [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
|1843|1843| 					}
|1844|1844| 					// Check the target is still alive and attackable
|1845|1845| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1846|    |-					{
|    |1846|+					
|1847|1847| 						// Can't reach it - try to chase after it
|1848|1848| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1849|1849| 						{
|1853|1853| 								return;
|1854|1854| 							}
|1855|1855| 						}
|1856|    |-					}
|    |1856|+					
|1857|1857| 
|1858|1858| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1859|1859| 					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
|1846|1846| 					{
|1847|1847| 						// Can't reach it - try to chase after it
|1848|1848| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1849|    |-						{
|    |1849|+						
|1850|1850| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1851|1851| 							{
|1852|1852| 								this.SetNextState("COMBAT.CHASING");
|1853|1853| 								return;
|1854|1854| 							}
|1855|    |-						}
|    |1855|+						
|1856|1856| 					}
|1857|1857| 
|1858|1858| 					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
|1884|1884| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1885|1885| 
|1886|1886| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1887|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1887|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1888|1888| 
|1889|1889| 					this.FaceTowardsTarget(this.order.data.target);
|1890|1890| 
|    | [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
|1959|1959| 
|1960|1960| 						// Can't reach it - try to chase after it
|1961|1961| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1962|    |-						{
|    |1962|+						
|1963|1963| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1964|1964| 							{
|1965|1965| 								this.SetNextState("COMBAT.CHASING");
|1966|1966| 								return;
|1967|1967| 							}
|1968|    |-						}
|    |1968|+						
|1969|1969| 					}
|1970|1970| 
|1971|1971| 					// 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
|2008|2008| 
|2009|2009| 				"Attacked": function(msg) {
|2010|2010| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2011|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2012|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2011|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2012|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2013|2013| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2014|2014| 				},
|2015|2015| 			},
|    | [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
|2092|2092| 						// Also don't switch to a different type of huntable animal
|2093|2093| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2094|2094| 							return (
|2095|    |-								ent != oldTarget
|2096|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2095|+								ent != oldTarget &&
|    |2096|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2097|2097| 								 || (type.specific == oldType.specific
|2098|2098| 								 && (type.specific != "meat" || oldTemplate == template)))
|2099|2099| 							);
|    | [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
|2093|2093| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2094|2094| 							return (
|2095|2095| 								ent != oldTarget
|2096|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2097|    |-								 || (type.specific == oldType.specific
|    |2096|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2097|+								 (type.specific == oldType.specific
|2098|2098| 								 && (type.specific != "meat" || oldTemplate == template)))
|2099|2099| 							);
|2100|2100| 						}, 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
|2094|2094| 							return (
|2095|2095| 								ent != oldTarget
|2096|2096| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2097|    |-								 || (type.specific == oldType.specific
|2098|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2097|+								 || (type.specific == oldType.specific &&
|    |2098|+								 (type.specific != "meat" || oldTemplate == template)))
|2099|2099| 							);
|2100|2100| 						}, oldTarget);
|2101|2101| 						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
|2103|2103| 							this.PerformGather(nearby, false, false);
|2104|2104| 							return true;
|2105|2105| 						}
|2106|    |-						else
|2107|    |-						{
|    |2106|+						
|2108|2107| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2109|2108| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2110|2109| 							// to order it to GatherNear the resource position.
|2125|2124| 									return true;
|2126|2125| 								}
|2127|2126| 							}
|2128|    |-						}
|    |2127|+						
|2129|2128| 						return true;
|2130|2129| 					}
|2131|2130| 					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
|2115|2115| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2116|2116| 								return true;
|2117|2117| 							}
|2118|    |-							else
|2119|    |-							{
|    |2118|+							
|2120|2119| 								// we're kind of stuck here. Return resource.
|2121|2120| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2122|2121| 								if (nearby)
|2124|2123| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2125|2124| 									return true;
|2126|2125| 								}
|2127|    |-							}
|    |2126|+							
|2128|2127| 						}
|2129|2128| 						return true;
|2130|2129| 					}
|    | [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
|2157|2157| 						// Also don't switch to a different type of huntable animal
|2158|2158| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2159|2159| 							return (
|2160|    |-								ent != oldTarget
|2161|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2160|+								ent != oldTarget &&
|    |2161|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2162|2162| 								|| (type.specific == oldType.specific
|2163|2163| 								&& (type.specific != "meat" || oldTemplate == template)))
|2164|2164| 							);
|    | [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
|2158|2158| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2159|2159| 							return (
|2160|2160| 								ent != oldTarget
|2161|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2162|    |-								|| (type.specific == oldType.specific
|    |2161|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2162|+								(type.specific == oldType.specific
|2163|2163| 								&& (type.specific != "meat" || oldTemplate == template)))
|2164|2164| 							);
|2165|2165| 						});
|    | [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
|2159|2159| 							return (
|2160|2160| 								ent != oldTarget
|2161|2161| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2162|    |-								|| (type.specific == oldType.specific
|2163|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2162|+								|| (type.specific == oldType.specific &&
|    |2163|+								(type.specific != "meat" || oldTemplate == template)))
|2164|2164| 							);
|2165|2165| 						});
|2166|2166| 						if (nearby)
|    | [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
|2204|2204| 					// Also don't switch to a different type of huntable animal
|2205|2205| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2206|2206| 						return (
|2207|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2208|    |-							|| (type.specific == resourceType.specific
|    |2207|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2208|+							(type.specific == resourceType.specific
|2209|2209| 							&& (type.specific != "meat" || resourceTemplate == template))
|2210|2210| 						);
|2211|2211| 					});
|    | [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
|2205|2205| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2206|2206| 						return (
|2207|2207| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2208|    |-							|| (type.specific == resourceType.specific
|2209|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2208|+							|| (type.specific == resourceType.specific &&
|    |2209|+							(type.specific != "meat" || resourceTemplate == template))
|2210|2210| 						);
|2211|2211| 					});
|2212|2212| 
|    | [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
|2321|2321| 
|2322|2322| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2323|2323| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2324|    |-					{
|    |2324|+					
|2325|2325| 						// Check we can still reach and gather from the target
|2326|2326| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2327|2327| 						{
|2387|2387| 								return;
|2388|2388| 							}
|2389|2389| 						}
|2390|    |-					}
|    |2390|+					
|2391|2391| 
|2392|2392| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2393|2393| 
|    | [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
|2413|2413| 					// Also don't switch to a different type of huntable animal
|2414|2414| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2415|2415| 						return (
|2416|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2417|    |-							|| (type.specific == resourceType.specific
|    |2416|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2417|+							(type.specific == resourceType.specific
|2418|2418| 							&& (type.specific != "meat" || resourceTemplate == template))
|2419|2419| 						);
|2420|2420| 					});
|    | [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
|2414|2414| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2415|2415| 						return (
|2416|2416| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2417|    |-							|| (type.specific == resourceType.specific
|2418|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2417|+							|| (type.specific == resourceType.specific &&
|    |2418|+							(type.specific != "meat" || resourceTemplate == template))
|2419|2419| 						);
|2420|2420| 					});
|2421|2421| 					if (nearby)
|    | [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
|2501|2501| 					this.StartTimer(prepare, this.healTimers.repeat);
|2502|2502| 
|2503|2503| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2504|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2504|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2505|2505| 
|2506|2506| 					this.FaceTowardsTarget(this.order.data.target);
|2507|2507| 				},
|    | [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
|2534|2534| 						}
|2535|2535| 						// Can't reach it - try to chase after it
|2536|2536| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|2537|    |-						{
|    |2537|+						
|2538|2538| 							if (this.MoveToTargetRange(target, IID_Heal))
|2539|2539| 							{
|2540|2540| 								this.SetNextState("HEAL.CHASING");
|2541|2541| 								return;
|2542|2542| 							}
|2543|    |-						}
|    |2543|+						
|2544|2544| 					}
|2545|2545| 					// Can't reach it, healed to max hp or doesn't exist any more - give up
|2546|2546| 					if (this.FinishOrder())
|    | [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
|2711|2711| 					{
|2712|2712| 						// The building was already finished/fully repaired before we arrived;
|2713|2713| 						// let the ConstructionFinished handler handle this.
|2714|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2714|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2715|2715| 						return true;
|2716|2716| 					}
|2717|2717| 
|    | [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
|2711|2711| 					{
|2712|2712| 						// The building was already finished/fully repaired before we arrived;
|2713|2713| 						// let the ConstructionFinished handler handle this.
|2714|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2714|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2715|2715| 						return true;
|2716|2716| 					}
|2717|2717| 
|    | [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
|2751|2751| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2752|2752| 						this.SetNextState("APPROACHING");
|2753|2753| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2754|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2754|+						this.FinishOrder(); // can't approach and isn't in reach
|2755|2755| 				},
|2756|2756| 			},
|2757|2757| 
|    | [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
|2838|2838| 
|2839|2839| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2840|2840| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2841|    |-				{
|    |2841|+				
|2842|2842| 					// We're already walking to the given point, so add this as a order.
|2843|2843| 					this.WalkToTarget(msg.data.newentity, true);
|2844|    |-				}
|    |2844|+				
|2845|2845| 			},
|2846|2846| 		},
|2847|2847| 
|    | [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
|2891|2891| 
|2892|2892| 					// Check that we can garrison here
|2893|2893| 					if (this.CanGarrison(target))
|2894|    |-					{
|    |2894|+					
|2895|2895| 						// Check that we're in range of the garrison target
|2896|2896| 						if (this.CheckGarrisonRange(target))
|2897|2897| 						{
|2967|2967| 								return false;
|2968|2968| 							}
|2969|2969| 						}
|2970|    |-					}
|    |2970|+					
|2971|2971| 					// Garrisoning failed for some reason, so finish the order
|2972|2972| 					this.FinishOrder();
|2973|2973| 					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
|3074|3074| 		"Attacked": function(msg) {
|3075|3075| 			if (this.template.NaturalBehaviour == "skittish" ||
|3076|3076| 			    this.template.NaturalBehaviour == "passive")
|3077|    |-			{
|    |3077|+			
|3078|3078| 				this.Flee(msg.data.attacker, false);
|3079|    |-			}
|    |3079|+			
|3080|3080| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3081|3081| 			{
|3082|3082| 				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
|3083|3083| 					this.Attack(msg.data.attacker, false);
|3084|3084| 			}
|3085|3085| 			else if (this.template.NaturalBehaviour == "domestic")
|3086|    |-			{
|    |3086|+			
|3087|3087| 				// Never flee, stop what we were doing
|3088|3088| 				this.SetNextState("IDLE");
|3089|    |-			}
|    |3089|+			
|3090|3090| 		},
|3091|3091| 
|3092|3092| 		"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
|3093|3093| 			// Move a tile outside the building
|3094|3094| 			var range = 4;
|3095|3095| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3096|    |-			{
|    |3096|+			
|3097|3097| 				// We've started walking to the given point
|3098|3098| 				this.SetNextState("WALKING");
|3099|    |-			}
|    |3099|+			
|3100|3100| 			else
|3101|3101| 			{
|3102|3102| 				// 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
|3098|3098| 				this.SetNextState("WALKING");
|3099|3099| 			}
|3100|3100| 			else
|3101|    |-			{
|    |3101|+			
|3102|3102| 				// We are already at the target, or can't move at all
|3103|3103| 				this.FinishOrder();
|3104|    |-			}
|    |3104|+			
|3105|3105| 		},
|3106|3106| 
|3107|3107| 		"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
|3140|3140| 				}
|3141|3141| 				// Start attacking one of the newly-seen enemy (if any)
|3142|3142| 				else if (this.IsDangerousAnimal())
|3143|    |-				{
|    |3143|+				
|3144|3144| 					this.AttackVisibleEntity(msg.data.added);
|3145|    |-				}
|    |3145|+				
|3146|3146| 
|3147|3147| 				// TODO: if two units enter our range together, we'll attack the
|3148|3148| 				// 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
|3183|3183| 				}
|3184|3184| 				// Start attacking one of the newly-seen enemy (if any)
|3185|3185| 				else if (this.template.NaturalBehaviour == "violent")
|3186|    |-				{
|    |3186|+				
|3187|3187| 					this.AttackVisibleEntity(msg.data.added);
|3188|    |-				}
|    |3188|+				
|3189|3189| 			},
|3190|3190| 
|3191|3191| 			"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
|3200|3200| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3201|3201| 
|3202|3202| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3203|    |-							// only used for domestic animals
|    |3203|+		// only used for domestic animals
|3204|3204| 	},
|3205|3205| };
|3206|3206| 
|    | [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
|3257|3257| 
|3258|3258| UnitAI.prototype.IsAnimal = function()
|3259|3259| {
|3260|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3260|+	return (!!this.template.NaturalBehaviour);
|3261|3261| };
|3262|3262| 
|3263|3263| 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
|3295|3295| UnitAI.prototype.GetGarrisonHolder = function()
|3296|3296| {
|3297|3297| 	if (this.IsGarrisoned())
|3298|    |-	{
|    |3298|+	
|3299|3299| 		for (let order of this.orderQueue)
|3300|3300| 			if (order.type == "Garrison")
|3301|3301| 				return order.data.target;
|3302|    |-	}
|    |3302|+	
|3303|3303| 	return INVALID_ENTITY;
|3304|3304| };
|3305|3305| 
|    | [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
|3373|3373| 		{
|3374|3374| 			let index = this.GetCurrentState().indexOf(".");
|3375|3375| 			if (index != -1)
|3376|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3376|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3377|3377| 			this.Stop(false);
|3378|3378| 		}
|3379|3379| 
|    | [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
|3429|3429| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3430|3430| 			continue;
|3431|3431| 		if (i == 0)
|3432|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3432|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3433|3433| 		else
|3434|3434| 			this.orderQueue.splice(i, 1);
|3435|3435| 		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
|3429|3429| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3430|3430| 			continue;
|3431|3431| 		if (i == 0)
|3432|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3432|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3433|3433| 		else
|3434|3434| 			this.orderQueue.splice(i, 1);
|3435|3435| 		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
|3513|3513| };
|3514|3514| 
|3515|3515| 
|3516|    |-//// FSM linkage functions ////
|    |3516|+// // FSM linkage functions ////
|3517|3517| 
|3518|3518| UnitAI.prototype.SetNextState = function(state)
|3519|3519| {
|    | [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
|3615|3615| 	{
|3616|3616| 		this.order = order;
|3617|3617| 		let ret = this.UnitFsm.ProcessMessage(this,
|3618|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3618|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3619|3619| 		);
|3620|3620| 
|3621|3621| 		// 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
|3615|3615| 	{
|3616|3616| 		this.order = order;
|3617|3617| 		let ret = this.UnitFsm.ProcessMessage(this,
|3618|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3618|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3619|3619| 		);
|3620|3620| 
|3621|3621| 		// 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
|3651|3651| 		this.orderQueue.unshift(order);
|3652|3652| 		this.order = order;
|3653|3653| 		let ret = this.UnitFsm.ProcessMessage(this,
|3654|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3654|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3655|3655| 		);
|3656|3656| 
|3657|3657| 		// 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
|3651|3651| 		this.orderQueue.unshift(order);
|3652|3652| 		this.order = order;
|3653|3653| 		let ret = this.UnitFsm.ProcessMessage(this,
|3654|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3654|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3655|3655| 		);
|3656|3656| 
|3657|3657| 		// 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
|3685|3685| 				continue;
|3686|3686| 			if (this.orderQueue[i].type == type)
|3687|3687| 				continue;
|3688|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3688|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3689|3689| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3690|3690| 			return;
|3691|3691| 		}
|    | [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
|3685|3685| 				continue;
|3686|3686| 			if (this.orderQueue[i].type == type)
|3687|3687| 				continue;
|3688|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3688|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3689|3689| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3690|3690| 			return;
|3691|3691| 		}
|    | [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
|3699|3699| {
|3700|3700| 	// Remember the previous work orders to be able to go back to them later if required
|3701|3701| 	if (data && data.force)
|3702|    |-	{
|    |3702|+	
|3703|3703| 		if (this.IsFormationController())
|3704|3704| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3705|3705| 		else
|3706|3706| 			this.UpdateWorkOrders(type);
|3707|    |-	}
|    |3707|+	
|3708|3708| 
|3709|3709| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3710|3710| 
|    | [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
|3776|3776| 	{
|3777|3777| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3778|3778| 		if (cmpUnitAI)
|3779|    |-		{
|    |3779|+		
|3780|3780| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3781|3781| 			{
|3782|3782| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3785|3785| 					return;
|3786|3786| 				}
|3787|3787| 			}
|3788|    |-		}
|    |3788|+		
|3789|3789| 	}
|3790|3790| 
|3791|3791| 	// 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
|3778|3778| 		if (cmpUnitAI)
|3779|3779| 		{
|3780|3780| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3781|    |-			{
|    |3781|+			
|3782|3782| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3783|3783| 				{
|3784|3784| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3785|3785| 					return;
|3786|3786| 				}
|3787|    |-			}
|    |3787|+			
|3788|3788| 		}
|3789|3789| 	}
|3790|3790| 
|    | [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
|3790|3790| 
|3791|3791| 	// If nothing found, take the unit orders
|3792|3792| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3793|    |-	{
|    |3793|+	
|3794|3794| 		if (isWorkType(this.orderQueue[i].type))
|3795|3795| 		{
|3796|3796| 			this.workOrders = this.orderQueue.slice(i);
|3797|3797| 			return;
|3798|3798| 		}
|3799|    |-	}
|    |3799|+	
|3800|3800| };
|3801|3801| 
|3802|3802| 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
|3856|3856| 	if (data.timerRepeat === undefined)
|3857|3857| 		this.timer = undefined;
|3858|3858| 
|3859|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3859|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3860|3860| };
|3861|3861| 
|3862|3862| /**
|    | [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
|3856|3856| 	if (data.timerRepeat === undefined)
|3857|3857| 		this.timer = undefined;
|3858|3858| 
|3859|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3859|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3860|3860| };
|3861|3861| 
|3862|3862| /**
|    | [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
|3891|3891| 	this.timer = undefined;
|3892|3892| };
|3893|3893| 
|3894|    |-//// Message handlers /////
|    |3894|+// // Message handlers /////
|3895|3895| 
|3896|3896| UnitAI.prototype.OnMotionChanged = function(msg)
|3897|3897| {
|    | [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
|3896|3896| UnitAI.prototype.OnMotionChanged = function(msg)
|3897|3897| {
|3898|3898| 	if (msg.starting && !msg.error)
|3899|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3899|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3900|3900| 	else if (!msg.starting || msg.error)
|3901|3901| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3902|3902| };
|    | [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
|3896|3896| UnitAI.prototype.OnMotionChanged = function(msg)
|3897|3897| {
|3898|3898| 	if (msg.starting && !msg.error)
|3899|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3899|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3900|3900| 	else if (!msg.starting || msg.error)
|3901|3901| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3902|3902| };
|    | [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
|3898|3898| 	if (msg.starting && !msg.error)
|3899|3899| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3900|3900| 	else if (!msg.starting || msg.error)
|3901|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3901|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3902|3902| };
|3903|3903| 
|3904|3904| 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
|3898|3898| 	if (msg.starting && !msg.error)
|3899|3899| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3900|3900| 	else if (!msg.starting || msg.error)
|3901|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3901|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3902|3902| };
|3903|3903| 
|3904|3904| 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
|3906|3906| 	// TODO: This is a bit inefficient since every unit listens to every
|3907|3907| 	// construction message - ideally we could scope it to only the one we're building
|3908|3908| 
|3909|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3909|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3910|3910| };
|3911|3911| 
|3912|3912| 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
|3906|3906| 	// TODO: This is a bit inefficient since every unit listens to every
|3907|3907| 	// construction message - ideally we could scope it to only the one we're building
|3908|3908| 
|3909|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3909|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3910|3910| };
|3911|3911| 
|3912|3912| 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
|3931|3931| 
|3932|3932| UnitAI.prototype.OnAttacked = function(msg)
|3933|3933| {
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3931|3931| 
|3932|3932| UnitAI.prototype.OnAttacked = function(msg)
|3933|3933| {
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3936|3936| 
|3937|3937| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3938|3938| {
|3939|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3939|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3940|3940| };
|3941|3941| 
|3942|3942| 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
|3936|3936| 
|3937|3937| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3938|3938| {
|3939|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3939|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3940|3940| };
|3941|3941| 
|3942|3942| 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
|3941|3941| 
|3942|3942| UnitAI.prototype.OnHealthChanged = function(msg)
|3943|3943| {
|3944|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3944|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3945|3945| };
|3946|3946| 
|3947|3947| 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
|3941|3941| 
|3942|3942| UnitAI.prototype.OnHealthChanged = function(msg)
|3943|3943| {
|3944|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3944|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3945|3945| };
|3946|3946| 
|3947|3947| 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
|3947|3947| UnitAI.prototype.OnRangeUpdate = function(msg)
|3948|3948| {
|3949|3949| 	if (msg.tag == this.losRangeQuery)
|3950|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3950|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3951|3951| 	else if (msg.tag == this.losHealRangeQuery)
|3952|3952| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3953|3953| };
|    | [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
|3947|3947| UnitAI.prototype.OnRangeUpdate = function(msg)
|3948|3948| {
|3949|3949| 	if (msg.tag == this.losRangeQuery)
|3950|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3950|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3951|3951| 	else if (msg.tag == this.losHealRangeQuery)
|3952|3952| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3953|3953| };
|    | [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| 	if (msg.tag == this.losRangeQuery)
|3950|3950| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3951|3951| 	else if (msg.tag == this.losHealRangeQuery)
|3952|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3952|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3949|3949| 	if (msg.tag == this.losRangeQuery)
|3950|3950| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3951|3951| 	else if (msg.tag == this.losHealRangeQuery)
|3952|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3952|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3954|3954| 
|3955|3955| UnitAI.prototype.OnPackFinished = function(msg)
|3956|3956| {
|3957|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3957|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3958|3958| };
|3959|3959| 
|3960|3960| //// 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
|3954|3954| 
|3955|3955| UnitAI.prototype.OnPackFinished = function(msg)
|3956|3956| {
|3957|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3957|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3958|3958| };
|3959|3959| 
|3960|3960| //// 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
|3957|3957| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3958|3958| };
|3959|3959| 
|3960|    |-//// Helper functions to be called by the FSM ////
|    |3960|+// // Helper functions to be called by the FSM ////
|3961|3961| 
|3962|3962| UnitAI.prototype.GetWalkSpeed = function()
|3963|3963| {
|    | [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
|4061|4061| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4062|4062| 		return undefined;
|4063|4063| 
|4064|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4064|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4065|4065| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4066|4066| 		return undefined;
|4067|4067| 
|    | [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
|4146|4146| 			PlaySound(name, member);
|4147|4147| 	}
|4148|4148| 	else
|4149|    |-	{
|    |4149|+	
|4150|4150| 		// Otherwise use our own sounds
|4151|4151| 		PlaySound(name, this.entity);
|4152|    |-	}
|    |4152|+	
|4153|4153| };
|4154|4154| 
|4155|4155| /*
|    | [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
|4315|4315| 	else
|4316|4316| 		// return false? Or hope you come close enough?
|4317|4317| 		var parabolicMaxRange = 0;
|4318|    |-		//return false;
|    |4318|+		// return false;
|4319|4319| 
|4320|4320| 	// the parabole changes while walking, take something in the middle
|4321|4321| 	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
|4380|4380| 	if (this.IsFormationMember())
|4381|4381| 	{
|4382|4382| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4383|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4384|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4383|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4384|+			cmpFormationUnitAI.order.data.target == target)
|4385|4385| 			return true;
|4386|4386| 	}
|4387|4387| 
|    | [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
|4548|4548| UnitAI.prototype.AttackEntityInZone = function(ents)
|4549|4549| {
|4550|4550| 	var target = ents.find(target =>
|4551|    |-		this.CanAttack(target)
|4552|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4551|+		this.CanAttack(target) &&
|    |4552|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4553|4553| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4554|4554| 	);
|4555|4555| 	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
|4549|4549| {
|4550|4550| 	var target = ents.find(target =>
|4551|4551| 		this.CanAttack(target)
|4552|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4553|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4552|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4553|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4554|4554| 	);
|4555|4555| 	if (!target)
|4556|4556| 		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
|4613|4613| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4614|4614| 	if (this.isGuardOf)
|4615|4615| 	{
|4616|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4616|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4617|4617| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4618|4618| 		if (cmpUnitAI && cmpAttack &&
|4619|4619| 		    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
|4617|4617| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4618|4618| 		if (cmpUnitAI && cmpAttack &&
|4619|4619| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4620|    |-				return false;
|    |4620|+			return false;
|4621|4621| 	}
|4622|4622| 
|4623|4623| 	// 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
|4622|4622| 
|4623|4623| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4624|4624| 	if (this.GetStance().respondHoldGround)
|4625|    |-	{
|    |4625|+	
|4626|4626| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4627|4627| 			return true;
|4628|    |-	}
|    |4628|+	
|4629|4629| 
|4630|4630| 	// Stop if it's left our vision range, unless we're especially persistent
|4631|4631| 	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
|4629|4629| 
|4630|4630| 	// Stop if it's left our vision range, unless we're especially persistent
|4631|4631| 	if (!this.GetStance().respondChaseBeyondVision)
|4632|    |-	{
|    |4632|+	
|4633|4633| 		if (!this.CheckTargetIsInVisionRange(target))
|4634|4634| 			return true;
|4635|    |-	}
|    |4635|+	
|4636|4636| 
|4637|4637| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4638|4638| 	// 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
|4655|4655| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4656|4656| 	if (this.isGuardOf)
|4657|4657| 	{
|4658|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4658|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4659|4659| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4660|4660| 		if (cmpUnitAI && cmpAttack &&
|4661|4661| 		    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
|4668|4668| 	return false;
|4669|4669| };
|4670|4670| 
|4671|    |-//// External interface functions ////
|    |4671|+// // External interface functions ////
|4672|4672| 
|4673|4673| UnitAI.prototype.SetFormationController = function(ent)
|4674|4674| {
|    | [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
|4678|4678| 	// of our own formation (or ourself if not in formation)
|4679|4679| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4680|4680| 	if (cmpObstruction)
|4681|    |-	{
|    |4681|+	
|4682|4682| 		if (ent == INVALID_ENTITY)
|4683|4683| 			cmpObstruction.SetControlGroup(this.entity);
|4684|4684| 		else
|4685|4685| 			cmpObstruction.SetControlGroup(ent);
|4686|    |-	}
|    |4686|+	
|4687|4687| 
|4688|4688| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4689|4689| 	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
|4821|4821| 	// if we already had an old guard order, do nothing if the target is the same
|4822|4822| 	// and the order is running, otherwise remove the previous order
|4823|4823| 	if (this.isGuardOf)
|4824|    |-	{
|    |4824|+	
|4825|4825| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4826|4826| 			return;
|4827|4827| 		else
|4828|4828| 			this.RemoveGuard();
|4829|    |-	}
|    |4829|+	
|4830|4830| 
|4831|4831| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4832|4832| };
|    | [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
|4824|4824| 	{
|4825|4825| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4826|4826| 			return;
|4827|    |-		else
|4828|    |-			this.RemoveGuard();
|    |4827|+		this.RemoveGuard();
|4829|4828| 	}
|4830|4829| 
|4831|4830| 	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
|4866|4866| 		return;
|4867|4867| 
|4868|4868| 	if (this.order.type == "Guard")
|4869|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4869|+		this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"});
|4870|4870| 	else
|4871|4871| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4872|4872| 			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
|4866|4866| 		return;
|4867|4867| 
|4868|4868| 	if (this.order.type == "Guard")
|4869|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4869|+		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" });
|4870|4870| 	else
|4871|4871| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4872|4872| 			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
|4995|4995| 			this.WalkToTarget(target, queued);
|4996|4996| 		return;
|4997|4997| 	}
|4998|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4998|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4999|4999| };
|5000|5000| 
|5001|5001| /**
|    | [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
|5144|5144| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5145|5145| 	{
|5146|5146| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5147|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5147|+		if (cmpTrader.HasBothMarkets() &&
|5148|5148| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5149|5149| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5150|5150| 		{
|    | [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
|5425|5425| 				{
|5426|5426| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5427|5427| 					var targetClasses = this.order.data.targetClasses;
|5428|    |-					if (targetClasses.attack && cmpIdentity
|5429|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5428|+					if (targetClasses.attack && cmpIdentity &&
|    |5429|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5430|5430| 						continue;
|5431|5431| 					if (targetClasses.avoid && cmpIdentity
|5432|5432| 						&& 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
|5428|5428| 					if (targetClasses.attack && cmpIdentity
|5429|5429| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5430|5430| 						continue;
|5431|    |-					if (targetClasses.avoid && cmpIdentity
|5432|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5431|+					if (targetClasses.avoid && cmpIdentity &&
|    |5432|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5433|5433| 						continue;
|5434|5434| 					// Only used by the AIs to prevent some choices of targets
|5435|5435| 					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
|5451|5451| 		{
|5452|5452| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5453|5453| 			var targetClasses = this.order.data.targetClasses;
|5454|    |-			if (cmpIdentity && targetClasses.attack
|5455|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5454|+			if (cmpIdentity && targetClasses.attack &&
|    |5455|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5456|5456| 				continue;
|5457|5457| 			if (cmpIdentity && targetClasses.avoid
|5458|5458| 				&& 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
|5454|5454| 			if (cmpIdentity && targetClasses.attack
|5455|5455| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5456|5456| 				continue;
|5457|    |-			if (cmpIdentity && targetClasses.avoid
|5458|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5457|+			if (cmpIdentity && targetClasses.avoid &&
|    |5458|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5459|5459| 				continue;
|5460|5460| 			// Only used by the AIs to prevent some choices of targets
|5461|5461| 			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
|5587|5587| 
|5588|5588| UnitAI.prototype.SetHeldPosition = function(x, z)
|5589|5589| {
|5590|    |-	this.heldPosition = {"x": x, "z": z};
|    |5590|+	this.heldPosition = { "x": x, "z": z};
|5591|5591| };
|5592|5592| 
|5593|5593| 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
|5587|5587| 
|5588|5588| UnitAI.prototype.SetHeldPosition = function(x, z)
|5589|5589| {
|5590|    |-	this.heldPosition = {"x": x, "z": z};
|    |5590|+	this.heldPosition = {"x": x, "z": z };
|5591|5591| };
|5592|5592| 
|5593|5593| 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
|5614|5614| 	return false;
|5615|5615| };
|5616|5616| 
|5617|    |-//// Helper functions ////
|    |5617|+// // Helper functions ////
|5618|5618| 
|5619|5619| UnitAI.prototype.CanAttack = function(target)
|5620|5620| {
|    | [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
|5818|5818| 	return cmpPack && cmpPack.IsPacking();
|5819|5819| };
|5820|5820| 
|5821|    |-//// Formation specific functions ////
|    |5821|+// // Formation specific functions ////
|5822|5822| 
|5823|5823| UnitAI.prototype.IsAttackingAsFormation = function()
|5824|5824| {
|    | [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
|5823|5823| UnitAI.prototype.IsAttackingAsFormation = function()
|5824|5824| {
|5825|5825| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5826|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5827|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5826|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5827|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5828|5828| };
|5829|5829| 
|5830|5830| //// 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
|5827|5827| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5828|5828| };
|5829|5829| 
|5830|    |-//// Animal specific functions ////
|    |5830|+// // Animal specific functions ////
|5831|5831| 
|5832|5832| UnitAI.prototype.MoveRandomly = function(distance)
|5833|5833| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2403| »   »   »   »   »   »   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
|3761| »   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
|4535| »   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
|4550| »   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
|4596| »   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
|4619| »   »   ····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
|5075| »   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
| 365| »   »   ····&&·(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
|1876| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2012| »   »   »   »   »   »   &&·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
|2096| »   »   »   »   »   »   »   »   ·&&·((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
|2097| »   »   »   »   »   »   »   »   ·||·(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
|2098| »   »   »   »   »   »   »   »   ·&&·(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
|2121| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2161| »   »   »   »   »   »   »   »   &&·((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
|2162| »   »   »   »   »   »   »   »   ||·(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
|2163| »   »   »   »   »   »   »   »   &&·(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
|2208| »   »   »   »   »   »   »   ||·(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
|2209| »   »   »   »   »   »   »   &&·(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
|2225| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2417| »   »   »   »   »   »   »   ||·(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
|2418| »   »   »   »   »   »   »   &&·(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
|2438| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4328| »   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
|4384| »   »   »   &&·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
|4552| »   »   &&·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
|4553| »   »   &&·(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
|5075| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

binaries/data/mods/public/simulation/components/UnitAI.js
|5429| »   »   »   »   »   »   &&·!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
|5432| »   »   »   »   »   »   &&·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
|5445| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5455| »   »   »   »   &&·!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
|5458| »   »   »   »   &&·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
|5533| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5544| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [MAJOR] JSHintBear:
|    | Too many errors. (93% scanned).

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

we have a minimum member count when creating a formation, but nothing when units are removed, so you can have a formation with only one member

That test should be added then eventually and we should have simple ticket or patch so we don't forget it.

In D1423#58849, @temple wrote:

Fix a huge bug that prevented units from picking new targets. (How does such a bug exist for so long?)

Great find!

About the formation debugging patch, you should commit the VisualActor template update and commit the comment-edout the Selectable addition.
Adding the commented-out identity would allow us to have that undeletable and not add the additional conditions that are always true in the release.
The generic name could be "Unit" in the commented out version as a precaution, even though the string extraction script at source/tools/i18n/extractors/extractors.py only parses the XML nodes, not the comments.
The order of comments and component templates should be that what the templatessorter tool creates.

source/tools/templatessorter$ sh templatessorter.sh ../../../binaries/data/mods/public/simulation/templates/

Indeed the tool puts the comments to the top of the file. On the other hand that might be a bug in the script, because it breaks the order of the special filter templates.

I accept the behavior I notice in the game with the UnitAI change, so I would be ok with that being committed. But I don't know if there are unintended consequences.

(So there are 4 commits to be found for this revision proposal)

binaries/data/mods/public/simulation/components/Formation.js
176 ↗(On Diff #6359)

Logically independent of the described change and fixes a very grave bug, worth a separate grave / commit.

Unfortunately having this line can trigger a SEGFAULT by something calling GetPosition2D that it may not (here the only non-spidermonkey line of the stacktrace):

#17 ScriptInterface::callMethodConst<CFixedVector2D, &class_ICmpPosition, ICmpPosition, &(ICmpPosition::GetPosition2D() const)> (cx=0x12da430, argc=<optimized out>, vp=0x7fffff7ff988)
    at ../../../source/scriptinterface/NativeWrapperDefns.h:165

I do recall fatherbushido posting on the recent IsInWorld commit that there were some more missing checks in this file.

r21690:

binaries/data/mods/public/simulation/components/FormationAttack.js
61 ↗(On Diff #6359)

This also appears to be a change independent from the UnitAI one and I'm not sure if this is the more important one as I couldn't reproduce a problem with the mindistance with the few tries I did. Probably committable.
(Also I wonder how a gameplay designer figures out that this was a design decision to have a min distance if he doesn't know any code and doesn't read anything on trac irc or here)

temple added inline comments.Apr 11 2018, 9:52 PM
binaries/data/mods/public/simulation/components/Formation.js
176 ↗(On Diff #6359)

It's an UnitAI infinite loop. We find the closest member of a formation to attack, for some reason we can't attack it, so then we find a new closest member of the formation, but that's the same entity again, so it repeats. (Previously the closest member search always came up empty.)

temple added inline comments.Apr 11 2018, 10:14 PM
binaries/data/mods/public/simulation/components/Formation.js
176 ↗(On Diff #6359)

In this particular case, he was 23.9m from the target and not in target attack range because that adjusted for the elevation and put the distance at 23.8m, but to chase and move to target range used the 24m distance so it said he was already within range. Thus the attack failed and he tried to find a new target.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 12 2018, 2:27 AM
This revision was automatically updated to reflect the committed changes.
In D1423#58946, @elexis wrote:

(So there are 4 commits to be found for this revision proposal)

Thanks for the review. I committed two here, one in D1447, and wrote the fourth as ticket #5120 (and member count as #5119).