Page MenuHomeWildfire Games

Return Gathering to A23 behaviour
ClosedPublic

Authored by wraitii on Jul 2 2019, 8:44 PM.

Details

Reviewers
elexis
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22428: Return Gathering to A23 behaviour - Make units try to gather near the target…
Trac Tickets
#5477
Summary

Reported in #5477.
Units with to Gathering when there is a problem in APPROACHING or WALKING states, which means they look for resources near their current position instead of near the target's position.

There's a few ways to fix this, but it seems convenient to use the WALKING state until units get close to the resource's last known position and _then_ switch to GATHERING to find new resources to gather from.

Test Plan

Order units to gather from trees that are far away.

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

wraitii created this revision.Jul 2 2019, 8:44 PM

Further, initPos had been deleted, which broke the gathering code too.

elexis added a comment.Jul 2 2019, 8:47 PM

From #5477:

The reason is that rP22342 switched units to GATHERING right away, which changed behaviour in ways I didn't anticipate.

Vulcan added a comment.Jul 2 2019, 8:51 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 517| 517| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 518| 518| 				}
| 519| 519| 				else
| 520|    |-				{
|    | 520|+				
| 521| 521| 					// We couldn't move there, or the target moved away
| 522| 522| 					this.FinishOrder();
| 523|    |-				}
|    | 523|+				
| 524| 524| 				return;
| 525| 525| 			}
| 526| 526| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 734| 734| 			}
| 735| 735| 			// Check if we are already in range, otherwise walk there
| 736| 736| 			if (!this.CheckGarrisonRange(msg.data.target))
| 737|    |-			{
|    | 737|+			
| 738| 738| 				if (!this.CheckTargetVisible(msg.data.target))
| 739| 739| 				{
| 740| 740| 					this.FinishOrder();
| 745| 745| 					this.SetNextState("GARRISON.APPROACHING");
| 746| 746| 					return;
| 747| 747| 				}
| 748|    |-			}
|    | 748|+			
| 749| 749| 
| 750| 750| 			this.SetNextState("GARRISON.GARRISONING");
| 751| 751| 		},
|    | [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
| 740| 740| 					this.FinishOrder();
| 741| 741| 					return;
| 742| 742| 				}
| 743|    |-				else
| 744|    |-				{
|    | 743|+				
| 745| 744| 					this.SetNextState("GARRISON.APPROACHING");
| 746| 745| 					return;
| 747|    |-				}
|    | 746|+				
| 748| 747| 			}
| 749| 748| 
| 750| 749| 			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
| 763| 763| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 764| 764| 					}
| 765| 765| 					else
| 766|    |-					{
|    | 766|+					
| 767| 767| 						// We couldn't move there, or the target moved away
| 768| 768| 						this.FinishOrder();
| 769|    |-					}
|    | 769|+					
| 770| 770| 					return;
| 771| 771| 				}
| 772| 772| 
|    | [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
| 996| 996| 			},
| 997| 997| 		},
| 998| 998| 
| 999|    |-		"GARRISON":{
|    | 999|+		"GARRISON": {
|1000|1000| 			"enter": function() {
|1001|1001| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1002|1002| 				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
|1209|1209| 			// If the controller handled an order but some members rejected it,
|1210|1210| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1211|1211| 			if (this.orderQueue.length)
|1212|    |-			{
|    |1212|+			
|1213|1213| 				// We're leaving the formation, so stop our FormationWalk order
|1214|1214| 				if (this.FinishOrder())
|1215|1215| 					return;
|1216|    |-			}
|    |1216|+			
|1217|1217| 
|1218|1218| 			// No orders left, we're an individual now
|1219|1219| 			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
|1237|1237| 			// Move a tile outside the building
|1238|1238| 			let range = 4;
|1239|1239| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1240|    |-			{
|    |1240|+			
|1241|1241| 				// We are already at the target, or can't move at all
|1242|1242| 				this.FinishOrder();
|1243|    |-			}
|    |1243|+			
|1244|1244| 			else
|1245|1245| 			{
|1246|1246| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1458|1458| 
|1459|1459| 			"LosRangeUpdate": function(msg) {
|1460|1460| 				if (this.GetStance().targetVisibleEnemies)
|1461|    |-				{
|    |1461|+				
|1462|1462| 					// Start attacking one of the newly-seen enemy (if any)
|1463|1463| 					this.AttackEntitiesByPreference(msg.data.added);
|1464|    |-				}
|    |1464|+				
|1465|1465| 			},
|1466|1466| 
|1467|1467| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1491|1491| 				this.SelectAnimation("move");
|1492|1492| 			},
|1493|1493| 
|1494|    |-			"leave": function () {
|    |1494|+			"leave": function() {
|1495|1495| 				this.SelectAnimation("idle");
|1496|1496| 				this.StopMoving();
|1497|1497| 			},
|    | [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
|1671|1671| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1672|1672| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1673|1673| 						if (cmpHealth && cmpHealth.IsInjured())
|1674|    |-						{
|    |1674|+						
|1675|1675| 							if (this.CanHeal(this.isGuardOf))
|1676|1676| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1677|1677| 							else if (this.CanRepair(this.isGuardOf))
|1678|1678| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1679|    |-						}
|    |1679|+						
|1680|1680| 					}
|1681|1681| 				},
|1682|1682| 
|    | [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
|1955|1955| 
|1956|1956| 				"Attacked": function(msg) {
|1957|1957| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1958|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1959|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1958|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1959|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1960|1960| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1961|1961| 				},
|1962|1962| 			},
|    | [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
|2008|2008| 					this.SelectAnimation("move");
|2009|2009| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2010|2010| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2011|    |-					{
|    |2011|+					
|2012|2012| 						// Run after a fleeing target
|2013|2013| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2014|    |-					}
|    |2014|+					
|2015|2015| 					this.StartTimer(1000, 1000);
|2016|2016| 				},
|2017|2017| 
|    | [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
|2202|2202| 
|2203|2203| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2204|2204| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2205|    |-					{
|    |2205|+					
|2206|2206| 						// Check we can still reach and gather from the target
|2207|2207| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2208|2208| 						{
|2265|2265| 								return;
|2266|2266| 							}
|2267|2267| 						}
|2268|    |-					}
|    |2268|+					
|2269|2269| 
|2270|2270| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2271|2271| 
|    | [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
|2291|2291| 					// Also don't switch to a different type of huntable animal
|2292|2292| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2293|2293| 						return (
|2294|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2295|    |-							|| (type.specific == resourceType.specific
|    |2294|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2295|+							(type.specific == resourceType.specific
|2296|2296| 							&& (type.specific != "meat" || resourceTemplate == template))
|2297|2297| 						);
|2298|2298| 					});
|    | [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
|2292|2292| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2293|2293| 						return (
|2294|2294| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2295|    |-							|| (type.specific == resourceType.specific
|2296|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2295|+							|| (type.specific == resourceType.specific &&
|    |2296|+							(type.specific != "meat" || resourceTemplate == template))
|2297|2297| 						);
|2298|2298| 					});
|2299|2299| 					if (nearby)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2357|2357| 
|2358|2358| 				"Timer": function(msg) {
|2359|2359| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2360|    |-					{
|    |2360|+					
|2361|2361| 						// Return to our original position unless we have a better order.
|2362|2362| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2363|2363| 							this.WalkToHeldPosition();
|2364|    |-					}
|    |2364|+					
|2365|2365| 				},
|2366|2366| 
|2367|2367| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2391|2391| 					this.StartTimer(prepare, this.healTimers.repeat);
|2392|2392| 
|2393|2393| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2394|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2394|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2395|2395| 
|2396|2396| 					this.FaceTowardsTarget(this.order.data.target);
|2397|2397| 				},
|    | [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
|2603|2603| 					{
|2604|2604| 						// The building was already finished/fully repaired before we arrived;
|2605|2605| 						// let the ConstructionFinished handler handle this.
|2606|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2606|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2607|2607| 						return true;
|2608|2608| 					}
|2609|2609| 
|    | [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
|2603|2603| 					{
|2604|2604| 						// The building was already finished/fully repaired before we arrived;
|2605|2605| 						// let the ConstructionFinished handler handle this.
|2606|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2606|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2607|2607| 						return true;
|2608|2608| 					}
|2609|2609| 
|    | [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
|2730|2730| 
|2731|2731| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2732|2732| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2733|    |-				{
|    |2733|+				
|2734|2734| 					// We're already walking to the given point, so add this as a order.
|2735|2735| 					this.WalkToTarget(msg.data.newentity, true);
|2736|    |-				}
|    |2736|+				
|2737|2737| 			},
|2738|2738| 		},
|2739|2739| 
|    | [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
|2792|2792| 
|2793|2793| 					// Check that we can garrison here
|2794|2794| 					if (this.CanGarrison(target))
|2795|    |-					{
|    |2795|+					
|2796|2796| 						// Check that we're in range of the garrison target
|2797|2797| 						if (this.CheckGarrisonRange(target))
|2798|2798| 						{
|2868|2868| 								return false;
|2869|2869| 							}
|2870|2870| 						}
|2871|    |-					}
|    |2871|+					
|2872|2872| 					// Garrisoning failed for some reason, so finish the order
|2873|2873| 					this.FinishOrder();
|2874|2874| 					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
|2989|2989| 		"Attacked": function(msg) {
|2990|2990| 			if (this.template.NaturalBehaviour == "skittish" ||
|2991|2991| 			    this.template.NaturalBehaviour == "passive")
|2992|    |-			{
|    |2992|+			
|2993|2993| 				this.Flee(msg.data.attacker, false);
|2994|    |-			}
|    |2994|+			
|2995|2995| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2996|2996| 			{
|2997|2997| 				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
|2998|2998| 					this.Attack(msg.data.attacker, false);
|2999|2999| 			}
|3000|3000| 			else if (this.template.NaturalBehaviour == "domestic")
|3001|    |-			{
|    |3001|+			
|3002|3002| 				// Never flee, stop what we were doing
|3003|3003| 				this.SetNextState("IDLE");
|3004|    |-			}
|    |3004|+			
|3005|3005| 		},
|3006|3006| 
|3007|3007| 		"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
|3053|3053| 				}
|3054|3054| 				// Start attacking one of the newly-seen enemy (if any)
|3055|3055| 				else if (this.IsDangerousAnimal())
|3056|    |-				{
|    |3056|+				
|3057|3057| 					this.AttackVisibleEntity(msg.data.added);
|3058|    |-				}
|    |3058|+				
|3059|3059| 
|3060|3060| 				// TODO: if two units enter our range together, we'll attack the
|3061|3061| 				// 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
|3096|3096| 				}
|3097|3097| 				// Start attacking one of the newly-seen enemy (if any)
|3098|3098| 				else if (this.template.NaturalBehaviour == "violent")
|3099|    |-				{
|    |3099|+				
|3100|3100| 					this.AttackVisibleEntity(msg.data.added);
|3101|    |-				}
|    |3101|+				
|3102|3102| 			},
|3103|3103| 
|3104|3104| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3111|3111| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3112|3112| 
|3113|3113| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3114|    |-							// only used for domestic animals
|    |3114|+		// only used for domestic animals
|3115|3115| 	},
|3116|3116| };
|3117|3117| 
|    | [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
|3168|3168| 
|3169|3169| UnitAI.prototype.IsAnimal = function()
|3170|3170| {
|3171|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3171|+	return (!!this.template.NaturalBehaviour);
|3172|3172| };
|3173|3173| 
|3174|3174| 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
|3206|3206| UnitAI.prototype.GetGarrisonHolder = function()
|3207|3207| {
|3208|3208| 	if (this.IsGarrisoned())
|3209|    |-	{
|    |3209|+	
|3210|3210| 		for (let order of this.orderQueue)
|3211|3211| 			if (order.type == "Garrison")
|3212|3212| 				return order.data.target;
|3213|    |-	}
|    |3213|+	
|3214|3214| 	return INVALID_ENTITY;
|3215|3215| };
|3216|3216| 
|    | [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
|3284|3284| 		{
|3285|3285| 			let index = this.GetCurrentState().indexOf(".");
|3286|3286| 			if (index != -1)
|3287|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3287|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3288|3288| 			this.Stop(false);
|3289|3289| 		}
|3290|3290| 
|    | [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
|3340|3340| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3341|3341| 			continue;
|3342|3342| 		if (i == 0)
|3343|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3343|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3344|3344| 		else
|3345|3345| 			this.orderQueue.splice(i, 1);
|3346|3346| 		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
|3340|3340| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3341|3341| 			continue;
|3342|3342| 		if (i == 0)
|3343|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3343|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3344|3344| 		else
|3345|3345| 			this.orderQueue.splice(i, 1);
|3346|3346| 		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
|3424|3424| };
|3425|3425| 
|3426|3426| 
|3427|    |-//// FSM linkage functions ////
|    |3427|+// // FSM linkage functions ////
|3428|3428| 
|3429|3429| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3430|3430| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3596|3596| 				continue;
|3597|3597| 			if (this.orderQueue[i].type == type)
|3598|3598| 				continue;
|3599|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3599|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3600|3600| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3601|3601| 			return;
|3602|3602| 		}
|    | [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
|3596|3596| 				continue;
|3597|3597| 			if (this.orderQueue[i].type == type)
|3598|3598| 				continue;
|3599|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3599|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3600|3600| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3601|3601| 			return;
|3602|3602| 		}
|    | [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
|3610|3610| {
|3611|3611| 	// Remember the previous work orders to be able to go back to them later if required
|3612|3612| 	if (data && data.force)
|3613|    |-	{
|    |3613|+	
|3614|3614| 		if (this.IsFormationController())
|3615|3615| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3616|3616| 		else
|3617|3617| 			this.UpdateWorkOrders(type);
|3618|    |-	}
|    |3618|+	
|3619|3619| 
|3620|3620| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3621|3621| 
|    | [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
|3687|3687| 	{
|3688|3688| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3689|3689| 		if (cmpUnitAI)
|3690|    |-		{
|    |3690|+		
|3691|3691| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3692|3692| 			{
|3693|3693| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3696|3696| 					return;
|3697|3697| 				}
|3698|3698| 			}
|3699|    |-		}
|    |3699|+		
|3700|3700| 	}
|3701|3701| 
|3702|3702| 	// 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
|3689|3689| 		if (cmpUnitAI)
|3690|3690| 		{
|3691|3691| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3692|    |-			{
|    |3692|+			
|3693|3693| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3694|3694| 				{
|3695|3695| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3696|3696| 					return;
|3697|3697| 				}
|3698|    |-			}
|    |3698|+			
|3699|3699| 		}
|3700|3700| 	}
|3701|3701| 
|    | [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
|3701|3701| 
|3702|3702| 	// If nothing found, take the unit orders
|3703|3703| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3704|    |-	{
|    |3704|+	
|3705|3705| 		if (isWorkType(this.orderQueue[i].type))
|3706|3706| 		{
|3707|3707| 			this.workOrders = this.orderQueue.slice(i);
|3708|3708| 			return;
|3709|3709| 		}
|3710|    |-	}
|    |3710|+	
|3711|3711| };
|3712|3712| 
|3713|3713| 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
|3767|3767| 	if (data.timerRepeat === undefined)
|3768|3768| 		this.timer = undefined;
|3769|3769| 
|3770|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3770|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3771|3771| };
|3772|3772| 
|3773|3773| /**
|    | [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
|3767|3767| 	if (data.timerRepeat === undefined)
|3768|3768| 		this.timer = undefined;
|3769|3769| 
|3770|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3770|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3771|3771| };
|3772|3772| 
|3773|3773| /**
|    | [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
|3802|3802| 	this.timer = undefined;
|3803|3803| };
|3804|3804| 
|3805|    |-//// Message handlers /////
|    |3805|+// // Message handlers /////
|3806|3806| 
|3807|3807| UnitAI.prototype.OnMotionChanged = function(msg)
|3808|3808| {
|    | [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
|3814|3814| 	// TODO: This is a bit inefficient since every unit listens to every
|3815|3815| 	// construction message - ideally we could scope it to only the one we're building
|3816|3816| 
|3817|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3817|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3818|3818| };
|3819|3819| 
|3820|3820| 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
|3814|3814| 	// TODO: This is a bit inefficient since every unit listens to every
|3815|3815| 	// construction message - ideally we could scope it to only the one we're building
|3816|3816| 
|3817|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3817|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3818|3818| };
|3819|3819| 
|3820|3820| 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
|3839|3839| 
|3840|3840| UnitAI.prototype.OnAttacked = function(msg)
|3841|3841| {
|3842|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3842|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3843|3843| };
|3844|3844| 
|3845|3845| 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
|3839|3839| 
|3840|3840| UnitAI.prototype.OnAttacked = function(msg)
|3841|3841| {
|3842|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3842|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3843|3843| };
|3844|3844| 
|3845|3845| 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
|3844|3844| 
|3845|3845| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3846|3846| {
|3847|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3847|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3848|3848| };
|3849|3849| 
|3850|3850| 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
|3844|3844| 
|3845|3845| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3846|3846| {
|3847|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3847|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3848|3848| };
|3849|3849| 
|3850|3850| 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
|3849|3849| 
|3850|3850| UnitAI.prototype.OnHealthChanged = function(msg)
|3851|3851| {
|3852|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3852|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3853|3853| };
|3854|3854| 
|3855|3855| 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
|3849|3849| 
|3850|3850| UnitAI.prototype.OnHealthChanged = function(msg)
|3851|3851| {
|3852|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3852|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3853|3853| };
|3854|3854| 
|3855|3855| 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
|3855|3855| UnitAI.prototype.OnRangeUpdate = function(msg)
|3856|3856| {
|3857|3857| 	if (msg.tag == this.losRangeQuery)
|3858|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3858|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3859|3859| 	else if (msg.tag == this.losHealRangeQuery)
|3860|3860| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3861|3861| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3855|3855| UnitAI.prototype.OnRangeUpdate = function(msg)
|3856|3856| {
|3857|3857| 	if (msg.tag == this.losRangeQuery)
|3858|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3858|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3859|3859| 	else if (msg.tag == this.losHealRangeQuery)
|3860|3860| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3861|3861| };
|    | [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
|3857|3857| 	if (msg.tag == this.losRangeQuery)
|3858|3858| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3859|3859| 	else if (msg.tag == this.losHealRangeQuery)
|3860|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3860|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3861|3861| };
|3862|3862| 
|3863|3863| 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
|3857|3857| 	if (msg.tag == this.losRangeQuery)
|3858|3858| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3859|3859| 	else if (msg.tag == this.losHealRangeQuery)
|3860|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3860|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3861|3861| };
|3862|3862| 
|3863|3863| 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
|3862|3862| 
|3863|3863| UnitAI.prototype.OnPackFinished = function(msg)
|3864|3864| {
|3865|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3865|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3866|3866| };
|3867|3867| 
|3868|3868| //// 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
|3862|3862| 
|3863|3863| UnitAI.prototype.OnPackFinished = function(msg)
|3864|3864| {
|3865|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3865|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3866|3866| };
|3867|3867| 
|3868|3868| //// 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
|3865|3865| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3866|3866| };
|3867|3867| 
|3868|    |-//// Helper functions to be called by the FSM ////
|    |3868|+// // Helper functions to be called by the FSM ////
|3869|3869| 
|3870|3870| UnitAI.prototype.GetWalkSpeed = function()
|3871|3871| {
|    | [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
|4052|4052| 			PlaySound(name, member);
|4053|4053| 	}
|4054|4054| 	else
|4055|    |-	{
|    |4055|+	
|4056|4056| 		// Otherwise use our own sounds
|4057|4057| 		PlaySound(name, this.entity);
|4058|    |-	}
|    |4058|+	
|4059|4059| };
|4060|4060| 
|4061|4061| /*
|    | [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
|4244|4244| 	else
|4245|4245| 		// return false? Or hope you come close enough?
|4246|4246| 		var parabolicMaxRange = 0;
|4247|    |-		//return false;
|    |4247|+		// return false;
|4248|4248| 
|4249|4249| 	// the parabole changes while walking, take something in the middle
|4250|4250| 	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
|4331|4331| 	if (this.IsFormationMember())
|4332|4332| 	{
|4333|4333| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4334|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4335|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4334|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4335|+			cmpFormationUnitAI.order.data.target == target)
|4336|4336| 			return true;
|4337|4337| 	}
|4338|4338| 
|    | [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
|4504|4504| UnitAI.prototype.AttackEntityInZone = function(ents)
|4505|4505| {
|4506|4506| 	var target = ents.find(target =>
|4507|    |-		this.CanAttack(target)
|4508|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4507|+		this.CanAttack(target) &&
|    |4508|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4509|4509| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4510|4510| 	);
|4511|4511| 	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
|4505|4505| {
|4506|4506| 	var target = ents.find(target =>
|4507|4507| 		this.CanAttack(target)
|4508|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4509|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4508|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4509|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4510|4510| 	);
|4511|4511| 	if (!target)
|4512|4512| 		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
|4569|4569| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4570|4570| 	if (this.isGuardOf)
|4571|4571| 	{
|4572|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4572|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4573|4573| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4574|4574| 		if (cmpUnitAI && cmpAttack &&
|4575|4575| 		    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
|4573|4573| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4574|4574| 		if (cmpUnitAI && cmpAttack &&
|4575|4575| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4576|    |-				return false;
|    |4576|+			return false;
|4577|4577| 	}
|4578|4578| 
|4579|4579| 	// 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
|4578|4578| 
|4579|4579| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4580|4580| 	if (this.GetStance().respondHoldGround)
|4581|    |-	{
|    |4581|+	
|4582|4582| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4583|4583| 			return true;
|4584|    |-	}
|    |4584|+	
|4585|4585| 
|4586|4586| 	// Stop if it's left our vision range, unless we're especially persistent
|4587|4587| 	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
|4585|4585| 
|4586|4586| 	// Stop if it's left our vision range, unless we're especially persistent
|4587|4587| 	if (!this.GetStance().respondChaseBeyondVision)
|4588|    |-	{
|    |4588|+	
|4589|4589| 		if (!this.CheckTargetIsInVisionRange(target))
|4590|4590| 			return true;
|4591|    |-	}
|    |4591|+	
|4592|4592| 
|4593|4593| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4594|4594| 	// 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
|4611|4611| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4612|4612| 	if (this.isGuardOf)
|4613|4613| 	{
|4614|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4614|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4615|4615| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4616|4616| 		if (cmpUnitAI && cmpAttack &&
|4617|4617| 		    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
|4624|4624| 	return false;
|4625|4625| };
|4626|4626| 
|4627|    |-//// External interface functions ////
|    |4627|+// // External interface functions ////
|4628|4628| 
|4629|4629| UnitAI.prototype.SetFormationController = function(ent)
|4630|4630| {
|    | [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
|4634|4634| 	// of our own formation (or ourself if not in formation)
|4635|4635| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4636|4636| 	if (cmpObstruction)
|4637|    |-	{
|    |4637|+	
|4638|4638| 		if (ent == INVALID_ENTITY)
|4639|4639| 			cmpObstruction.SetControlGroup(this.entity);
|4640|4640| 		else
|4641|4641| 			cmpObstruction.SetControlGroup(ent);
|4642|    |-	}
|    |4642|+	
|4643|4643| 
|4644|4644| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4645|4645| 	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
|4777|4777| 	// if we already had an old guard order, do nothing if the target is the same
|4778|4778| 	// and the order is running, otherwise remove the previous order
|4779|4779| 	if (this.isGuardOf)
|4780|    |-	{
|    |4780|+	
|4781|4781| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4782|4782| 			return;
|4783|4783| 		else
|4784|4784| 			this.RemoveGuard();
|4785|    |-	}
|    |4785|+	
|4786|4786| 
|4787|4787| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4788|4788| };
|    | [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
|4780|4780| 	{
|4781|4781| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4782|4782| 			return;
|4783|    |-		else
|4784|    |-			this.RemoveGuard();
|    |4783|+		this.RemoveGuard();
|4785|4784| 	}
|4786|4785| 
|4787|4786| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5112|5112| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5113|5113| 	{
|5114|5114| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5115|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5115|+		if (cmpTrader.HasBothMarkets() &&
|5116|5116| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5117|5117| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5118|5118| 		{
|    | [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
|5393|5393| 				{
|5394|5394| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5395|5395| 					var targetClasses = this.order.data.targetClasses;
|5396|    |-					if (targetClasses.attack && cmpIdentity
|5397|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5396|+					if (targetClasses.attack && cmpIdentity &&
|    |5397|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5398|5398| 						continue;
|5399|5399| 					if (targetClasses.avoid && cmpIdentity
|5400|5400| 						&& 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
|5396|5396| 					if (targetClasses.attack && cmpIdentity
|5397|5397| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5398|5398| 						continue;
|5399|    |-					if (targetClasses.avoid && cmpIdentity
|5400|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5399|+					if (targetClasses.avoid && cmpIdentity &&
|    |5400|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5401|5401| 						continue;
|5402|5402| 					// Only used by the AIs to prevent some choices of targets
|5403|5403| 					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
|5419|5419| 		{
|5420|5420| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5421|5421| 			var targetClasses = this.order.data.targetClasses;
|5422|    |-			if (cmpIdentity && targetClasses.attack
|5423|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5422|+			if (cmpIdentity && targetClasses.attack &&
|    |5423|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5424|5424| 				continue;
|5425|5425| 			if (cmpIdentity && targetClasses.avoid
|5426|5426| 				&& 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
|5422|5422| 			if (cmpIdentity && targetClasses.attack
|5423|5423| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5424|5424| 				continue;
|5425|    |-			if (cmpIdentity && targetClasses.avoid
|5426|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5425|+			if (cmpIdentity && targetClasses.avoid &&
|    |5426|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5427|5427| 				continue;
|5428|5428| 			// Only used by the AIs to prevent some choices of targets
|5429|5429| 			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
|5579|5579| 
|5580|5580| UnitAI.prototype.SetHeldPosition = function(x, z)
|5581|5581| {
|5582|    |-	this.heldPosition = {"x": x, "z": z};
|    |5582|+	this.heldPosition = { "x": x, "z": z};
|5583|5583| };
|5584|5584| 
|5585|5585| 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
|5579|5579| 
|5580|5580| UnitAI.prototype.SetHeldPosition = function(x, z)
|5581|5581| {
|5582|    |-	this.heldPosition = {"x": x, "z": z};
|    |5582|+	this.heldPosition = {"x": x, "z": z };
|5583|5583| };
|5584|5584| 
|5585|5585| 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
|5606|5606| 	return false;
|5607|5607| };
|5608|5608| 
|5609|    |-//// Helper functions ////
|    |5609|+// // Helper functions ////
|5610|5610| 
|5611|5611| UnitAI.prototype.CanAttack = function(target)
|5612|5612| {
|    | [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
|5810|5810| 	return cmpPack && cmpPack.IsPacking();
|5811|5811| };
|5812|5812| 
|5813|    |-//// Formation specific functions ////
|    |5813|+// // Formation specific functions ////
|5814|5814| 
|5815|5815| UnitAI.prototype.IsAttackingAsFormation = function()
|5816|5816| {
|    | [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
|5815|5815| UnitAI.prototype.IsAttackingAsFormation = function()
|5816|5816| {
|5817|5817| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5818|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5819|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5818|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5819|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5820|5820| };
|5821|5821| 
|5822|5822| //// 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
|5819|5819| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5820|5820| };
|5821|5821| 
|5822|    |-//// Animal specific functions ////
|    |5822|+// // Animal specific functions ////
|5823|5823| 
|5824|5824| UnitAI.prototype.MoveRandomly = function(distance)
|5825|5825| {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3672| »   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
|4491| »   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
|4506| »   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
|4552| »   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
|4575| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4257| »   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
|4335| »   »   »   &&·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
|4508| »   »   &&·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
|4509| »   »   &&·(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
|5397| »   »   »   »   »   »   &&·!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
|5400| »   »   »   »   »   »   &&·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
|5413| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

wraitii updated this revision to Diff 8694.Jul 2 2019, 10:29 PM

Better fix after some thinking: adapt FindNearbyResources to take a position, and use that in GATHERING.timer to find resources near the 'herd' instead of near our current position.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 517| 517| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 518| 518| 				}
| 519| 519| 				else
| 520|    |-				{
|    | 520|+				
| 521| 521| 					// We couldn't move there, or the target moved away
| 522| 522| 					this.FinishOrder();
| 523|    |-				}
|    | 523|+				
| 524| 524| 				return;
| 525| 525| 			}
| 526| 526| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 734| 734| 			}
| 735| 735| 			// Check if we are already in range, otherwise walk there
| 736| 736| 			if (!this.CheckGarrisonRange(msg.data.target))
| 737|    |-			{
|    | 737|+			
| 738| 738| 				if (!this.CheckTargetVisible(msg.data.target))
| 739| 739| 				{
| 740| 740| 					this.FinishOrder();
| 745| 745| 					this.SetNextState("GARRISON.APPROACHING");
| 746| 746| 					return;
| 747| 747| 				}
| 748|    |-			}
|    | 748|+			
| 749| 749| 
| 750| 750| 			this.SetNextState("GARRISON.GARRISONING");
| 751| 751| 		},
|    | [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
| 740| 740| 					this.FinishOrder();
| 741| 741| 					return;
| 742| 742| 				}
| 743|    |-				else
| 744|    |-				{
|    | 743|+				
| 745| 744| 					this.SetNextState("GARRISON.APPROACHING");
| 746| 745| 					return;
| 747|    |-				}
|    | 746|+				
| 748| 747| 			}
| 749| 748| 
| 750| 749| 			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
| 763| 763| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 764| 764| 					}
| 765| 765| 					else
| 766|    |-					{
|    | 766|+					
| 767| 767| 						// We couldn't move there, or the target moved away
| 768| 768| 						this.FinishOrder();
| 769|    |-					}
|    | 769|+					
| 770| 770| 					return;
| 771| 771| 				}
| 772| 772| 
|    | [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
| 996| 996| 			},
| 997| 997| 		},
| 998| 998| 
| 999|    |-		"GARRISON":{
|    | 999|+		"GARRISON": {
|1000|1000| 			"enter": function() {
|1001|1001| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1002|1002| 				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
|1209|1209| 			// If the controller handled an order but some members rejected it,
|1210|1210| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1211|1211| 			if (this.orderQueue.length)
|1212|    |-			{
|    |1212|+			
|1213|1213| 				// We're leaving the formation, so stop our FormationWalk order
|1214|1214| 				if (this.FinishOrder())
|1215|1215| 					return;
|1216|    |-			}
|    |1216|+			
|1217|1217| 
|1218|1218| 			// No orders left, we're an individual now
|1219|1219| 			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
|1237|1237| 			// Move a tile outside the building
|1238|1238| 			let range = 4;
|1239|1239| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1240|    |-			{
|    |1240|+			
|1241|1241| 				// We are already at the target, or can't move at all
|1242|1242| 				this.FinishOrder();
|1243|    |-			}
|    |1243|+			
|1244|1244| 			else
|1245|1245| 			{
|1246|1246| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1458|1458| 
|1459|1459| 			"LosRangeUpdate": function(msg) {
|1460|1460| 				if (this.GetStance().targetVisibleEnemies)
|1461|    |-				{
|    |1461|+				
|1462|1462| 					// Start attacking one of the newly-seen enemy (if any)
|1463|1463| 					this.AttackEntitiesByPreference(msg.data.added);
|1464|    |-				}
|    |1464|+				
|1465|1465| 			},
|1466|1466| 
|1467|1467| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1491|1491| 				this.SelectAnimation("move");
|1492|1492| 			},
|1493|1493| 
|1494|    |-			"leave": function () {
|    |1494|+			"leave": function() {
|1495|1495| 				this.SelectAnimation("idle");
|1496|1496| 				this.StopMoving();
|1497|1497| 			},
|    | [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
|1671|1671| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1672|1672| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1673|1673| 						if (cmpHealth && cmpHealth.IsInjured())
|1674|    |-						{
|    |1674|+						
|1675|1675| 							if (this.CanHeal(this.isGuardOf))
|1676|1676| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1677|1677| 							else if (this.CanRepair(this.isGuardOf))
|1678|1678| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1679|    |-						}
|    |1679|+						
|1680|1680| 					}
|1681|1681| 				},
|1682|1682| 
|    | [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
|1955|1955| 
|1956|1956| 				"Attacked": function(msg) {
|1957|1957| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1958|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1959|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1958|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1959|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1960|1960| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1961|1961| 				},
|1962|1962| 			},
|    | [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
|2008|2008| 					this.SelectAnimation("move");
|2009|2009| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2010|2010| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2011|    |-					{
|    |2011|+					
|2012|2012| 						// Run after a fleeing target
|2013|2013| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2014|    |-					}
|    |2014|+					
|2015|2015| 					this.StartTimer(1000, 1000);
|2016|2016| 				},
|2017|2017| 
|    | [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
|2346|2346| 
|2347|2347| 				"Timer": function(msg) {
|2348|2348| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2349|    |-					{
|    |2349|+					
|2350|2350| 						// Return to our original position unless we have a better order.
|2351|2351| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2352|2352| 							this.WalkToHeldPosition();
|2353|    |-					}
|    |2353|+					
|2354|2354| 				},
|2355|2355| 
|2356|2356| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2380|2380| 					this.StartTimer(prepare, this.healTimers.repeat);
|2381|2381| 
|2382|2382| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2383|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2383|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2384|2384| 
|2385|2385| 					this.FaceTowardsTarget(this.order.data.target);
|2386|2386| 				},
|    | [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
|2592|2592| 					{
|2593|2593| 						// The building was already finished/fully repaired before we arrived;
|2594|2594| 						// let the ConstructionFinished handler handle this.
|2595|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2595|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2596|2596| 						return true;
|2597|2597| 					}
|2598|2598| 
|    | [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
|2592|2592| 					{
|2593|2593| 						// The building was already finished/fully repaired before we arrived;
|2594|2594| 						// let the ConstructionFinished handler handle this.
|2595|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2595|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2596|2596| 						return true;
|2597|2597| 					}
|2598|2598| 
|    | [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
|2784|2784| 
|2785|2785| 					// Check that we can garrison here
|2786|2786| 					if (this.CanGarrison(target))
|2787|    |-					{
|    |2787|+					
|2788|2788| 						// Check that we're in range of the garrison target
|2789|2789| 						if (this.CheckGarrisonRange(target))
|2790|2790| 						{
|2860|2860| 								return false;
|2861|2861| 							}
|2862|2862| 						}
|2863|    |-					}
|    |2863|+					
|2864|2864| 					// Garrisoning failed for some reason, so finish the order
|2865|2865| 					this.FinishOrder();
|2866|2866| 					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
|2981|2981| 		"Attacked": function(msg) {
|2982|2982| 			if (this.template.NaturalBehaviour == "skittish" ||
|2983|2983| 			    this.template.NaturalBehaviour == "passive")
|2984|    |-			{
|    |2984|+			
|2985|2985| 				this.Flee(msg.data.attacker, false);
|2986|    |-			}
|    |2986|+			
|2987|2987| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2988|2988| 			{
|2989|2989| 				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
|2990|2990| 					this.Attack(msg.data.attacker, false);
|2991|2991| 			}
|2992|2992| 			else if (this.template.NaturalBehaviour == "domestic")
|2993|    |-			{
|    |2993|+			
|2994|2994| 				// Never flee, stop what we were doing
|2995|2995| 				this.SetNextState("IDLE");
|2996|    |-			}
|    |2996|+			
|2997|2997| 		},
|2998|2998| 
|2999|2999| 		"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
|3045|3045| 				}
|3046|3046| 				// Start attacking one of the newly-seen enemy (if any)
|3047|3047| 				else if (this.IsDangerousAnimal())
|3048|    |-				{
|    |3048|+				
|3049|3049| 					this.AttackVisibleEntity(msg.data.added);
|3050|    |-				}
|    |3050|+				
|3051|3051| 
|3052|3052| 				// TODO: if two units enter our range together, we'll attack the
|3053|3053| 				// 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
|3088|3088| 				}
|3089|3089| 				// Start attacking one of the newly-seen enemy (if any)
|3090|3090| 				else if (this.template.NaturalBehaviour == "violent")
|3091|    |-				{
|    |3091|+				
|3092|3092| 					this.AttackVisibleEntity(msg.data.added);
|3093|    |-				}
|    |3093|+				
|3094|3094| 			},
|3095|3095| 
|3096|3096| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3103|3103| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3104|3104| 
|3105|3105| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3106|    |-							// only used for domestic animals
|    |3106|+		// only used for domestic animals
|3107|3107| 	},
|3108|3108| };
|3109|3109| 
|    | [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
|3160|3160| 
|3161|3161| UnitAI.prototype.IsAnimal = function()
|3162|3162| {
|3163|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3163|+	return (!!this.template.NaturalBehaviour);
|3164|3164| };
|3165|3165| 
|3166|3166| 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
|3198|3198| UnitAI.prototype.GetGarrisonHolder = function()
|3199|3199| {
|3200|3200| 	if (this.IsGarrisoned())
|3201|    |-	{
|    |3201|+	
|3202|3202| 		for (let order of this.orderQueue)
|3203|3203| 			if (order.type == "Garrison")
|3204|3204| 				return order.data.target;
|3205|    |-	}
|    |3205|+	
|3206|3206| 	return INVALID_ENTITY;
|3207|3207| };
|3208|3208| 
|    | [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
|3276|3276| 		{
|3277|3277| 			let index = this.GetCurrentState().indexOf(".");
|3278|3278| 			if (index != -1)
|3279|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3279|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3280|3280| 			this.Stop(false);
|3281|3281| 		}
|3282|3282| 
|    | [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
|3332|3332| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3333|3333| 			continue;
|3334|3334| 		if (i == 0)
|3335|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3335|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3336|3336| 		else
|3337|3337| 			this.orderQueue.splice(i, 1);
|3338|3338| 		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
|3332|3332| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3333|3333| 			continue;
|3334|3334| 		if (i == 0)
|3335|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3335|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3336|3336| 		else
|3337|3337| 			this.orderQueue.splice(i, 1);
|3338|3338| 		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
|3416|3416| };
|3417|3417| 
|3418|3418| 
|3419|    |-//// FSM linkage functions ////
|    |3419|+// // FSM linkage functions ////
|3420|3420| 
|3421|3421| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3422|3422| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3588|3588| 				continue;
|3589|3589| 			if (this.orderQueue[i].type == type)
|3590|3590| 				continue;
|3591|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3591|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3592|3592| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3593|3593| 			return;
|3594|3594| 		}
|    | [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
|3588|3588| 				continue;
|3589|3589| 			if (this.orderQueue[i].type == type)
|3590|3590| 				continue;
|3591|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3591|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3592|3592| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3593|3593| 			return;
|3594|3594| 		}
|    | [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
|3602|3602| {
|3603|3603| 	// Remember the previous work orders to be able to go back to them later if required
|3604|3604| 	if (data && data.force)
|3605|    |-	{
|    |3605|+	
|3606|3606| 		if (this.IsFormationController())
|3607|3607| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3608|3608| 		else
|3609|3609| 			this.UpdateWorkOrders(type);
|3610|    |-	}
|    |3610|+	
|3611|3611| 
|3612|3612| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3613|3613| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3679|3679| 	{
|3680|3680| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3681|3681| 		if (cmpUnitAI)
|3682|    |-		{
|    |3682|+		
|3683|3683| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3684|3684| 			{
|3685|3685| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3688|3688| 					return;
|3689|3689| 				}
|3690|3690| 			}
|3691|    |-		}
|    |3691|+		
|3692|3692| 	}
|3693|3693| 
|3694|3694| 	// 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
|3681|3681| 		if (cmpUnitAI)
|3682|3682| 		{
|3683|3683| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3684|    |-			{
|    |3684|+			
|3685|3685| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3686|3686| 				{
|3687|3687| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3688|3688| 					return;
|3689|3689| 				}
|3690|    |-			}
|    |3690|+			
|3691|3691| 		}
|3692|3692| 	}
|3693|3693| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3693|3693| 
|3694|3694| 	// If nothing found, take the unit orders
|3695|3695| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3696|    |-	{
|    |3696|+	
|3697|3697| 		if (isWorkType(this.orderQueue[i].type))
|3698|3698| 		{
|3699|3699| 			this.workOrders = this.orderQueue.slice(i);
|3700|3700| 			return;
|3701|3701| 		}
|3702|    |-	}
|    |3702|+	
|3703|3703| };
|3704|3704| 
|3705|3705| 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
|3759|3759| 	if (data.timerRepeat === undefined)
|3760|3760| 		this.timer = undefined;
|3761|3761| 
|3762|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3762|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3763|3763| };
|3764|3764| 
|3765|3765| /**
|    | [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
|3759|3759| 	if (data.timerRepeat === undefined)
|3760|3760| 		this.timer = undefined;
|3761|3761| 
|3762|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3762|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3763|3763| };
|3764|3764| 
|3765|3765| /**
|    | [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
|3794|3794| 	this.timer = undefined;
|3795|3795| };
|3796|3796| 
|3797|    |-//// Message handlers /////
|    |3797|+// // Message handlers /////
|3798|3798| 
|3799|3799| UnitAI.prototype.OnMotionChanged = function(msg)
|3800|3800| {
|    | [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
|3806|3806| 	// TODO: This is a bit inefficient since every unit listens to every
|3807|3807| 	// construction message - ideally we could scope it to only the one we're building
|3808|3808| 
|3809|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3809|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3810|3810| };
|3811|3811| 
|3812|3812| 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
|3806|3806| 	// TODO: This is a bit inefficient since every unit listens to every
|3807|3807| 	// construction message - ideally we could scope it to only the one we're building
|3808|3808| 
|3809|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3809|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3810|3810| };
|3811|3811| 
|3812|3812| 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
|3831|3831| 
|3832|3832| UnitAI.prototype.OnAttacked = function(msg)
|3833|3833| {
|3834|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3834|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3835|3835| };
|3836|3836| 
|3837|3837| 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
|3831|3831| 
|3832|3832| UnitAI.prototype.OnAttacked = function(msg)
|3833|3833| {
|3834|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3834|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3835|3835| };
|3836|3836| 
|3837|3837| 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
|3836|3836| 
|3837|3837| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3838|3838| {
|3839|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3839|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3840|3840| };
|3841|3841| 
|3842|3842| 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
|3836|3836| 
|3837|3837| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3838|3838| {
|3839|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3839|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3840|3840| };
|3841|3841| 
|3842|3842| 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
|3841|3841| 
|3842|3842| UnitAI.prototype.OnHealthChanged = function(msg)
|3843|3843| {
|3844|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3844|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3845|3845| };
|3846|3846| 
|3847|3847| 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
|3841|3841| 
|3842|3842| UnitAI.prototype.OnHealthChanged = function(msg)
|3843|3843| {
|3844|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3844|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3845|3845| };
|3846|3846| 
|3847|3847| 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
|3847|3847| UnitAI.prototype.OnRangeUpdate = function(msg)
|3848|3848| {
|3849|3849| 	if (msg.tag == this.losRangeQuery)
|3850|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3850|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3851|3851| 	else if (msg.tag == this.losHealRangeQuery)
|3852|3852| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3853|3853| };
|    | [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
|3847|3847| UnitAI.prototype.OnRangeUpdate = function(msg)
|3848|3848| {
|3849|3849| 	if (msg.tag == this.losRangeQuery)
|3850|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3850|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3851|3851| 	else if (msg.tag == this.losHealRangeQuery)
|3852|3852| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3853|3853| };
|    | [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
|3849|3849| 	if (msg.tag == this.losRangeQuery)
|3850|3850| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3851|3851| 	else if (msg.tag == this.losHealRangeQuery)
|3852|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3852|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3853|3853| };
|3854|3854| 
|3855|3855| 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
|3849|3849| 	if (msg.tag == this.losRangeQuery)
|3850|3850| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3851|3851| 	else if (msg.tag == this.losHealRangeQuery)
|3852|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3852|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3853|3853| };
|3854|3854| 
|3855|3855| 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
|3854|3854| 
|3855|3855| UnitAI.prototype.OnPackFinished = function(msg)
|3856|3856| {
|3857|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3857|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3858|3858| };
|3859|3859| 
|3860|3860| //// 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
|3854|3854| 
|3855|3855| UnitAI.prototype.OnPackFinished = function(msg)
|3856|3856| {
|3857|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3857|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3858|3858| };
|3859|3859| 
|3860|3860| //// 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
|3857|3857| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3858|3858| };
|3859|3859| 
|3860|    |-//// Helper functions to be called by the FSM ////
|    |3860|+// // Helper functions to be called by the FSM ////
|3861|3861| 
|3862|3862| UnitAI.prototype.GetWalkSpeed = function()
|3863|3863| {
|    | [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
|4044|4044| 			PlaySound(name, member);
|4045|4045| 	}
|4046|4046| 	else
|4047|    |-	{
|    |4047|+	
|4048|4048| 		// Otherwise use our own sounds
|4049|4049| 		PlaySound(name, this.entity);
|4050|    |-	}
|    |4050|+	
|4051|4051| };
|4052|4052| 
|4053|4053| /*
|    | [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
|4236|4236| 	else
|4237|4237| 		// return false? Or hope you come close enough?
|4238|4238| 		var parabolicMaxRange = 0;
|4239|    |-		//return false;
|    |4239|+		// return false;
|4240|4240| 
|4241|4241| 	// the parabole changes while walking, take something in the middle
|4242|4242| 	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
|4323|4323| 	if (this.IsFormationMember())
|4324|4324| 	{
|4325|4325| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4326|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4327|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4326|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4327|+			cmpFormationUnitAI.order.data.target == target)
|4328|4328| 			return true;
|4329|4329| 	}
|4330|4330| 
|    | [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
|4496|4496| UnitAI.prototype.AttackEntityInZone = function(ents)
|4497|4497| {
|4498|4498| 	var target = ents.find(target =>
|4499|    |-		this.CanAttack(target)
|4500|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4499|+		this.CanAttack(target) &&
|    |4500|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4501|4501| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4502|4502| 	);
|4503|4503| 	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
|4497|4497| {
|4498|4498| 	var target = ents.find(target =>
|4499|4499| 		this.CanAttack(target)
|4500|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4501|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4500|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4501|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4502|4502| 	);
|4503|4503| 	if (!target)
|4504|4504| 		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
|4561|4561| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4562|4562| 	if (this.isGuardOf)
|4563|4563| 	{
|4564|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4564|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4565|4565| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4566|4566| 		if (cmpUnitAI && cmpAttack &&
|4567|4567| 		    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
|4565|4565| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4566|4566| 		if (cmpUnitAI && cmpAttack &&
|4567|4567| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4568|    |-				return false;
|    |4568|+			return false;
|4569|4569| 	}
|4570|4570| 
|4571|4571| 	// 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
|4570|4570| 
|4571|4571| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4572|4572| 	if (this.GetStance().respondHoldGround)
|4573|    |-	{
|    |4573|+	
|4574|4574| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4575|4575| 			return true;
|4576|    |-	}
|    |4576|+	
|4577|4577| 
|4578|4578| 	// Stop if it's left our vision range, unless we're especially persistent
|4579|4579| 	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
|4577|4577| 
|4578|4578| 	// Stop if it's left our vision range, unless we're especially persistent
|4579|4579| 	if (!this.GetStance().respondChaseBeyondVision)
|4580|    |-	{
|    |4580|+	
|4581|4581| 		if (!this.CheckTargetIsInVisionRange(target))
|4582|4582| 			return true;
|4583|    |-	}
|    |4583|+	
|4584|4584| 
|4585|4585| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4586|4586| 	// 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
|4603|4603| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4604|4604| 	if (this.isGuardOf)
|4605|4605| 	{
|4606|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4606|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4607|4607| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4608|4608| 		if (cmpUnitAI && cmpAttack &&
|4609|4609| 		    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
|4616|4616| 	return false;
|4617|4617| };
|4618|4618| 
|4619|    |-//// External interface functions ////
|    |4619|+// // External interface functions ////
|4620|4620| 
|4621|4621| UnitAI.prototype.SetFormationController = function(ent)
|4622|4622| {
|    | [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
|4626|4626| 	// of our own formation (or ourself if not in formation)
|4627|4627| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4628|4628| 	if (cmpObstruction)
|4629|    |-	{
|    |4629|+	
|4630|4630| 		if (ent == INVALID_ENTITY)
|4631|4631| 			cmpObstruction.SetControlGroup(this.entity);
|4632|4632| 		else
|4633|4633| 			cmpObstruction.SetControlGroup(ent);
|4634|    |-	}
|    |4634|+	
|4635|4635| 
|4636|4636| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4637|4637| 	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
|4769|4769| 	// if we already had an old guard order, do nothing if the target is the same
|4770|4770| 	// and the order is running, otherwise remove the previous order
|4771|4771| 	if (this.isGuardOf)
|4772|    |-	{
|    |4772|+	
|4773|4773| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4774|4774| 			return;
|4775|4775| 		else
|4776|4776| 			this.RemoveGuard();
|4777|    |-	}
|    |4777|+	
|4778|4778| 
|4779|4779| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4780|4780| };
|    | [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
|4772|4772| 	{
|4773|4773| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4774|4774| 			return;
|4775|    |-		else
|4776|    |-			this.RemoveGuard();
|    |4775|+		this.RemoveGuard();
|4777|4776| 	}
|4778|4777| 
|4779|4778| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5104|5104| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5105|5105| 	{
|5106|5106| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5107|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5107|+		if (cmpTrader.HasBothMarkets() &&
|5108|5108| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5109|5109| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5110|5110| 		{
|    | [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
|5385|5385| 				{
|5386|5386| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5387|5387| 					var targetClasses = this.order.data.targetClasses;
|5388|    |-					if (targetClasses.attack && cmpIdentity
|5389|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5388|+					if (targetClasses.attack && cmpIdentity &&
|    |5389|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5390|5390| 						continue;
|5391|5391| 					if (targetClasses.avoid && cmpIdentity
|5392|5392| 						&& 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
|5388|5388| 					if (targetClasses.attack && cmpIdentity
|5389|5389| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5390|5390| 						continue;
|5391|    |-					if (targetClasses.avoid && cmpIdentity
|5392|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5391|+					if (targetClasses.avoid && cmpIdentity &&
|    |5392|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5393|5393| 						continue;
|5394|5394| 					// Only used by the AIs to prevent some choices of targets
|5395|5395| 					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
|5411|5411| 		{
|5412|5412| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5413|5413| 			var targetClasses = this.order.data.targetClasses;
|5414|    |-			if (cmpIdentity && targetClasses.attack
|5415|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5414|+			if (cmpIdentity && targetClasses.attack &&
|    |5415|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5416|5416| 				continue;
|5417|5417| 			if (cmpIdentity && targetClasses.avoid
|5418|5418| 				&& 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
|5414|5414| 			if (cmpIdentity && targetClasses.attack
|5415|5415| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5416|5416| 				continue;
|5417|    |-			if (cmpIdentity && targetClasses.avoid
|5418|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5417|+			if (cmpIdentity && targetClasses.avoid &&
|    |5418|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5419|5419| 				continue;
|5420|5420| 			// Only used by the AIs to prevent some choices of targets
|5421|5421| 			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
|5571|5571| 
|5572|5572| UnitAI.prototype.SetHeldPosition = function(x, z)
|5573|5573| {
|5574|    |-	this.heldPosition = {"x": x, "z": z};
|    |5574|+	this.heldPosition = { "x": x, "z": z};
|5575|5575| };
|5576|5576| 
|5577|5577| 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
|5571|5571| 
|5572|5572| UnitAI.prototype.SetHeldPosition = function(x, z)
|5573|5573| {
|5574|    |-	this.heldPosition = {"x": x, "z": z};
|    |5574|+	this.heldPosition = {"x": x, "z": z };
|5575|5575| };
|5576|5576| 
|5577|5577| 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
|5598|5598| 	return false;
|5599|5599| };
|5600|5600| 
|5601|    |-//// Helper functions ////
|    |5601|+// // Helper functions ////
|5602|5602| 
|5603|5603| UnitAI.prototype.CanAttack = function(target)
|5604|5604| {
|    | [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
|5802|5802| 	return cmpPack && cmpPack.IsPacking();
|5803|5803| };
|5804|5804| 
|5805|    |-//// Formation specific functions ////
|    |5805|+// // Formation specific functions ////
|5806|5806| 
|5807|5807| UnitAI.prototype.IsAttackingAsFormation = function()
|5808|5808| {
|    | [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
|5807|5807| UnitAI.prototype.IsAttackingAsFormation = function()
|5808|5808| {
|5809|5809| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5810|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5811|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5810|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5811|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5812|5812| };
|5813|5813| 
|5814|5814| //// 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
|5811|5811| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5812|5812| };
|5813|5813| 
|5814|    |-//// Animal specific functions ////
|    |5814|+// // Animal specific functions ////
|5815|5815| 
|5816|5816| UnitAI.prototype.MoveRandomly = function(distance)
|5817|5817| {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3664| »   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
|4483| »   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
|4498| »   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
|4544| »   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
|4567| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4249| »   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
|4327| »   »   »   &&·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
|4500| »   »   &&·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
|4501| »   »   &&·(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
|5389| »   »   »   »   »   »   &&·!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
|5392| »   »   »   »   »   »   &&·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
|5405| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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