Page MenuHomeWildfire Games

Fix chasing behaviour
Needs ReviewPublic

Authored by Angen on Jun 9 2019, 8:49 PM.

Details

Reviewers
wraitii
Summary

unit is not attacking when gets in range while chasing

Test Plan

chase fleeing animals/units with melee and range units

Diff Detail

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

Event Timeline

Angen created this revision.Jun 9 2019, 8:49 PM

This is the type of changes one needs to do to fix the unitAI code correctly, however you have un-necessary {} and I think you should add the same range check to MovementUpdate (or possibly just make MovementUpdate call the Timer, but that's a bit ugly... I fixed that originally in D442 but it was kind of ugly.

Vulcan added a comment.Jun 9 2019, 9:19 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
| 515| 515| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 516| 516| 				}
| 517| 517| 				else
| 518|    |-				{
|    | 518|+				
| 519| 519| 					// We couldn't move there, or the target moved away
| 520| 520| 					this.FinishOrder();
| 521|    |-				}
|    | 521|+				
| 522| 522| 				return;
| 523| 523| 			}
| 524| 524| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 730| 730| 			}
| 731| 731| 			// Check if we are already in range, otherwise walk there
| 732| 732| 			if (!this.CheckGarrisonRange(msg.data.target))
| 733|    |-			{
|    | 733|+			
| 734| 734| 				if (!this.CheckTargetVisible(msg.data.target))
| 735| 735| 				{
| 736| 736| 					this.FinishOrder();
| 741| 741| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 742| 					return;
| 743| 743| 				}
| 744|    |-			}
|    | 744|+			
| 745| 745| 
| 746| 746| 			this.SetNextState("GARRISON.GARRISONING");
| 747| 747| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 					this.FinishOrder();
| 737| 737| 					return;
| 738| 738| 				}
| 739|    |-				else
| 740|    |-				{
|    | 739|+				
| 741| 740| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 741| 					return;
| 743|    |-				}
|    | 742|+				
| 744| 743| 			}
| 745| 744| 
| 746| 745| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 759| 759| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 760| 760| 					}
| 761| 761| 					else
| 762|    |-					{
|    | 762|+					
| 763| 763| 						// We couldn't move there, or the target moved away
| 764| 764| 						this.FinishOrder();
| 765|    |-					}
|    | 765|+					
| 766| 766| 					return;
| 767| 767| 				}
| 768| 768| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 992| 992| 			},
| 993| 993| 		},
| 994| 994| 
| 995|    |-		"GARRISON":{
|    | 995|+		"GARRISON": {
| 996| 996| 			"enter": function() {
| 997| 997| 				// If the garrisonholder should pickup, warn it so it can take needed action
| 998| 998| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1205|1205| 			// If the controller handled an order but some members rejected it,
|1206|1206| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1207|1207| 			if (this.orderQueue.length)
|1208|    |-			{
|    |1208|+			
|1209|1209| 				// We're leaving the formation, so stop our FormationWalk order
|1210|1210| 				if (this.FinishOrder())
|1211|1211| 					return;
|1212|    |-			}
|    |1212|+			
|1213|1213| 
|1214|1214| 			// No orders left, we're an individual now
|1215|1215| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1233|1233| 			// Move a tile outside the building
|1234|1234| 			let range = 4;
|1235|1235| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1236|    |-			{
|    |1236|+			
|1237|1237| 				// We are already at the target, or can't move at all
|1238|1238| 				this.FinishOrder();
|1239|    |-			}
|    |1239|+			
|1240|1240| 			else
|1241|1241| 			{
|1242|1242| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1454|1454| 
|1455|1455| 			"LosRangeUpdate": function(msg) {
|1456|1456| 				if (this.GetStance().targetVisibleEnemies)
|1457|    |-				{
|    |1457|+				
|1458|1458| 					// Start attacking one of the newly-seen enemy (if any)
|1459|1459| 					this.AttackEntitiesByPreference(msg.data.added);
|1460|    |-				}
|    |1460|+				
|1461|1461| 			},
|1462|1462| 
|1463|1463| 			"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
|1487|1487| 				this.SelectAnimation("move");
|1488|1488| 			},
|1489|1489| 
|1490|    |-			"leave": function () {
|    |1490|+			"leave": function() {
|1491|1491| 				this.SelectAnimation("idle");
|1492|1492| 				this.StopMoving();
|1493|1493| 			},
|    | [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
|1667|1667| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1668|1668| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1669|1669| 						if (cmpHealth && cmpHealth.IsInjured())
|1670|    |-						{
|    |1670|+						
|1671|1671| 							if (this.CanHeal(this.isGuardOf))
|1672|1672| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1673|1673| 							else if (this.CanRepair(this.isGuardOf))
|1674|1674| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1675|    |-						}
|    |1675|+						
|1676|1676| 					}
|1677|1677| 				},
|1678|1678| 
|    | [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
|1794|1794| 					}
|1795|1795| 					// Check the target is still alive and attackable
|1796|1796| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1797|    |-					{
|    |1797|+					
|1798|1798| 						// Can't reach it - try to chase after it
|1799|1799| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1800|1800| 						{
|1809|1809| 								return true;
|1810|1810| 							}
|1811|1811| 						}
|1812|    |-					}
|    |1812|+					
|1813|1813| 
|1814|1814| 					this.StopMoving();
|1815|1815| 
|    | [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
|1842|1842| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1843|1843| 
|1844|1844| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1845|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1845|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1846|1846| 
|1847|1847| 					this.FaceTowardsTarget(this.order.data.target);
|1848|1848| 
|    | [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
|1971|1971| 
|1972|1972| 				"Attacked": function(msg) {
|1973|1973| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1974|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1975|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1974|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1975|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1976|1976| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1977|1977| 				},
|1978|1978| 			},
|    | [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
|1991|1991| 					this.SelectAnimation("move");
|1992|1992| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1993|1993| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1994|    |-					{
|    |1994|+					
|1995|1995| 						// Run after a fleeing target
|1996|1996| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|1997|    |-					}
|    |1997|+					
|1998|1998| 					this.StartTimer(1000, 1000);
|1999|1999| 				},
|2000|2000| 
|    | [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
|2018|2018| 							this.WalkToHeldPosition();
|2019|2019| 						return;
|2020|2020| 					}
|2021|    |-					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) {
|    |2021|+					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) 
|2022|2022| 						this.SetNextState("ATTACKING");
|2023|    |-					}
|    |2023|+					
|2024|2024| 				},
|2025|2025| 
|2026|2026| 				"MovementUpdate": 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
|2177|2177| 
|2178|2178| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2179|2179| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2180|    |-					{
|    |2180|+					
|2181|2181| 						// Check we can still reach and gather from the target
|2182|2182| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2183|2183| 						{
|2242|2242| 								return;
|2243|2243| 							}
|2244|2244| 						}
|2245|    |-					}
|    |2245|+					
|2246|2246| 
|2247|2247| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2248|2248| 
|    | [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
|2268|2268| 					// Also don't switch to a different type of huntable animal
|2269|2269| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2270|2270| 						return (
|2271|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2272|    |-							|| (type.specific == resourceType.specific
|    |2271|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2272|+							(type.specific == resourceType.specific
|2273|2273| 							&& (type.specific != "meat" || resourceTemplate == template))
|2274|2274| 						);
|2275|2275| 					});
|    | [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
|2269|2269| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2270|2270| 						return (
|2271|2271| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2272|    |-							|| (type.specific == resourceType.specific
|2273|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2272|+							|| (type.specific == resourceType.specific &&
|    |2273|+							(type.specific != "meat" || resourceTemplate == template))
|2274|2274| 						);
|2275|2275| 					});
|2276|2276| 					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
|2334|2334| 
|2335|2335| 				"Timer": function(msg) {
|2336|2336| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2337|    |-					{
|    |2337|+					
|2338|2338| 						// Return to our original position unless we have a better order.
|2339|2339| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2340|2340| 							this.WalkToHeldPosition();
|2341|    |-					}
|    |2341|+					
|2342|2342| 				},
|2343|2343| 
|2344|2344| 				"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
|2368|2368| 					this.StartTimer(prepare, this.healTimers.repeat);
|2369|2369| 
|2370|2370| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2371|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2371|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2372|2372| 
|2373|2373| 					this.FaceTowardsTarget(this.order.data.target);
|2374|2374| 				},
|    | [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
|2584|2584| 					{
|2585|2585| 						// The building was already finished/fully repaired before we arrived;
|2586|2586| 						// let the ConstructionFinished handler handle this.
|2587|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2587|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2588|2588| 						return true;
|2589|2589| 					}
|2590|2590| 
|    | [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
|2584|2584| 					{
|2585|2585| 						// The building was already finished/fully repaired before we arrived;
|2586|2586| 						// let the ConstructionFinished handler handle this.
|2587|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2587|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2588|2588| 						return true;
|2589|2589| 					}
|2590|2590| 
|    | [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
|2627|2627| 					if (!inRange && this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2628|2628| 						this.SetNextState("APPROACHING");
|2629|2629| 					else if (!inRange)
|2630|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2630|+						this.FinishOrder(); // can't approach and isn't in reach
|2631|2631| 				},
|2632|2632| 			},
|2633|2633| 
|    | [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
|2714|2714| 
|2715|2715| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2716|2716| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2717|    |-				{
|    |2717|+				
|2718|2718| 					// We're already walking to the given point, so add this as a order.
|2719|2719| 					this.WalkToTarget(msg.data.newentity, true);
|2720|    |-				}
|    |2720|+				
|2721|2721| 			},
|2722|2722| 		},
|2723|2723| 
|    | [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
|2777|2777| 
|2778|2778| 					// Check that we can garrison here
|2779|2779| 					if (this.CanGarrison(target))
|2780|    |-					{
|    |2780|+					
|2781|2781| 						// Check that we're in range of the garrison target
|2782|2782| 						if (this.CheckGarrisonRange(target))
|2783|2783| 						{
|2853|2853| 								return false;
|2854|2854| 							}
|2855|2855| 						}
|2856|    |-					}
|    |2856|+					
|2857|2857| 					// Garrisoning failed for some reason, so finish the order
|2858|2858| 					this.FinishOrder();
|2859|2859| 					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
|2975|2975| 		"Attacked": function(msg) {
|2976|2976| 			if (this.template.NaturalBehaviour == "skittish" ||
|2977|2977| 			    this.template.NaturalBehaviour == "passive")
|2978|    |-			{
|    |2978|+			
|2979|2979| 				this.Flee(msg.data.attacker, false);
|2980|    |-			}
|    |2980|+			
|2981|2981| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2982|2982| 			{
|2983|2983| 				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
|2984|2984| 					this.Attack(msg.data.attacker, false);
|2985|2985| 			}
|2986|2986| 			else if (this.template.NaturalBehaviour == "domestic")
|2987|    |-			{
|    |2987|+			
|2988|2988| 				// Never flee, stop what we were doing
|2989|2989| 				this.SetNextState("IDLE");
|2990|    |-			}
|    |2990|+			
|2991|2991| 		},
|2992|2992| 
|2993|2993| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2998|2998| 				this.FinishOrder();
|2999|2999| 				return;
|3000|3000| 			}
|3001|    |-			else
|3002|    |-			{
|    |3001|+			
|3003|3002| 				this.order.data.min = range;
|3004|3003| 				this.SetNextState("WALKING");
|3005|    |-			}
|    |3004|+			
|3006|3005| 		},
|3007|3006| 
|3008|3007| 		"IDLE": {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3042|3042| 				}
|3043|3043| 				// Start attacking one of the newly-seen enemy (if any)
|3044|3044| 				else if (this.IsDangerousAnimal())
|3045|    |-				{
|    |3045|+				
|3046|3046| 					this.AttackVisibleEntity(msg.data.added);
|3047|    |-				}
|    |3047|+				
|3048|3048| 
|3049|3049| 				// TODO: if two units enter our range together, we'll attack the
|3050|3050| 				// 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
|3085|3085| 				}
|3086|3086| 				// Start attacking one of the newly-seen enemy (if any)
|3087|3087| 				else if (this.template.NaturalBehaviour == "violent")
|3088|    |-				{
|    |3088|+				
|3089|3089| 					this.AttackVisibleEntity(msg.data.added);
|3090|    |-				}
|    |3090|+				
|3091|3091| 			},
|3092|3092| 
|3093|3093| 			"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
|3100|3100| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3101|3101| 
|3102|3102| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3103|    |-							// only used for domestic animals
|    |3103|+		// only used for domestic animals
|3104|3104| 	},
|3105|3105| };
|3106|3106| 
|    | [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
|3157|3157| 
|3158|3158| UnitAI.prototype.IsAnimal = function()
|3159|3159| {
|3160|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3160|+	return (!!this.template.NaturalBehaviour);
|3161|3161| };
|3162|3162| 
|3163|3163| 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
|3195|3195| UnitAI.prototype.GetGarrisonHolder = function()
|3196|3196| {
|3197|3197| 	if (this.IsGarrisoned())
|3198|    |-	{
|    |3198|+	
|3199|3199| 		for (let order of this.orderQueue)
|3200|3200| 			if (order.type == "Garrison")
|3201|3201| 				return order.data.target;
|3202|    |-	}
|    |3202|+	
|3203|3203| 	return INVALID_ENTITY;
|3204|3204| };
|3205|3205| 
|    | [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
|3273|3273| 		{
|3274|3274| 			let index = this.GetCurrentState().indexOf(".");
|3275|3275| 			if (index != -1)
|3276|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3276|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3277|3277| 			this.Stop(false);
|3278|3278| 		}
|3279|3279| 
|    | [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
|3329|3329| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3330|3330| 			continue;
|3331|3331| 		if (i == 0)
|3332|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3332|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3333|3333| 		else
|3334|3334| 			this.orderQueue.splice(i, 1);
|3335|3335| 		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
|3329|3329| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3330|3330| 			continue;
|3331|3331| 		if (i == 0)
|3332|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3332|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3333|3333| 		else
|3334|3334| 			this.orderQueue.splice(i, 1);
|3335|3335| 		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
|3413|3413| };
|3414|3414| 
|3415|3415| 
|3416|    |-//// FSM linkage functions ////
|    |3416|+// // FSM linkage functions ////
|3417|3417| 
|3418|3418| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3419|3419| 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
|3585|3585| 				continue;
|3586|3586| 			if (this.orderQueue[i].type == type)
|3587|3587| 				continue;
|3588|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3588|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3589|3589| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3590|3590| 			return;
|3591|3591| 		}
|    | [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
|3585|3585| 				continue;
|3586|3586| 			if (this.orderQueue[i].type == type)
|3587|3587| 				continue;
|3588|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3588|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3589|3589| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3590|3590| 			return;
|3591|3591| 		}
|    | [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
|3599|3599| {
|3600|3600| 	// Remember the previous work orders to be able to go back to them later if required
|3601|3601| 	if (data && data.force)
|3602|    |-	{
|    |3602|+	
|3603|3603| 		if (this.IsFormationController())
|3604|3604| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3605|3605| 		else
|3606|3606| 			this.UpdateWorkOrders(type);
|3607|    |-	}
|    |3607|+	
|3608|3608| 
|3609|3609| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3610|3610| 
|    | [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
|3676|3676| 	{
|3677|3677| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3678|3678| 		if (cmpUnitAI)
|3679|    |-		{
|    |3679|+		
|3680|3680| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3681|3681| 			{
|3682|3682| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3685|3685| 					return;
|3686|3686| 				}
|3687|3687| 			}
|3688|    |-		}
|    |3688|+		
|3689|3689| 	}
|3690|3690| 
|3691|3691| 	// 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
|3678|3678| 		if (cmpUnitAI)
|3679|3679| 		{
|3680|3680| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3681|    |-			{
|    |3681|+			
|3682|3682| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3683|3683| 				{
|3684|3684| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3685|3685| 					return;
|3686|3686| 				}
|3687|    |-			}
|    |3687|+			
|3688|3688| 		}
|3689|3689| 	}
|3690|3690| 
|    | [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
|3690|3690| 
|3691|3691| 	// If nothing found, take the unit orders
|3692|3692| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3693|    |-	{
|    |3693|+	
|3694|3694| 		if (isWorkType(this.orderQueue[i].type))
|3695|3695| 		{
|3696|3696| 			this.workOrders = this.orderQueue.slice(i);
|3697|3697| 			return;
|3698|3698| 		}
|3699|    |-	}
|    |3699|+	
|3700|3700| };
|3701|3701| 
|3702|3702| 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
|3756|3756| 	if (data.timerRepeat === undefined)
|3757|3757| 		this.timer = undefined;
|3758|3758| 
|3759|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3759|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3760|3760| };
|3761|3761| 
|3762|3762| /**
|    | [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
|3756|3756| 	if (data.timerRepeat === undefined)
|3757|3757| 		this.timer = undefined;
|3758|3758| 
|3759|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3759|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3760|3760| };
|3761|3761| 
|3762|3762| /**
|    | [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
|3791|3791| 	this.timer = undefined;
|3792|3792| };
|3793|3793| 
|3794|    |-//// Message handlers /////
|    |3794|+// // Message handlers /////
|3795|3795| 
|3796|3796| UnitAI.prototype.OnMotionChanged = function(msg)
|3797|3797| {
|    | [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
|3803|3803| 	// TODO: This is a bit inefficient since every unit listens to every
|3804|3804| 	// construction message - ideally we could scope it to only the one we're building
|3805|3805| 
|3806|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3806|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3807|3807| };
|3808|3808| 
|3809|3809| 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
|3803|3803| 	// TODO: This is a bit inefficient since every unit listens to every
|3804|3804| 	// construction message - ideally we could scope it to only the one we're building
|3805|3805| 
|3806|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3806|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3807|3807| };
|3808|3808| 
|3809|3809| 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
|3828|3828| 
|3829|3829| UnitAI.prototype.OnAttacked = function(msg)
|3830|3830| {
|3831|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3831|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3832|3832| };
|3833|3833| 
|3834|3834| 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
|3828|3828| 
|3829|3829| UnitAI.prototype.OnAttacked = function(msg)
|3830|3830| {
|3831|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3831|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3832|3832| };
|3833|3833| 
|3834|3834| 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
|3833|3833| 
|3834|3834| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3835|3835| {
|3836|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3836|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3837|3837| };
|3838|3838| 
|3839|3839| 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
|3833|3833| 
|3834|3834| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3835|3835| {
|3836|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3836|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3837|3837| };
|3838|3838| 
|3839|3839| 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
|3838|3838| 
|3839|3839| UnitAI.prototype.OnHealthChanged = function(msg)
|3840|3840| {
|3841|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3841|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3842|3842| };
|3843|3843| 
|3844|3844| 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
|3838|3838| 
|3839|3839| UnitAI.prototype.OnHealthChanged = function(msg)
|3840|3840| {
|3841|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3841|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3842|3842| };
|3843|3843| 
|3844|3844| 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
|3844|3844| UnitAI.prototype.OnRangeUpdate = function(msg)
|3845|3845| {
|3846|3846| 	if (msg.tag == this.losRangeQuery)
|3847|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3847|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3848|3848| 	else if (msg.tag == this.losHealRangeQuery)
|3849|3849| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3850|3850| };
|    | [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| UnitAI.prototype.OnRangeUpdate = function(msg)
|3845|3845| {
|3846|3846| 	if (msg.tag == this.losRangeQuery)
|3847|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3847|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3848|3848| 	else if (msg.tag == this.losHealRangeQuery)
|3849|3849| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3850|3850| };
|    | [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
|3846|3846| 	if (msg.tag == this.losRangeQuery)
|3847|3847| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3848|3848| 	else if (msg.tag == this.losHealRangeQuery)
|3849|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3849|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3850|3850| };
|3851|3851| 
|3852|3852| 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
|3846|3846| 	if (msg.tag == this.losRangeQuery)
|3847|3847| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3848|3848| 	else if (msg.tag == this.losHealRangeQuery)
|3849|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3849|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3850|3850| };
|3851|3851| 
|3852|3852| 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
|3851|3851| 
|3852|3852| UnitAI.prototype.OnPackFinished = function(msg)
|3853|3853| {
|3854|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3854|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3855|3855| };
|3856|3856| 
|3857|3857| //// 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
|3851|3851| 
|3852|3852| UnitAI.prototype.OnPackFinished = function(msg)
|3853|3853| {
|3854|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3854|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3855|3855| };
|3856|3856| 
|3857|3857| //// 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
|3854|3854| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3855|3855| };
|3856|3856| 
|3857|    |-//// Helper functions to be called by the FSM ////
|    |3857|+// // Helper functions to be called by the FSM ////
|3858|3858| 
|3859|3859| UnitAI.prototype.GetWalkSpeed = function()
|3860|3860| {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3956|3956| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3957|3957| 		return undefined;
|3958|3958| 
|3959|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3959|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3960|3960| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3961|3961| 		return undefined;
|3962|3962| 
|    | [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
|4041|4041| 			PlaySound(name, member);
|4042|4042| 	}
|4043|4043| 	else
|4044|    |-	{
|    |4044|+	
|4045|4045| 		// Otherwise use our own sounds
|4046|4046| 		PlaySound(name, this.entity);
|4047|    |-	}
|    |4047|+	
|4048|4048| };
|4049|4049| 
|4050|4050| /*
|    | [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
|4233|4233| 	else
|4234|4234| 		// return false? Or hope you come close enough?
|4235|4235| 		var parabolicMaxRange = 0;
|4236|    |-		//return false;
|    |4236|+		// return false;
|4237|4237| 
|4238|4238| 	// the parabole changes while walking, take something in the middle
|4239|4239| 	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
|4320|4320| 	if (this.IsFormationMember())
|4321|4321| 	{
|4322|4322| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4323|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4324|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4323|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4324|+			cmpFormationUnitAI.order.data.target == target)
|4325|4325| 			return true;
|4326|4326| 	}
|4327|4327| 
|    | [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
|4488|4488| UnitAI.prototype.AttackEntityInZone = function(ents)
|4489|4489| {
|4490|4490| 	var target = ents.find(target =>
|4491|    |-		this.CanAttack(target)
|4492|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4491|+		this.CanAttack(target) &&
|    |4492|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4493|4493| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4494|4494| 	);
|4495|4495| 	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
|4489|4489| {
|4490|4490| 	var target = ents.find(target =>
|4491|4491| 		this.CanAttack(target)
|4492|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4493|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4492|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4493|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4494|4494| 	);
|4495|4495| 	if (!target)
|4496|4496| 		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
|4553|4553| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4554|4554| 	if (this.isGuardOf)
|4555|4555| 	{
|4556|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4556|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4557|4557| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4558|4558| 		if (cmpUnitAI && cmpAttack &&
|4559|4559| 		    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
|4557|4557| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4558|4558| 		if (cmpUnitAI && cmpAttack &&
|4559|4559| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4560|    |-				return false;
|    |4560|+			return false;
|4561|4561| 	}
|4562|4562| 
|4563|4563| 	// 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
|4562|4562| 
|4563|4563| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4564|4564| 	if (this.GetStance().respondHoldGround)
|4565|    |-	{
|    |4565|+	
|4566|4566| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4567|4567| 			return true;
|4568|    |-	}
|    |4568|+	
|4569|4569| 
|4570|4570| 	// Stop if it's left our vision range, unless we're especially persistent
|4571|4571| 	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
|4569|4569| 
|4570|4570| 	// Stop if it's left our vision range, unless we're especially persistent
|4571|4571| 	if (!this.GetStance().respondChaseBeyondVision)
|4572|    |-	{
|    |4572|+	
|4573|4573| 		if (!this.CheckTargetIsInVisionRange(target))
|4574|4574| 			return true;
|4575|    |-	}
|    |4575|+	
|4576|4576| 
|4577|4577| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4578|4578| 	// 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
|4595|4595| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4596|4596| 	if (this.isGuardOf)
|4597|4597| 	{
|4598|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4598|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4599|4599| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4600|4600| 		if (cmpUnitAI && cmpAttack &&
|4601|4601| 		    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
|4608|4608| 	return false;
|4609|4609| };
|4610|4610| 
|4611|    |-//// External interface functions ////
|    |4611|+// // External interface functions ////
|4612|4612| 
|4613|4613| UnitAI.prototype.SetFormationController = function(ent)
|4614|4614| {
|    | [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
|4618|4618| 	// of our own formation (or ourself if not in formation)
|4619|4619| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4620|4620| 	if (cmpObstruction)
|4621|    |-	{
|    |4621|+	
|4622|4622| 		if (ent == INVALID_ENTITY)
|4623|4623| 			cmpObstruction.SetControlGroup(this.entity);
|4624|4624| 		else
|4625|4625| 			cmpObstruction.SetControlGroup(ent);
|4626|    |-	}
|    |4626|+	
|4627|4627| 
|4628|4628| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4629|4629| 	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
|4761|4761| 	// if we already had an old guard order, do nothing if the target is the same
|4762|4762| 	// and the order is running, otherwise remove the previous order
|4763|4763| 	if (this.isGuardOf)
|4764|    |-	{
|    |4764|+	
|4765|4765| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4766|4766| 			return;
|4767|4767| 		else
|4768|4768| 			this.RemoveGuard();
|4769|    |-	}
|    |4769|+	
|4770|4770| 
|4771|4771| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4772|4772| };
|    | [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
|4764|4764| 	{
|4765|4765| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4766|4766| 			return;
|4767|    |-		else
|4768|    |-			this.RemoveGuard();
|    |4767|+		this.RemoveGuard();
|4769|4768| 	}
|4770|4769| 
|4771|4770| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4935|4935| 			this.WalkToTarget(target, queued);
|4936|4936| 		return;
|4937|4937| 	}
|4938|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4938|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4939|4939| };
|4940|4940| 
|4941|4941| /**
|    | [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
|5084|5084| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5085|5085| 	{
|5086|5086| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5087|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5087|+		if (cmpTrader.HasBothMarkets() &&
|5088|5088| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5089|5089| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5090|5090| 		{
|    | [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
|5365|5365| 				{
|5366|5366| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5367|5367| 					var targetClasses = this.order.data.targetClasses;
|5368|    |-					if (targetClasses.attack && cmpIdentity
|5369|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5368|+					if (targetClasses.attack && cmpIdentity &&
|    |5369|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5370|5370| 						continue;
|5371|5371| 					if (targetClasses.avoid && cmpIdentity
|5372|5372| 						&& 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
|5368|5368| 					if (targetClasses.attack && cmpIdentity
|5369|5369| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5370|5370| 						continue;
|5371|    |-					if (targetClasses.avoid && cmpIdentity
|5372|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5371|+					if (targetClasses.avoid && cmpIdentity &&
|    |5372|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5373|5373| 						continue;
|5374|5374| 					// Only used by the AIs to prevent some choices of targets
|5375|5375| 					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
|5391|5391| 		{
|5392|5392| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5393|5393| 			var targetClasses = this.order.data.targetClasses;
|5394|    |-			if (cmpIdentity && targetClasses.attack
|5395|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5394|+			if (cmpIdentity && targetClasses.attack &&
|    |5395|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5396|5396| 				continue;
|5397|5397| 			if (cmpIdentity && targetClasses.avoid
|5398|5398| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5394|5394| 			if (cmpIdentity && targetClasses.attack
|5395|5395| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5396|5396| 				continue;
|5397|    |-			if (cmpIdentity && targetClasses.avoid
|5398|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5397|+			if (cmpIdentity && targetClasses.avoid &&
|    |5398|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5399|5399| 				continue;
|5400|5400| 			// Only used by the AIs to prevent some choices of targets
|5401|5401| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (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
|5537|5537| 
|5538|5538| UnitAI.prototype.SetHeldPosition = function(x, z)
|5539|5539| {
|5540|    |-	this.heldPosition = {"x": x, "z": z};
|    |5540|+	this.heldPosition = { "x": x, "z": z};
|5541|5541| };
|5542|5542| 
|5543|5543| 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
|5537|5537| 
|5538|5538| UnitAI.prototype.SetHeldPosition = function(x, z)
|5539|5539| {
|5540|    |-	this.heldPosition = {"x": x, "z": z};
|    |5540|+	this.heldPosition = {"x": x, "z": z };
|5541|5541| };
|5542|5542| 
|5543|5543| 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
|5564|5564| 	return false;
|5565|5565| };
|5566|5566| 
|5567|    |-//// Helper functions ////
|    |5567|+// // Helper functions ////
|5568|5568| 
|5569|5569| UnitAI.prototype.CanAttack = function(target)
|5570|5570| {
|    | [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
|5768|5768| 	return cmpPack && cmpPack.IsPacking();
|5769|5769| };
|5770|5770| 
|5771|    |-//// Formation specific functions ////
|    |5771|+// // Formation specific functions ////
|5772|5772| 
|5773|5773| UnitAI.prototype.IsAttackingAsFormation = function()
|5774|5774| {
|    | [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
|5773|5773| UnitAI.prototype.IsAttackingAsFormation = function()
|5774|5774| {
|5775|5775| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5776|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5777|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5776|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5777|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5778|5778| };
|5779|5779| 
|5780|5780| //// 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
|5777|5777| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5778|5778| };
|5779|5779| 
|5780|    |-//// Animal specific functions ////
|    |5780|+// // Animal specific functions ////
|5781|5781| 
|5782|5782| UnitAI.prototype.MoveRandomly = function(distance)
|5783|5783| {

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|1298| »   »   »   "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
|1481| »   »   »   "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
|1502| »   »   »   "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
|1532| »   »   »   "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
|1687| »   »   »   "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
|1738| »   »   »   »   "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
|1809| »   »   »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1981| »   »   »   »   "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
|2021| »   »   »   »   »   if·(this.CheckTargetAttackRange(this.order.data.target,·this.order.data.attackType))·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/components/UnitAI.js
|2075| »   »   »   »   "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
|2258| »   »   »   »   »   »   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
|2313| »   »   »   »   "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
|2431| »   »   »   »   "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
|2496| »   »   »   »   "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
|2536| »   »   »   »   "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
|2746| »   »   »   »   "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
|2930| »   »   »   »   "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
|3661| »   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
|4475| »   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
|4490| »   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
|4536| »   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
|4559| »   »   ····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
|5015| »   var·lastPos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4246| »   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
|4324| »   »   »   &&·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
|4492| »   »   &&·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
|4493| »   »   &&·(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
|5015| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5777| »   »   &&·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/1673/display/redirect

Angen updated this revision to Diff 8404.Jun 9 2019, 9:23 PM

check in update move is not needed as ATTACKING.enter does the decision what to do if cannot reach or can reach or go to idle

Vulcan added a comment.Jun 9 2019, 9:26 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
| 515| 515| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 516| 516| 				}
| 517| 517| 				else
| 518|    |-				{
|    | 518|+				
| 519| 519| 					// We couldn't move there, or the target moved away
| 520| 520| 					this.FinishOrder();
| 521|    |-				}
|    | 521|+				
| 522| 522| 				return;
| 523| 523| 			}
| 524| 524| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 730| 730| 			}
| 731| 731| 			// Check if we are already in range, otherwise walk there
| 732| 732| 			if (!this.CheckGarrisonRange(msg.data.target))
| 733|    |-			{
|    | 733|+			
| 734| 734| 				if (!this.CheckTargetVisible(msg.data.target))
| 735| 735| 				{
| 736| 736| 					this.FinishOrder();
| 741| 741| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 742| 					return;
| 743| 743| 				}
| 744|    |-			}
|    | 744|+			
| 745| 745| 
| 746| 746| 			this.SetNextState("GARRISON.GARRISONING");
| 747| 747| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 					this.FinishOrder();
| 737| 737| 					return;
| 738| 738| 				}
| 739|    |-				else
| 740|    |-				{
|    | 739|+				
| 741| 740| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 741| 					return;
| 743|    |-				}
|    | 742|+				
| 744| 743| 			}
| 745| 744| 
| 746| 745| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 759| 759| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 760| 760| 					}
| 761| 761| 					else
| 762|    |-					{
|    | 762|+					
| 763| 763| 						// We couldn't move there, or the target moved away
| 764| 764| 						this.FinishOrder();
| 765|    |-					}
|    | 765|+					
| 766| 766| 					return;
| 767| 767| 				}
| 768| 768| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 992| 992| 			},
| 993| 993| 		},
| 994| 994| 
| 995|    |-		"GARRISON":{
|    | 995|+		"GARRISON": {
| 996| 996| 			"enter": function() {
| 997| 997| 				// If the garrisonholder should pickup, warn it so it can take needed action
| 998| 998| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1205|1205| 			// If the controller handled an order but some members rejected it,
|1206|1206| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1207|1207| 			if (this.orderQueue.length)
|1208|    |-			{
|    |1208|+			
|1209|1209| 				// We're leaving the formation, so stop our FormationWalk order
|1210|1210| 				if (this.FinishOrder())
|1211|1211| 					return;
|1212|    |-			}
|    |1212|+			
|1213|1213| 
|1214|1214| 			// No orders left, we're an individual now
|1215|1215| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1233|1233| 			// Move a tile outside the building
|1234|1234| 			let range = 4;
|1235|1235| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1236|    |-			{
|    |1236|+			
|1237|1237| 				// We are already at the target, or can't move at all
|1238|1238| 				this.FinishOrder();
|1239|    |-			}
|    |1239|+			
|1240|1240| 			else
|1241|1241| 			{
|1242|1242| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1454|1454| 
|1455|1455| 			"LosRangeUpdate": function(msg) {
|1456|1456| 				if (this.GetStance().targetVisibleEnemies)
|1457|    |-				{
|    |1457|+				
|1458|1458| 					// Start attacking one of the newly-seen enemy (if any)
|1459|1459| 					this.AttackEntitiesByPreference(msg.data.added);
|1460|    |-				}
|    |1460|+				
|1461|1461| 			},
|1462|1462| 
|1463|1463| 			"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
|1487|1487| 				this.SelectAnimation("move");
|1488|1488| 			},
|1489|1489| 
|1490|    |-			"leave": function () {
|    |1490|+			"leave": function() {
|1491|1491| 				this.SelectAnimation("idle");
|1492|1492| 				this.StopMoving();
|1493|1493| 			},
|    | [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
|1667|1667| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1668|1668| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1669|1669| 						if (cmpHealth && cmpHealth.IsInjured())
|1670|    |-						{
|    |1670|+						
|1671|1671| 							if (this.CanHeal(this.isGuardOf))
|1672|1672| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1673|1673| 							else if (this.CanRepair(this.isGuardOf))
|1674|1674| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1675|    |-						}
|    |1675|+						
|1676|1676| 					}
|1677|1677| 				},
|1678|1678| 
|    | [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
|1794|1794| 					}
|1795|1795| 					// Check the target is still alive and attackable
|1796|1796| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1797|    |-					{
|    |1797|+					
|1798|1798| 						// Can't reach it - try to chase after it
|1799|1799| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1800|1800| 						{
|1809|1809| 								return true;
|1810|1810| 							}
|1811|1811| 						}
|1812|    |-					}
|    |1812|+					
|1813|1813| 
|1814|1814| 					this.StopMoving();
|1815|1815| 
|    | [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
|1842|1842| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1843|1843| 
|1844|1844| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1845|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1845|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1846|1846| 
|1847|1847| 					this.FaceTowardsTarget(this.order.data.target);
|1848|1848| 
|    | [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
|1971|1971| 
|1972|1972| 				"Attacked": function(msg) {
|1973|1973| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1974|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1975|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1974|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1975|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1976|1976| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1977|1977| 				},
|1978|1978| 			},
|    | [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
|1991|1991| 					this.SelectAnimation("move");
|1992|1992| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1993|1993| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1994|    |-					{
|    |1994|+					
|1995|1995| 						// Run after a fleeing target
|1996|1996| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|1997|    |-					}
|    |1997|+					
|1998|1998| 					this.StartTimer(1000, 1000);
|1999|1999| 				},
|2000|2000| 
|    | [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
|2176|2176| 
|2177|2177| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2178|2178| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2179|    |-					{
|    |2179|+					
|2180|2180| 						// Check we can still reach and gather from the target
|2181|2181| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2182|2182| 						{
|2241|2241| 								return;
|2242|2242| 							}
|2243|2243| 						}
|2244|    |-					}
|    |2244|+					
|2245|2245| 
|2246|2246| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2247|2247| 
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2267|2267| 					// Also don't switch to a different type of huntable animal
|2268|2268| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2269|2269| 						return (
|2270|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2271|    |-							|| (type.specific == resourceType.specific
|    |2270|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2271|+							(type.specific == resourceType.specific
|2272|2272| 							&& (type.specific != "meat" || resourceTemplate == template))
|2273|2273| 						);
|2274|2274| 					});
|    | [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
|2268|2268| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2269|2269| 						return (
|2270|2270| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2271|    |-							|| (type.specific == resourceType.specific
|2272|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2271|+							|| (type.specific == resourceType.specific &&
|    |2272|+							(type.specific != "meat" || resourceTemplate == template))
|2273|2273| 						);
|2274|2274| 					});
|2275|2275| 					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
|2333|2333| 
|2334|2334| 				"Timer": function(msg) {
|2335|2335| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2336|    |-					{
|    |2336|+					
|2337|2337| 						// Return to our original position unless we have a better order.
|2338|2338| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2339|2339| 							this.WalkToHeldPosition();
|2340|    |-					}
|    |2340|+					
|2341|2341| 				},
|2342|2342| 
|2343|2343| 				"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
|2367|2367| 					this.StartTimer(prepare, this.healTimers.repeat);
|2368|2368| 
|2369|2369| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2370|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2370|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2371|2371| 
|2372|2372| 					this.FaceTowardsTarget(this.order.data.target);
|2373|2373| 				},
|    | [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
|2583|2583| 					{
|2584|2584| 						// The building was already finished/fully repaired before we arrived;
|2585|2585| 						// let the ConstructionFinished handler handle this.
|2586|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2586|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2587|2587| 						return true;
|2588|2588| 					}
|2589|2589| 
|    | [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
|2583|2583| 					{
|2584|2584| 						// The building was already finished/fully repaired before we arrived;
|2585|2585| 						// let the ConstructionFinished handler handle this.
|2586|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2586|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2587|2587| 						return true;
|2588|2588| 					}
|2589|2589| 
|    | [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
|2626|2626| 					if (!inRange && this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2627|2627| 						this.SetNextState("APPROACHING");
|2628|2628| 					else if (!inRange)
|2629|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2629|+						this.FinishOrder(); // can't approach and isn't in reach
|2630|2630| 				},
|2631|2631| 			},
|2632|2632| 
|    | [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
|2713|2713| 
|2714|2714| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2715|2715| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2716|    |-				{
|    |2716|+				
|2717|2717| 					// We're already walking to the given point, so add this as a order.
|2718|2718| 					this.WalkToTarget(msg.data.newentity, true);
|2719|    |-				}
|    |2719|+				
|2720|2720| 			},
|2721|2721| 		},
|2722|2722| 
|    | [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
|2776|2776| 
|2777|2777| 					// Check that we can garrison here
|2778|2778| 					if (this.CanGarrison(target))
|2779|    |-					{
|    |2779|+					
|2780|2780| 						// Check that we're in range of the garrison target
|2781|2781| 						if (this.CheckGarrisonRange(target))
|2782|2782| 						{
|2852|2852| 								return false;
|2853|2853| 							}
|2854|2854| 						}
|2855|    |-					}
|    |2855|+					
|2856|2856| 					// Garrisoning failed for some reason, so finish the order
|2857|2857| 					this.FinishOrder();
|2858|2858| 					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
|2974|2974| 		"Attacked": function(msg) {
|2975|2975| 			if (this.template.NaturalBehaviour == "skittish" ||
|2976|2976| 			    this.template.NaturalBehaviour == "passive")
|2977|    |-			{
|    |2977|+			
|2978|2978| 				this.Flee(msg.data.attacker, false);
|2979|    |-			}
|    |2979|+			
|2980|2980| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2981|2981| 			{
|2982|2982| 				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
|2983|2983| 					this.Attack(msg.data.attacker, false);
|2984|2984| 			}
|2985|2985| 			else if (this.template.NaturalBehaviour == "domestic")
|2986|    |-			{
|    |2986|+			
|2987|2987| 				// Never flee, stop what we were doing
|2988|2988| 				this.SetNextState("IDLE");
|2989|    |-			}
|    |2989|+			
|2990|2990| 		},
|2991|2991| 
|2992|2992| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2997|2997| 				this.FinishOrder();
|2998|2998| 				return;
|2999|2999| 			}
|3000|    |-			else
|3001|    |-			{
|    |3000|+			
|3002|3001| 				this.order.data.min = range;
|3003|3002| 				this.SetNextState("WALKING");
|3004|    |-			}
|    |3003|+			
|3005|3004| 		},
|3006|3005| 
|3007|3006| 		"IDLE": {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3041|3041| 				}
|3042|3042| 				// Start attacking one of the newly-seen enemy (if any)
|3043|3043| 				else if (this.IsDangerousAnimal())
|3044|    |-				{
|    |3044|+				
|3045|3045| 					this.AttackVisibleEntity(msg.data.added);
|3046|    |-				}
|    |3046|+				
|3047|3047| 
|3048|3048| 				// TODO: if two units enter our range together, we'll attack the
|3049|3049| 				// 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
|3084|3084| 				}
|3085|3085| 				// Start attacking one of the newly-seen enemy (if any)
|3086|3086| 				else if (this.template.NaturalBehaviour == "violent")
|3087|    |-				{
|    |3087|+				
|3088|3088| 					this.AttackVisibleEntity(msg.data.added);
|3089|    |-				}
|    |3089|+				
|3090|3090| 			},
|3091|3091| 
|3092|3092| 			"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
|3099|3099| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3100|3100| 
|3101|3101| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3102|    |-							// only used for domestic animals
|    |3102|+		// only used for domestic animals
|3103|3103| 	},
|3104|3104| };
|3105|3105| 
|    | [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
|3156|3156| 
|3157|3157| UnitAI.prototype.IsAnimal = function()
|3158|3158| {
|3159|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3159|+	return (!!this.template.NaturalBehaviour);
|3160|3160| };
|3161|3161| 
|3162|3162| 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
|3194|3194| UnitAI.prototype.GetGarrisonHolder = function()
|3195|3195| {
|3196|3196| 	if (this.IsGarrisoned())
|3197|    |-	{
|    |3197|+	
|3198|3198| 		for (let order of this.orderQueue)
|3199|3199| 			if (order.type == "Garrison")
|3200|3200| 				return order.data.target;
|3201|    |-	}
|    |3201|+	
|3202|3202| 	return INVALID_ENTITY;
|3203|3203| };
|3204|3204| 
|    | [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
|3272|3272| 		{
|3273|3273| 			let index = this.GetCurrentState().indexOf(".");
|3274|3274| 			if (index != -1)
|3275|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3275|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3276|3276| 			this.Stop(false);
|3277|3277| 		}
|3278|3278| 
|    | [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
|3328|3328| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3329|3329| 			continue;
|3330|3330| 		if (i == 0)
|3331|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3331|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3332|3332| 		else
|3333|3333| 			this.orderQueue.splice(i, 1);
|3334|3334| 		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
|3328|3328| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3329|3329| 			continue;
|3330|3330| 		if (i == 0)
|3331|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3331|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3332|3332| 		else
|3333|3333| 			this.orderQueue.splice(i, 1);
|3334|3334| 		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
|3412|3412| };
|3413|3413| 
|3414|3414| 
|3415|    |-//// FSM linkage functions ////
|    |3415|+// // FSM linkage functions ////
|3416|3416| 
|3417|3417| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3418|3418| 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
|3584|3584| 				continue;
|3585|3585| 			if (this.orderQueue[i].type == type)
|3586|3586| 				continue;
|3587|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3587|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3588|3588| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3589|3589| 			return;
|3590|3590| 		}
|    | [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
|3584|3584| 				continue;
|3585|3585| 			if (this.orderQueue[i].type == type)
|3586|3586| 				continue;
|3587|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3587|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3588|3588| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3589|3589| 			return;
|3590|3590| 		}
|    | [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
|3598|3598| {
|3599|3599| 	// Remember the previous work orders to be able to go back to them later if required
|3600|3600| 	if (data && data.force)
|3601|    |-	{
|    |3601|+	
|3602|3602| 		if (this.IsFormationController())
|3603|3603| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3604|3604| 		else
|3605|3605| 			this.UpdateWorkOrders(type);
|3606|    |-	}
|    |3606|+	
|3607|3607| 
|3608|3608| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3609|3609| 
|    | [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
|3675|3675| 	{
|3676|3676| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3677|3677| 		if (cmpUnitAI)
|3678|    |-		{
|    |3678|+		
|3679|3679| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3680|3680| 			{
|3681|3681| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3684|3684| 					return;
|3685|3685| 				}
|3686|3686| 			}
|3687|    |-		}
|    |3687|+		
|3688|3688| 	}
|3689|3689| 
|3690|3690| 	// 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
|3677|3677| 		if (cmpUnitAI)
|3678|3678| 		{
|3679|3679| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3680|    |-			{
|    |3680|+			
|3681|3681| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3682|3682| 				{
|3683|3683| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3684|3684| 					return;
|3685|3685| 				}
|3686|    |-			}
|    |3686|+			
|3687|3687| 		}
|3688|3688| 	}
|3689|3689| 
|    | [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| 
|3690|3690| 	// If nothing found, take the unit orders
|3691|3691| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3692|    |-	{
|    |3692|+	
|3693|3693| 		if (isWorkType(this.orderQueue[i].type))
|3694|3694| 		{
|3695|3695| 			this.workOrders = this.orderQueue.slice(i);
|3696|3696| 			return;
|3697|3697| 		}
|3698|    |-	}
|    |3698|+	
|3699|3699| };
|3700|3700| 
|3701|3701| 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
|3755|3755| 	if (data.timerRepeat === undefined)
|3756|3756| 		this.timer = undefined;
|3757|3757| 
|3758|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3758|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3759|3759| };
|3760|3760| 
|3761|3761| /**
|    | [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
|3755|3755| 	if (data.timerRepeat === undefined)
|3756|3756| 		this.timer = undefined;
|3757|3757| 
|3758|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3758|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3759|3759| };
|3760|3760| 
|3761|3761| /**
|    | [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
|3790|3790| 	this.timer = undefined;
|3791|3791| };
|3792|3792| 
|3793|    |-//// Message handlers /////
|    |3793|+// // Message handlers /////
|3794|3794| 
|3795|3795| UnitAI.prototype.OnMotionChanged = function(msg)
|3796|3796| {
|    | [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
|3802|3802| 	// TODO: This is a bit inefficient since every unit listens to every
|3803|3803| 	// construction message - ideally we could scope it to only the one we're building
|3804|3804| 
|3805|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3805|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3806|3806| };
|3807|3807| 
|3808|3808| 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
|3802|3802| 	// TODO: This is a bit inefficient since every unit listens to every
|3803|3803| 	// construction message - ideally we could scope it to only the one we're building
|3804|3804| 
|3805|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3805|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3806|3806| };
|3807|3807| 
|3808|3808| 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
|3827|3827| 
|3828|3828| UnitAI.prototype.OnAttacked = function(msg)
|3829|3829| {
|3830|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3830|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3831|3831| };
|3832|3832| 
|3833|3833| 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
|3827|3827| 
|3828|3828| UnitAI.prototype.OnAttacked = function(msg)
|3829|3829| {
|3830|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3830|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3831|3831| };
|3832|3832| 
|3833|3833| 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
|3832|3832| 
|3833|3833| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3834|3834| {
|3835|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3835|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3836|3836| };
|3837|3837| 
|3838|3838| 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
|3832|3832| 
|3833|3833| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3834|3834| {
|3835|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3835|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3836|3836| };
|3837|3837| 
|3838|3838| 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
|3837|3837| 
|3838|3838| UnitAI.prototype.OnHealthChanged = function(msg)
|3839|3839| {
|3840|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3840|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3841|3841| };
|3842|3842| 
|3843|3843| 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
|3837|3837| 
|3838|3838| UnitAI.prototype.OnHealthChanged = function(msg)
|3839|3839| {
|3840|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3840|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3841|3841| };
|3842|3842| 
|3843|3843| 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
|3843|3843| UnitAI.prototype.OnRangeUpdate = function(msg)
|3844|3844| {
|3845|3845| 	if (msg.tag == this.losRangeQuery)
|3846|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3846|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3847|3847| 	else if (msg.tag == this.losHealRangeQuery)
|3848|3848| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3849|3849| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3843|3843| UnitAI.prototype.OnRangeUpdate = function(msg)
|3844|3844| {
|3845|3845| 	if (msg.tag == this.losRangeQuery)
|3846|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3846|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3847|3847| 	else if (msg.tag == this.losHealRangeQuery)
|3848|3848| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3849|3849| };
|    | [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
|3845|3845| 	if (msg.tag == this.losRangeQuery)
|3846|3846| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3847|3847| 	else if (msg.tag == this.losHealRangeQuery)
|3848|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3848|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3849|3849| };
|3850|3850| 
|3851|3851| 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
|3845|3845| 	if (msg.tag == this.losRangeQuery)
|3846|3846| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3847|3847| 	else if (msg.tag == this.losHealRangeQuery)
|3848|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3848|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3849|3849| };
|3850|3850| 
|3851|3851| 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
|3850|3850| 
|3851|3851| UnitAI.prototype.OnPackFinished = function(msg)
|3852|3852| {
|3853|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3853|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3854|3854| };
|3855|3855| 
|3856|3856| //// 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
|3850|3850| 
|3851|3851| UnitAI.prototype.OnPackFinished = function(msg)
|3852|3852| {
|3853|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3853|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3854|3854| };
|3855|3855| 
|3856|3856| //// 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
|3853|3853| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3854|3854| };
|3855|3855| 
|3856|    |-//// Helper functions to be called by the FSM ////
|    |3856|+// // Helper functions to be called by the FSM ////
|3857|3857| 
|3858|3858| UnitAI.prototype.GetWalkSpeed = function()
|3859|3859| {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3955|3955| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3956|3956| 		return undefined;
|3957|3957| 
|3958|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3958|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3959|3959| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3960|3960| 		return undefined;
|3961|3961| 
|    | [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
|4040|4040| 			PlaySound(name, member);
|4041|4041| 	}
|4042|4042| 	else
|4043|    |-	{
|    |4043|+	
|4044|4044| 		// Otherwise use our own sounds
|4045|4045| 		PlaySound(name, this.entity);
|4046|    |-	}
|    |4046|+	
|4047|4047| };
|4048|4048| 
|4049|4049| /*
|    | [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
|4232|4232| 	else
|4233|4233| 		// return false? Or hope you come close enough?
|4234|4234| 		var parabolicMaxRange = 0;
|4235|    |-		//return false;
|    |4235|+		// return false;
|4236|4236| 
|4237|4237| 	// the parabole changes while walking, take something in the middle
|4238|4238| 	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
|4319|4319| 	if (this.IsFormationMember())
|4320|4320| 	{
|4321|4321| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4322|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4323|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4322|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4323|+			cmpFormationUnitAI.order.data.target == target)
|4324|4324| 			return true;
|4325|4325| 	}
|4326|4326| 
|    | [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
|4487|4487| UnitAI.prototype.AttackEntityInZone = function(ents)
|4488|4488| {
|4489|4489| 	var target = ents.find(target =>
|4490|    |-		this.CanAttack(target)
|4491|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4490|+		this.CanAttack(target) &&
|    |4491|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4492|4492| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4493|4493| 	);
|4494|4494| 	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
|4488|4488| {
|4489|4489| 	var target = ents.find(target =>
|4490|4490| 		this.CanAttack(target)
|4491|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4492|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4491|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4492|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4493|4493| 	);
|4494|4494| 	if (!target)
|4495|4495| 		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
|4552|4552| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4553|4553| 	if (this.isGuardOf)
|4554|4554| 	{
|4555|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4555|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4556|4556| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4557|4557| 		if (cmpUnitAI && cmpAttack &&
|4558|4558| 		    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
|4556|4556| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4557|4557| 		if (cmpUnitAI && cmpAttack &&
|4558|4558| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4559|    |-				return false;
|    |4559|+			return false;
|4560|4560| 	}
|4561|4561| 
|4562|4562| 	// 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
|4561|4561| 
|4562|4562| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4563|4563| 	if (this.GetStance().respondHoldGround)
|4564|    |-	{
|    |4564|+	
|4565|4565| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4566|4566| 			return true;
|4567|    |-	}
|    |4567|+	
|4568|4568| 
|4569|4569| 	// Stop if it's left our vision range, unless we're especially persistent
|4570|4570| 	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
|4568|4568| 
|4569|4569| 	// Stop if it's left our vision range, unless we're especially persistent
|4570|4570| 	if (!this.GetStance().respondChaseBeyondVision)
|4571|    |-	{
|    |4571|+	
|4572|4572| 		if (!this.CheckTargetIsInVisionRange(target))
|4573|4573| 			return true;
|4574|    |-	}
|    |4574|+	
|4575|4575| 
|4576|4576| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4577|4577| 	// 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
|4594|4594| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4595|4595| 	if (this.isGuardOf)
|4596|4596| 	{
|4597|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4597|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4598|4598| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4599|4599| 		if (cmpUnitAI && cmpAttack &&
|4600|4600| 		    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
|4607|4607| 	return false;
|4608|4608| };
|4609|4609| 
|4610|    |-//// External interface functions ////
|    |4610|+// // External interface functions ////
|4611|4611| 
|4612|4612| UnitAI.prototype.SetFormationController = function(ent)
|4613|4613| {
|    | [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
|4617|4617| 	// of our own formation (or ourself if not in formation)
|4618|4618| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4619|4619| 	if (cmpObstruction)
|4620|    |-	{
|    |4620|+	
|4621|4621| 		if (ent == INVALID_ENTITY)
|4622|4622| 			cmpObstruction.SetControlGroup(this.entity);
|4623|4623| 		else
|4624|4624| 			cmpObstruction.SetControlGroup(ent);
|4625|    |-	}
|    |4625|+	
|4626|4626| 
|4627|4627| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4628|4628| 	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
|4760|4760| 	// if we already had an old guard order, do nothing if the target is the same
|4761|4761| 	// and the order is running, otherwise remove the previous order
|4762|4762| 	if (this.isGuardOf)
|4763|    |-	{
|    |4763|+	
|4764|4764| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4765|4765| 			return;
|4766|4766| 		else
|4767|4767| 			this.RemoveGuard();
|4768|    |-	}
|    |4768|+	
|4769|4769| 
|4770|4770| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4771|4771| };
|    | [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
|4763|4763| 	{
|4764|4764| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4765|4765| 			return;
|4766|    |-		else
|4767|    |-			this.RemoveGuard();
|    |4766|+		this.RemoveGuard();
|4768|4767| 	}
|4769|4768| 
|4770|4769| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4934|4934| 			this.WalkToTarget(target, queued);
|4935|4935| 		return;
|4936|4936| 	}
|4937|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4937|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4938|4938| };
|4939|4939| 
|4940|4940| /**
|    | [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
|5083|5083| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5084|5084| 	{
|5085|5085| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5086|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5086|+		if (cmpTrader.HasBothMarkets() &&
|5087|5087| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5088|5088| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5089|5089| 		{
|    | [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
|5364|5364| 				{
|5365|5365| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5366|5366| 					var targetClasses = this.order.data.targetClasses;
|5367|    |-					if (targetClasses.attack && cmpIdentity
|5368|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5367|+					if (targetClasses.attack && cmpIdentity &&
|    |5368|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5369|5369| 						continue;
|5370|5370| 					if (targetClasses.avoid && cmpIdentity
|5371|5371| 						&& 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
|5367|5367| 					if (targetClasses.attack && cmpIdentity
|5368|5368| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5369|5369| 						continue;
|5370|    |-					if (targetClasses.avoid && cmpIdentity
|5371|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5370|+					if (targetClasses.avoid && cmpIdentity &&
|    |5371|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5372|5372| 						continue;
|5373|5373| 					// Only used by the AIs to prevent some choices of targets
|5374|5374| 					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
|5390|5390| 		{
|5391|5391| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5392|5392| 			var targetClasses = this.order.data.targetClasses;
|5393|    |-			if (cmpIdentity && targetClasses.attack
|5394|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5393|+			if (cmpIdentity && targetClasses.attack &&
|    |5394|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5395|5395| 				continue;
|5396|5396| 			if (cmpIdentity && targetClasses.avoid
|5397|5397| 				&& 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
|5393|5393| 			if (cmpIdentity && targetClasses.attack
|5394|5394| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5395|5395| 				continue;
|5396|    |-			if (cmpIdentity && targetClasses.avoid
|5397|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5396|+			if (cmpIdentity && targetClasses.avoid &&
|    |5397|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5398|5398| 				continue;
|5399|5399| 			// Only used by the AIs to prevent some choices of targets
|5400|5400| 			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
|5536|5536| 
|5537|5537| UnitAI.prototype.SetHeldPosition = function(x, z)
|5538|5538| {
|5539|    |-	this.heldPosition = {"x": x, "z": z};
|    |5539|+	this.heldPosition = { "x": x, "z": z};
|5540|5540| };
|5541|5541| 
|5542|5542| 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
|5536|5536| 
|5537|5537| UnitAI.prototype.SetHeldPosition = function(x, z)
|5538|5538| {
|5539|    |-	this.heldPosition = {"x": x, "z": z};
|    |5539|+	this.heldPosition = {"x": x, "z": z };
|5540|5540| };
|5541|5541| 
|5542|5542| 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
|5563|5563| 	return false;
|5564|5564| };
|5565|5565| 
|5566|    |-//// Helper functions ////
|    |5566|+// // Helper functions ////
|5567|5567| 
|5568|5568| UnitAI.prototype.CanAttack = function(target)
|5569|5569| {
|    | [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
|5767|5767| 	return cmpPack && cmpPack.IsPacking();
|5768|5768| };
|5769|5769| 
|5770|    |-//// Formation specific functions ////
|    |5770|+// // Formation specific functions ////
|5771|5771| 
|5772|5772| UnitAI.prototype.IsAttackingAsFormation = function()
|5773|5773| {
|    | [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
|5772|5772| UnitAI.prototype.IsAttackingAsFormation = function()
|5773|5773| {
|5774|5774| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5775|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5776|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5775|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5776|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5777|5777| };
|5778|5778| 
|5779|5779| //// 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
|5776|5776| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5777|5777| };
|5778|5778| 
|5779|    |-//// Animal specific functions ////
|    |5779|+// // Animal specific functions ////
|5780|5780| 
|5781|5781| UnitAI.prototype.MoveRandomly = function(distance)
|5782|5782| {

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|1298| »   »   »   "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
|1481| »   »   »   "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
|1502| »   »   »   "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
|1532| »   »   »   "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
|1687| »   »   »   "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
|1738| »   »   »   »   "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
|1809| »   »   »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1981| »   »   »   »   "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
|2074| »   »   »   »   "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
|2257| »   »   »   »   »   »   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
|2312| »   »   »   »   "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
|2430| »   »   »   »   "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
|2495| »   »   »   »   "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
|2535| »   »   »   »   "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
|2745| »   »   »   »   "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
|2929| »   »   »   »   "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
|3660| »   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
|4474| »   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
|4489| »   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
|4535| »   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
|4558| »   »   ····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
|5014| »   var·lastPos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4245| »   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
|4323| »   »   »   &&·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
|4491| »   »   &&·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
|4492| »   »   &&·(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
|5014| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5776| »   »   &&·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/1674/display/redirect