Page MenuHomeWildfire Games

Stop chasing entity when it garrisons.
Needs ReviewPublic

Authored by Freagarach on Sun, Jun 9, 8:41 AM.

Details

Reviewers
wraitii
Summary

When someone orders a unit to attack an entity and that entity garrisons while the unit is still approaching the attacker stays in walking animation whilst the entity is garrisoned, which is weird.
This should fix that.

Test Plan

Attack an entity standing next to a building, then, when the attacker is nigh, garrison the entity. The unit keeps walking on the spot next to the building.
Apply this patch and see how the attacker stops when its target is garrisoned.

Diff Detail

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

Event Timeline

Freagarach created this revision.Sun, Jun 9, 8:41 AM
Vulcan added a comment.Sun, Jun 9, 8:43 AM

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
| 990| 990| 			},
| 991| 991| 		},
| 992| 992| 
| 993|    |-		"GARRISON":{
|    | 993|+		"GARRISON": {
| 994| 994| 			"enter": function() {
| 995| 995| 				// If the garrisonholder should pickup, warn it so it can take needed action
| 996| 996| 				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
|1201|1201| 			// If the controller handled an order but some members rejected it,
|1202|1202| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1203|1203| 			if (this.orderQueue.length)
|1204|    |-			{
|    |1204|+			
|1205|1205| 				// We're leaving the formation, so stop our FormationWalk order
|1206|1206| 				if (this.FinishOrder())
|1207|1207| 					return;
|1208|    |-			}
|    |1208|+			
|1209|1209| 
|1210|1210| 			// No orders left, we're an individual now
|1211|1211| 			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
|1229|1229| 			// Move a tile outside the building
|1230|1230| 			let range = 4;
|1231|1231| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1232|    |-			{
|    |1232|+			
|1233|1233| 				// We are already at the target, or can't move at all
|1234|1234| 				this.FinishOrder();
|1235|    |-			}
|    |1235|+			
|1236|1236| 			else
|1237|1237| 			{
|1238|1238| 				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
|1444|1444| 
|1445|1445| 			"LosRangeUpdate": function(msg) {
|1446|1446| 				if (this.GetStance().targetVisibleEnemies)
|1447|    |-				{
|    |1447|+				
|1448|1448| 					// Start attacking one of the newly-seen enemy (if any)
|1449|1449| 					this.AttackEntitiesByPreference(msg.data.added);
|1450|    |-				}
|    |1450|+				
|1451|1451| 			},
|1452|1452| 
|1453|1453| 			"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
|1477|1477| 				this.SelectAnimation("move");
|1478|1478| 			},
|1479|1479| 
|1480|    |-			"leave": function () {
|    |1480|+			"leave": function() {
|1481|1481| 				this.SelectAnimation("idle");
|1482|1482| 				this.StopMoving();
|1483|1483| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1653|1653| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1654|1654| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1655|1655| 						if (cmpHealth && cmpHealth.IsInjured())
|1656|    |-						{
|    |1656|+						
|1657|1657| 							if (this.CanHeal(this.isGuardOf))
|1658|1658| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1659|1659| 							else if (this.CanRepair(this.isGuardOf))
|1660|1660| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1661|    |-						}
|    |1661|+						
|1662|1662| 					}
|1663|1663| 				},
|1664|1664| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1756|1756| 				"MoveCompleted": function() {
|1757|1757| 
|1758|1758| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1759|    |-					{
|    |1759|+					
|1760|1760| 						// If the unit needs to unpack, do so
|1761|1761| 						if (this.CanUnpack())
|1762|1762| 						{
|1765|1765| 						}
|1766|1766| 						else
|1767|1767| 							this.SetNextState("ATTACKING");
|1768|    |-					}
|    |1768|+					
|1769|1769| 					else
|1770|1770| 					{
|1771|1771| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1763|1763| 							this.PushOrderFront("Unpack", { "force": true });
|1764|1764| 							return;
|1765|1765| 						}
|1766|    |-						else
|1767|    |-							this.SetNextState("ATTACKING");
|    |1766|+						this.SetNextState("ATTACKING");
|1768|1767| 					}
|1769|1768| 					else
|1770|1769| 					{
|    | [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
|1767|1767| 							this.SetNextState("ATTACKING");
|1768|1768| 					}
|1769|1769| 					else
|1770|    |-					{
|    |1770|+					
|1771|1771| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1772|1772| 						{
|1773|1773| 							this.SetNextState("APPROACHING");
|1777|1777| 							// Give up
|1778|1778| 							this.FinishOrder();
|1779|1779| 						}
|1780|    |-					}
|    |1780|+					
|1781|1781| 				},
|1782|1782| 			},
|1783|1783| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1769|1769| 					else
|1770|1770| 					{
|1771|1771| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1772|    |-						{
|    |1772|+						
|1773|1773| 							this.SetNextState("APPROACHING");
|1774|    |-						}
|    |1774|+						
|1775|1775| 						else
|1776|1776| 						{
|1777|1777| 							// Give up
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1773|1773| 							this.SetNextState("APPROACHING");
|1774|1774| 						}
|1775|1775| 						else
|1776|    |-						{
|    |1776|+						
|1777|1777| 							// Give up
|1778|1778| 							this.FinishOrder();
|1779|    |-						}
|    |1779|+						
|1780|1780| 					}
|1781|1781| 				},
|1782|1782| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/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
|2174|2174| 
|2175|2175| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2176|2176| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2177|    |-					{
|    |2177|+					
|2178|2178| 						// Check we can still reach and gather from the target
|2179|2179| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2180|2180| 						{
|2239|2239| 								return;
|2240|2240| 							}
|2241|2241| 						}
|2242|    |-					}
|    |2242|+					
|2243|2243| 
|2244|2244| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2245|2245| 
|    | [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
|2265|2265| 					// Also don't switch to a different type of huntable animal
|2266|2266| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2267|2267| 						return (
|2268|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2269|    |-							|| (type.specific == resourceType.specific
|    |2268|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2269|+							(type.specific == resourceType.specific
|2270|2270| 							&& (type.specific != "meat" || resourceTemplate == template))
|2271|2271| 						);
|2272|2272| 					});
|    | [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
|2266|2266| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2267|2267| 						return (
|2268|2268| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2269|    |-							|| (type.specific == resourceType.specific
|2270|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2269|+							|| (type.specific == resourceType.specific &&
|    |2270|+							(type.specific != "meat" || resourceTemplate == template))
|2271|2271| 						);
|2272|2272| 					});
|2273|2273| 					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
|2331|2331| 
|2332|2332| 				"Timer": function(msg) {
|2333|2333| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2334|    |-					{
|    |2334|+					
|2335|2335| 						// Return to our original position unless we have a better order.
|2336|2336| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2337|2337| 							this.WalkToHeldPosition();
|2338|    |-					}
|    |2338|+					
|2339|2339| 				},
|2340|2340| 
|2341|2341| 				"MoveCompleted": 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
|2365|2365| 					this.StartTimer(prepare, this.healTimers.repeat);
|2366|2366| 
|2367|2367| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2368|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2368|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2369|2369| 
|2370|2370| 					this.FaceTowardsTarget(this.order.data.target);
|2371|2371| 				},
|    | [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
|2577|2577| 					{
|2578|2578| 						// The building was already finished/fully repaired before we arrived;
|2579|2579| 						// let the ConstructionFinished handler handle this.
|2580|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2580|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2581|2581| 						return true;
|2582|2582| 					}
|2583|2583| 
|    | [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
|2577|2577| 					{
|2578|2578| 						// The building was already finished/fully repaired before we arrived;
|2579|2579| 						// let the ConstructionFinished handler handle this.
|2580|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2580|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2581|2581| 						return true;
|2582|2582| 					}
|2583|2583| 
|    | [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
|2620|2620| 					if (!inRange && this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2621|2621| 						this.SetNextState("APPROACHING");
|2622|2622| 					else if (!inRange)
|2623|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2623|+						this.FinishOrder(); // can't approach and isn't in reach
|2624|2624| 				},
|2625|2625| 			},
|2626|2626| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2707|2707| 
|2708|2708| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2709|2709| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2710|    |-				{
|    |2710|+				
|2711|2711| 					// We're already walking to the given point, so add this as a order.
|2712|2712| 					this.WalkToTarget(msg.data.newentity, true);
|2713|    |-				}
|    |2713|+				
|2714|2714| 			},
|2715|2715| 		},
|2716|2716| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2769|2769| 
|2770|2770| 					// Check that we can garrison here
|2771|2771| 					if (this.CanGarrison(target))
|2772|    |-					{
|    |2772|+					
|2773|2773| 						// Check that we're in range of the garrison target
|2774|2774| 						if (this.CheckGarrisonRange(target))
|2775|2775| 						{
|2845|2845| 								return false;
|2846|2846| 							}
|2847|2847| 						}
|2848|    |-					}
|    |2848|+					
|2849|2849| 					// Garrisoning failed for some reason, so finish the order
|2850|2850| 					this.FinishOrder();
|2851|2851| 					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
|2966|2966| 		"Attacked": function(msg) {
|2967|2967| 			if (this.template.NaturalBehaviour == "skittish" ||
|2968|2968| 			    this.template.NaturalBehaviour == "passive")
|2969|    |-			{
|    |2969|+			
|2970|2970| 				this.Flee(msg.data.attacker, false);
|2971|    |-			}
|    |2971|+			
|2972|2972| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2973|2973| 			{
|2974|2974| 				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
|2975|2975| 					this.Attack(msg.data.attacker, false);
|2976|2976| 			}
|2977|2977| 			else if (this.template.NaturalBehaviour == "domestic")
|2978|    |-			{
|    |2978|+			
|2979|2979| 				// Never flee, stop what we were doing
|2980|2980| 				this.SetNextState("IDLE");
|2981|    |-			}
|    |2981|+			
|2982|2982| 		},
|2983|2983| 
|2984|2984| 		"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
|2989|2989| 				this.FinishOrder();
|2990|2990| 				return;
|2991|2991| 			}
|2992|    |-			else
|2993|    |-			{
|    |2992|+			
|2994|2993| 				this.order.data.min = range;
|2995|2994| 				this.SetNextState("WALKING");
|2996|    |-			}
|    |2995|+			
|2997|2996| 		},
|2998|2997| 
|2999|2998| 		"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
|3033|3033| 				}
|3034|3034| 				// Start attacking one of the newly-seen enemy (if any)
|3035|3035| 				else if (this.IsDangerousAnimal())
|3036|    |-				{
|    |3036|+				
|3037|3037| 					this.AttackVisibleEntity(msg.data.added);
|3038|    |-				}
|    |3038|+				
|3039|3039| 
|3040|3040| 				// TODO: if two units enter our range together, we'll attack the
|3041|3041| 				// 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
|3076|3076| 				}
|3077|3077| 				// Start attacking one of the newly-seen enemy (if any)
|3078|3078| 				else if (this.template.NaturalBehaviour == "violent")
|3079|    |-				{
|    |3079|+				
|3080|3080| 					this.AttackVisibleEntity(msg.data.added);
|3081|    |-				}
|    |3081|+				
|3082|3082| 			},
|3083|3083| 
|3084|3084| 			"MoveCompleted": function() { },
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3093|3093| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3094|3094| 
|3095|3095| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3096|    |-							// only used for domestic animals
|    |3096|+		// only used for domestic animals
|3097|3097| 	},
|3098|3098| };
|3099|3099| 
|    | [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
|3150|3150| 
|3151|3151| UnitAI.prototype.IsAnimal = function()
|3152|3152| {
|3153|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3153|+	return (!!this.template.NaturalBehaviour);
|3154|3154| };
|3155|3155| 
|3156|3156| 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
|3188|3188| UnitAI.prototype.GetGarrisonHolder = function()
|3189|3189| {
|3190|3190| 	if (this.IsGarrisoned())
|3191|    |-	{
|    |3191|+	
|3192|3192| 		for (let order of this.orderQueue)
|3193|3193| 			if (order.type == "Garrison")
|3194|3194| 				return order.data.target;
|3195|    |-	}
|    |3195|+	
|3196|3196| 	return INVALID_ENTITY;
|3197|3197| };
|3198|3198| 
|    | [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
|3266|3266| 		{
|3267|3267| 			let index = this.GetCurrentState().indexOf(".");
|3268|3268| 			if (index != -1)
|3269|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3269|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3270|3270| 			this.Stop(false);
|3271|3271| 		}
|3272|3272| 
|    | [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
|3322|3322| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3323|3323| 			continue;
|3324|3324| 		if (i == 0)
|3325|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3325|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3326|3326| 		else
|3327|3327| 			this.orderQueue.splice(i, 1);
|3328|3328| 		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
|3322|3322| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3323|3323| 			continue;
|3324|3324| 		if (i == 0)
|3325|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3325|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3326|3326| 		else
|3327|3327| 			this.orderQueue.splice(i, 1);
|3328|3328| 		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
|3406|3406| };
|3407|3407| 
|3408|3408| 
|3409|    |-//// FSM linkage functions ////
|    |3409|+// // FSM linkage functions ////
|3410|3410| 
|3411|3411| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3412|3412| 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
|3578|3578| 				continue;
|3579|3579| 			if (this.orderQueue[i].type == type)
|3580|3580| 				continue;
|3581|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3581|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3582|3582| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3583|3583| 			return;
|3584|3584| 		}
|    | [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
|3578|3578| 				continue;
|3579|3579| 			if (this.orderQueue[i].type == type)
|3580|3580| 				continue;
|3581|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3581|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3582|3582| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3583|3583| 			return;
|3584|3584| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3592|3592| {
|3593|3593| 	// Remember the previous work orders to be able to go back to them later if required
|3594|3594| 	if (data && data.force)
|3595|    |-	{
|    |3595|+	
|3596|3596| 		if (this.IsFormationController())
|3597|3597| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3598|3598| 		else
|3599|3599| 			this.UpdateWorkOrders(type);
|3600|    |-	}
|    |3600|+	
|3601|3601| 
|3602|3602| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3603|3603| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3669|3669| 	{
|3670|3670| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3671|3671| 		if (cmpUnitAI)
|3672|    |-		{
|    |3672|+		
|3673|3673| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3674|3674| 			{
|3675|3675| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3678|3678| 					return;
|3679|3679| 				}
|3680|3680| 			}
|3681|    |-		}
|    |3681|+		
|3682|3682| 	}
|3683|3683| 
|3684|3684| 	// 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
|3671|3671| 		if (cmpUnitAI)
|3672|3672| 		{
|3673|3673| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3674|    |-			{
|    |3674|+			
|3675|3675| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3676|3676| 				{
|3677|3677| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3678|3678| 					return;
|3679|3679| 				}
|3680|    |-			}
|    |3680|+			
|3681|3681| 		}
|3682|3682| 	}
|3683|3683| 
|    | [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
|3683|3683| 
|3684|3684| 	// If nothing found, take the unit orders
|3685|3685| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3686|    |-	{
|    |3686|+	
|3687|3687| 		if (isWorkType(this.orderQueue[i].type))
|3688|3688| 		{
|3689|3689| 			this.workOrders = this.orderQueue.slice(i);
|3690|3690| 			return;
|3691|3691| 		}
|3692|    |-	}
|    |3692|+	
|3693|3693| };
|3694|3694| 
|3695|3695| 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
|3749|3749| 	if (data.timerRepeat === undefined)
|3750|3750| 		this.timer = undefined;
|3751|3751| 
|3752|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3752|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3753|3753| };
|3754|3754| 
|3755|3755| /**
|    | [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
|3749|3749| 	if (data.timerRepeat === undefined)
|3750|3750| 		this.timer = undefined;
|3751|3751| 
|3752|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3752|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3753|3753| };
|3754|3754| 
|3755|3755| /**
|    | [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
|3784|3784| 	this.timer = undefined;
|3785|3785| };
|3786|3786| 
|3787|    |-//// Message handlers /////
|    |3787|+// // Message handlers /////
|3788|3788| 
|3789|3789| UnitAI.prototype.OnMotionChanged = function(msg)
|3790|3790| {
|    | [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
|3796|3796| 	// TODO: This is a bit inefficient since every unit listens to every
|3797|3797| 	// construction message - ideally we could scope it to only the one we're building
|3798|3798| 
|3799|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3799|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3800|3800| };
|3801|3801| 
|3802|3802| 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
|3796|3796| 	// TODO: This is a bit inefficient since every unit listens to every
|3797|3797| 	// construction message - ideally we could scope it to only the one we're building
|3798|3798| 
|3799|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3799|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3800|3800| };
|3801|3801| 
|3802|3802| 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
|3821|3821| 
|3822|3822| UnitAI.prototype.OnAttacked = function(msg)
|3823|3823| {
|3824|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3824|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3825|3825| };
|3826|3826| 
|3827|3827| 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
|3821|3821| 
|3822|3822| UnitAI.prototype.OnAttacked = function(msg)
|3823|3823| {
|3824|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3824|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3825|3825| };
|3826|3826| 
|3827|3827| 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
|3826|3826| 
|3827|3827| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3828|3828| {
|3829|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3829|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3830|3830| };
|3831|3831| 
|3832|3832| 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
|3826|3826| 
|3827|3827| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3828|3828| {
|3829|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3829|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3830|3830| };
|3831|3831| 
|3832|3832| 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
|3831|3831| 
|3832|3832| UnitAI.prototype.OnHealthChanged = function(msg)
|3833|3833| {
|3834|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3834|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3835|3835| };
|3836|3836| 
|3837|3837| 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
|3831|3831| 
|3832|3832| UnitAI.prototype.OnHealthChanged = function(msg)
|3833|3833| {
|3834|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3834|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3835|3835| };
|3836|3836| 
|3837|3837| 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
|3837|3837| UnitAI.prototype.OnRangeUpdate = function(msg)
|3838|3838| {
|3839|3839| 	if (msg.tag == this.losRangeQuery)
|3840|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3840|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3841|3841| 	else if (msg.tag == this.losHealRangeQuery)
|3842|3842| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3843|3843| };
|    | [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| UnitAI.prototype.OnRangeUpdate = function(msg)
|3838|3838| {
|3839|3839| 	if (msg.tag == this.losRangeQuery)
|3840|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3840|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3841|3841| 	else if (msg.tag == this.losHealRangeQuery)
|3842|3842| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3843|3843| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3839|3839| 	if (msg.tag == this.losRangeQuery)
|3840|3840| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3841|3841| 	else if (msg.tag == this.losHealRangeQuery)
|3842|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3842|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3843|3843| };
|3844|3844| 
|3845|3845| 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
|3839|3839| 	if (msg.tag == this.losRangeQuery)
|3840|3840| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3841|3841| 	else if (msg.tag == this.losHealRangeQuery)
|3842|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3842|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3843|3843| };
|3844|3844| 
|3845|3845| 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
|3844|3844| 
|3845|3845| UnitAI.prototype.OnPackFinished = function(msg)
|3846|3846| {
|3847|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3847|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3848|3848| };
|3849|3849| 
|3850|3850| //// 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
|3844|3844| 
|3845|3845| UnitAI.prototype.OnPackFinished = function(msg)
|3846|3846| {
|3847|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3847|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3848|3848| };
|3849|3849| 
|3850|3850| //// 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
|3847|3847| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3848|3848| };
|3849|3849| 
|3850|    |-//// Helper functions to be called by the FSM ////
|    |3850|+// // Helper functions to be called by the FSM ////
|3851|3851| 
|3852|3852| UnitAI.prototype.GetWalkSpeed = function()
|3853|3853| {
|    | [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
|3949|3949| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3950|3950| 		return undefined;
|3951|3951| 
|3952|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3952|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3953|3953| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3954|3954| 		return undefined;
|3955|3955| 
|    | [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
|4034|4034| 			PlaySound(name, member);
|4035|4035| 	}
|4036|4036| 	else
|4037|    |-	{
|    |4037|+	
|4038|4038| 		// Otherwise use our own sounds
|4039|4039| 		PlaySound(name, this.entity);
|4040|    |-	}
|    |4040|+	
|4041|4041| };
|4042|4042| 
|4043|4043| /*
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4130|4130| UnitAI.prototype.MoveTo = function(data, iid, type)
|4131|4131| {
|4132|4132| 	if (data["target"])
|4133|    |-	{
|    |4133|+	
|4134|4134| 		if (data["min"] || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|4136| 		else
|4140|4140| 			else
|4141|4141| 				return this.MoveToTargetRange(data.target, iid, type);
|4142|4142| 		}
|4143|    |-	}
|    |4143|+	
|4144|4144| 	else
|4145|4145| 	{
|4146|4146| 		if (data["min"] || data["max"])
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["target"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4129|4129|  */
|4130|4130| UnitAI.prototype.MoveTo = function(data, iid, type)
|4131|4131| {
|4132|    |-	if (data["target"])
|    |4132|+	if (data.target)
|4133|4133| 	{
|4134|4134| 		if (data["min"] || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["min"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4131|4131| {
|4132|4132| 	if (data["target"])
|4133|4133| 	{
|4134|    |-		if (data["min"] || data["max"])
|    |4134|+		if (data.min || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|4136| 		else
|4137|4137| 		{
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["max"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4131|4131| {
|4132|4132| 	if (data["target"])
|4133|4133| 	{
|4134|    |-		if (data["min"] || data["max"])
|    |4134|+		if (data["min"] || data.max)
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|4136| 		else
|4137|4137| 		{
|    | [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
|4134|4134| 		if (data["min"] || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|4136| 		else
|4137|    |-		{
|    |4137|+		
|4138|4138| 			if (!iid)
|4139|4139| 				return this.MoveToTarget(data.target);
|4140|4140| 			else
|4141|4141| 				return this.MoveToTargetRange(data.target, iid, type);
|4142|    |-		}
|    |4142|+		
|4143|4143| 	}
|4144|4144| 	else
|4145|4145| 	{
|    | [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
|4133|4133| 	{
|4134|4134| 		if (data["min"] || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|    |-		else
|4137|    |-		{
|    |4136|+		
|4138|4137| 			if (!iid)
|4139|4138| 				return this.MoveToTarget(data.target);
|4140|4139| 			else
|4141|4140| 				return this.MoveToTargetRange(data.target, iid, type);
|4142|    |-		}
|    |4141|+		
|4143|4142| 	}
|4144|4143| 	else
|4145|4144| 	{
|    | [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
|4137|4137| 		{
|4138|4138| 			if (!iid)
|4139|4139| 				return this.MoveToTarget(data.target);
|4140|    |-			else
|4141|    |-				return this.MoveToTargetRange(data.target, iid, type);
|    |4140|+			return this.MoveToTargetRange(data.target, iid, type);
|4142|4141| 		}
|4143|4142| 	}
|4144|4143| 	else
|    | [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
|4142|4142| 		}
|4143|4143| 	}
|4144|4144| 	else
|4145|    |-	{
|    |4145|+	
|4146|4146| 		if (data["min"] || data["max"])
|4147|4147| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4148|4148| 		else
|4149|4149| 			return this.MoveToPoint(data.x, data.z);
|4150|    |-	}
|    |4150|+	
|4151|4151| }
|4152|4152| 
|4153|4153| UnitAI.prototype.MoveToPoint = function(x, z)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["min"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4143|4143| 	}
|4144|4144| 	else
|4145|4145| 	{
|4146|    |-		if (data["min"] || data["max"])
|    |4146|+		if (data.min || data["max"])
|4147|4147| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4148|4148| 		else
|4149|4149| 			return this.MoveToPoint(data.x, data.z);
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["max"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4143|4143| 	}
|4144|4144| 	else
|4145|4145| 	{
|4146|    |-		if (data["min"] || data["max"])
|    |4146|+		if (data["min"] || data.max)
|4147|4147| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4148|4148| 		else
|4149|4149| 			return this.MoveToPoint(data.x, data.z);
|    | [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
|4145|4145| 	{
|4146|4146| 		if (data["min"] || data["max"])
|4147|4147| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4148|    |-		else
|4149|    |-			return this.MoveToPoint(data.x, data.z);
|    |4148|+		return this.MoveToPoint(data.x, data.z);
|4150|4149| 	}
|4151|4150| }
|4152|4151| 
|    | [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
|4148|4148| 		else
|4149|4149| 			return this.MoveToPoint(data.x, data.z);
|4150|4150| 	}
|4151|    |-}
|    |4151|+};
|4152|4152| 
|4153|4153| UnitAI.prototype.MoveToPoint = function(x, z)
|4154|4154| {
|    | [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
|4297|4297| 	if (this.IsFormationMember())
|4298|4298| 	{
|4299|4299| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4300|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4301|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4300|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4301|+			cmpFormationUnitAI.order.data.target == target)
|4302|4302| 			return true;
|4303|4303| 	}
|4304|4304| 
|    | [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
|4465|4465| UnitAI.prototype.AttackEntityInZone = function(ents)
|4466|4466| {
|4467|4467| 	var target = ents.find(target =>
|4468|    |-		this.CanAttack(target)
|4469|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4468|+		this.CanAttack(target) &&
|    |4469|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4470|4470| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4471|4471| 	);
|4472|4472| 	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
|4466|4466| {
|4467|4467| 	var target = ents.find(target =>
|4468|4468| 		this.CanAttack(target)
|4469|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4470|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4469|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4470|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4471|4471| 	);
|4472|4472| 	if (!target)
|4473|4473| 		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
|4535|4535| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4536|4536| 	if (this.isGuardOf)
|4537|4537| 	{
|4538|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4538|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4539|4539| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4540|4540| 		if (cmpUnitAI && cmpAttack &&
|4541|4541| 		    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
|4539|4539| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4540|4540| 		if (cmpUnitAI && cmpAttack &&
|4541|4541| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4542|    |-				return false;
|    |4542|+			return false;
|4543|4543| 	}
|4544|4544| 
|4545|4545| 	// 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
|4544|4544| 
|4545|4545| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4546|4546| 	if (this.GetStance().respondHoldGround)
|4547|    |-	{
|    |4547|+	
|4548|4548| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4549|4549| 			return true;
|4550|    |-	}
|    |4550|+	
|4551|4551| 
|4552|4552| 	// Stop if it's left our vision range, unless we're especially persistent
|4553|4553| 	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
|4551|4551| 
|4552|4552| 	// Stop if it's left our vision range, unless we're especially persistent
|4553|4553| 	if (!this.GetStance().respondChaseBeyondVision)
|4554|    |-	{
|    |4554|+	
|4555|4555| 		if (!this.CheckTargetIsInVisionRange(target))
|4556|4556| 			return true;
|4557|    |-	}
|    |4557|+	
|4558|4558| 
|4559|4559| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4560|4560| 	// 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
|4577|4577| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4578|4578| 	if (this.isGuardOf)
|4579|4579| 	{
|4580|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4580|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4581|4581| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4582|4582| 		if (cmpUnitAI && cmpAttack &&
|4583|4583| 		    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
|4590|4590| 	return false;
|4591|4591| };
|4592|4592| 
|4593|    |-//// External interface functions ////
|    |4593|+// // External interface functions ////
|4594|4594| 
|4595|4595| UnitAI.prototype.SetFormationController = function(ent)
|4596|4596| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4600|4600| 	// of our own formation (or ourself if not in formation)
|4601|4601| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4602|4602| 	if (cmpObstruction)
|4603|    |-	{
|    |4603|+	
|4604|4604| 		if (ent == INVALID_ENTITY)
|4605|4605| 			cmpObstruction.SetControlGroup(this.entity);
|4606|4606| 		else
|4607|4607| 			cmpObstruction.SetControlGroup(ent);
|4608|    |-	}
|    |4608|+	
|4609|4609| 
|4610|4610| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4611|4611| 	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
|4743|4743| 	// if we already had an old guard order, do nothing if the target is the same
|4744|4744| 	// and the order is running, otherwise remove the previous order
|4745|4745| 	if (this.isGuardOf)
|4746|    |-	{
|    |4746|+	
|4747|4747| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4748|4748| 			return;
|4749|4749| 		else
|4750|4750| 			this.RemoveGuard();
|4751|    |-	}
|    |4751|+	
|4752|4752| 
|4753|4753| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4754|4754| };
|    | [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
|4746|4746| 	{
|4747|4747| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4748|4748| 			return;
|4749|    |-		else
|4750|    |-			this.RemoveGuard();
|    |4749|+		this.RemoveGuard();
|4751|4750| 	}
|4752|4751| 
|4753|4752| 	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
|4917|4917| 			this.WalkToTarget(target, queued);
|4918|4918| 		return;
|4919|4919| 	}
|4920|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4920|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4921|4921| };
|4922|4922| 
|4923|4923| /**
|    | [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
|5066|5066| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5067|5067| 	{
|5068|5068| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5069|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5069|+		if (cmpTrader.HasBothMarkets() &&
|5070|5070| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5071|5071| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5072|5072| 		{
|    | [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
|5347|5347| 				{
|5348|5348| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5349|5349| 					var targetClasses = this.order.data.targetClasses;
|5350|    |-					if (targetClasses.attack && cmpIdentity
|5351|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5350|+					if (targetClasses.attack && cmpIdentity &&
|    |5351|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5352|5352| 						continue;
|5353|5353| 					if (targetClasses.avoid && cmpIdentity
|5354|5354| 						&& 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
|5350|5350| 					if (targetClasses.attack && cmpIdentity
|5351|5351| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5352|5352| 						continue;
|5353|    |-					if (targetClasses.avoid && cmpIdentity
|5354|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5353|+					if (targetClasses.avoid && cmpIdentity &&
|    |5354|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5355|5355| 						continue;
|5356|5356| 					// Only used by the AIs to prevent some choices of targets
|5357|5357| 					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
|5373|5373| 		{
|5374|5374| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5375|5375| 			var targetClasses = this.order.data.targetClasses;
|5376|    |-			if (cmpIdentity && targetClasses.attack
|5377|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5376|+			if (cmpIdentity && targetClasses.attack &&
|    |5377|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5378|5378| 				continue;
|5379|5379| 			if (cmpIdentity && targetClasses.avoid
|5380|5380| 				&& 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
|5376|5376| 			if (cmpIdentity && targetClasses.attack
|5377|5377| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5378|5378| 				continue;
|5379|    |-			if (cmpIdentity && targetClasses.avoid
|5380|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5379|+			if (cmpIdentity && targetClasses.avoid &&
|    |5380|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5381|5381| 				continue;
|5382|5382| 			// Only used by the AIs to prevent some choices of targets
|5383|5383| 			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
|5519|5519| 
|5520|5520| UnitAI.prototype.SetHeldPosition = function(x, z)
|5521|5521| {
|5522|    |-	this.heldPosition = {"x": x, "z": z};
|    |5522|+	this.heldPosition = { "x": x, "z": z};
|5523|5523| };
|5524|5524| 
|5525|5525| 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
|5519|5519| 
|5520|5520| UnitAI.prototype.SetHeldPosition = function(x, z)
|5521|5521| {
|5522|    |-	this.heldPosition = {"x": x, "z": z};
|    |5522|+	this.heldPosition = {"x": x, "z": z };
|5523|5523| };
|5524|5524| 
|5525|5525| 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
|5546|5546| 	return false;
|5547|5547| };
|5548|5548| 
|5549|    |-//// Helper functions ////
|    |5549|+// // Helper functions ////
|5550|5550| 
|5551|5551| UnitAI.prototype.CanAttack = function(target)
|5552|5552| {
|    | [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
|5750|5750| 	return cmpPack && cmpPack.IsPacking();
|5751|5751| };
|5752|5752| 
|5753|    |-//// Formation specific functions ////
|    |5753|+// // Formation specific functions ////
|5754|5754| 
|5755|5755| UnitAI.prototype.IsAttackingAsFormation = function()
|5756|5756| {
|    | [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
|5755|5755| UnitAI.prototype.IsAttackingAsFormation = function()
|5756|5756| {
|5757|5757| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5758|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5759|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5758|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5759|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5760|5760| };
|5761|5761| 
|5762|5762| //// 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
|5759|5759| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5760|5760| };
|5761|5761| 
|5762|    |-//// Animal specific functions ////
|    |5762|+// // Animal specific functions ////
|5763|5763| 
|5764|5764| UnitAI.prototype.MoveRandomly = function(distance)
|5765|5765| {

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
|1015| »   »   »   »   "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
|1050| »   »   »   "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
|1080| »   »   »   »   "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
|1290| »   »   »   "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
|1471| »   »   »   "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
|1491| »   »   »   "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
|1520| »   »   »   "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
|1673| »   »   »   "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
|1723| »   »   »   »   "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
|2072| »   »   »   »   "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
|2255| »   »   »   »   »   »   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
|2310| »   »   »   »   "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
|2428| »   »   »   »   "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
|2493| »   »   »   »   "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
|2530| »   »   »   »   "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
|2739| »   »   »   »   "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
|2922| »   »   »   »   "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
|3654| »   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
|4452| »   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
|4467| »   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
|4513| »   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
|4541| »   »   ····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
|4997| »   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
|2250| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4132| »   if·(data["target"])
|    | [NORMAL] JSHintBear:
|    | ['target'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4134| »   »   if·(data["min"]·||·data["max"])
|    | [NORMAL] JSHintBear:
|    | ['min'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4134| »   »   if·(data["min"]·||·data["max"])
|    | [NORMAL] JSHintBear:
|    | ['max'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4146| »   »   if·(data["min"]·||·data["max"])
|    | [NORMAL] JSHintBear:
|    | ['min'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4146| »   »   if·(data["min"]·||·data["max"])
|    | [NORMAL] JSHintBear:
|    | ['max'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4151| }
|    | [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
|4301| »   »   »   &&·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
|4469| »   »   &&·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
|4470| »   »   &&·(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
|4997| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5480| »   »   var·range·=·cmpVision.GetRange();
|    | [MAJOR] JSHintBear:
|    | Too many errors. (93% scanned).
Executing section cli...

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

Freagarach updated this revision to Diff 8392.Sun, Jun 9, 9:05 AM

Forgot about turrets.

Vulcan added a comment.Sun, Jun 9, 9:07 AM

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
| 990| 990| 			},
| 991| 991| 		},
| 992| 992| 
| 993|    |-		"GARRISON":{
|    | 993|+		"GARRISON": {
| 994| 994| 			"enter": function() {
| 995| 995| 				// If the garrisonholder should pickup, warn it so it can take needed action
| 996| 996| 				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
|1201|1201| 			// If the controller handled an order but some members rejected it,
|1202|1202| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1203|1203| 			if (this.orderQueue.length)
|1204|    |-			{
|    |1204|+			
|1205|1205| 				// We're leaving the formation, so stop our FormationWalk order
|1206|1206| 				if (this.FinishOrder())
|1207|1207| 					return;
|1208|    |-			}
|    |1208|+			
|1209|1209| 
|1210|1210| 			// No orders left, we're an individual now
|1211|1211| 			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
|1229|1229| 			// Move a tile outside the building
|1230|1230| 			let range = 4;
|1231|1231| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1232|    |-			{
|    |1232|+			
|1233|1233| 				// We are already at the target, or can't move at all
|1234|1234| 				this.FinishOrder();
|1235|    |-			}
|    |1235|+			
|1236|1236| 			else
|1237|1237| 			{
|1238|1238| 				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
|1444|1444| 
|1445|1445| 			"LosRangeUpdate": function(msg) {
|1446|1446| 				if (this.GetStance().targetVisibleEnemies)
|1447|    |-				{
|    |1447|+				
|1448|1448| 					// Start attacking one of the newly-seen enemy (if any)
|1449|1449| 					this.AttackEntitiesByPreference(msg.data.added);
|1450|    |-				}
|    |1450|+				
|1451|1451| 			},
|1452|1452| 
|1453|1453| 			"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
|1477|1477| 				this.SelectAnimation("move");
|1478|1478| 			},
|1479|1479| 
|1480|    |-			"leave": function () {
|    |1480|+			"leave": function() {
|1481|1481| 				this.SelectAnimation("idle");
|1482|1482| 				this.StopMoving();
|1483|1483| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1653|1653| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1654|1654| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1655|1655| 						if (cmpHealth && cmpHealth.IsInjured())
|1656|    |-						{
|    |1656|+						
|1657|1657| 							if (this.CanHeal(this.isGuardOf))
|1658|1658| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1659|1659| 							else if (this.CanRepair(this.isGuardOf))
|1660|1660| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1661|    |-						}
|    |1661|+						
|1662|1662| 					}
|1663|1663| 				},
|1664|1664| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1756|1756| 				"MoveCompleted": function() {
|1757|1757| 
|1758|1758| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1759|    |-					{
|    |1759|+					
|1760|1760| 						// If the unit needs to unpack, do so
|1761|1761| 						if (this.CanUnpack())
|1762|1762| 						{
|1765|1765| 						}
|1766|1766| 						else
|1767|1767| 							this.SetNextState("ATTACKING");
|1768|    |-					}
|    |1768|+					
|1769|1769| 					else
|1770|1770| 					{
|1771|1771| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1763|1763| 							this.PushOrderFront("Unpack", { "force": true });
|1764|1764| 							return;
|1765|1765| 						}
|1766|    |-						else
|1767|    |-							this.SetNextState("ATTACKING");
|    |1766|+						this.SetNextState("ATTACKING");
|1768|1767| 					}
|1769|1768| 					else
|1770|1769| 					{
|    | [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
|1767|1767| 							this.SetNextState("ATTACKING");
|1768|1768| 					}
|1769|1769| 					else
|1770|    |-					{
|    |1770|+					
|1771|1771| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1772|1772| 						{
|1773|1773| 							this.SetNextState("APPROACHING");
|1777|1777| 							// Give up
|1778|1778| 							this.FinishOrder();
|1779|1779| 						}
|1780|    |-					}
|    |1780|+					
|1781|1781| 				},
|1782|1782| 			},
|1783|1783| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1769|1769| 					else
|1770|1770| 					{
|1771|1771| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1772|    |-						{
|    |1772|+						
|1773|1773| 							this.SetNextState("APPROACHING");
|1774|    |-						}
|    |1774|+						
|1775|1775| 						else
|1776|1776| 						{
|1777|1777| 							// Give up
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1773|1773| 							this.SetNextState("APPROACHING");
|1774|1774| 						}
|1775|1775| 						else
|1776|    |-						{
|    |1776|+						
|1777|1777| 							// Give up
|1778|1778| 							this.FinishOrder();
|1779|    |-						}
|    |1779|+						
|1780|1780| 					}
|1781|1781| 				},
|1782|1782| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/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
|2174|2174| 
|2175|2175| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2176|2176| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2177|    |-					{
|    |2177|+					
|2178|2178| 						// Check we can still reach and gather from the target
|2179|2179| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2180|2180| 						{
|2239|2239| 								return;
|2240|2240| 							}
|2241|2241| 						}
|2242|    |-					}
|    |2242|+					
|2243|2243| 
|2244|2244| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2245|2245| 
|    | [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
|2265|2265| 					// Also don't switch to a different type of huntable animal
|2266|2266| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2267|2267| 						return (
|2268|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2269|    |-							|| (type.specific == resourceType.specific
|    |2268|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2269|+							(type.specific == resourceType.specific
|2270|2270| 							&& (type.specific != "meat" || resourceTemplate == template))
|2271|2271| 						);
|2272|2272| 					});
|    | [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
|2266|2266| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2267|2267| 						return (
|2268|2268| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2269|    |-							|| (type.specific == resourceType.specific
|2270|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2269|+							|| (type.specific == resourceType.specific &&
|    |2270|+							(type.specific != "meat" || resourceTemplate == template))
|2271|2271| 						);
|2272|2272| 					});
|2273|2273| 					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
|2331|2331| 
|2332|2332| 				"Timer": function(msg) {
|2333|2333| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2334|    |-					{
|    |2334|+					
|2335|2335| 						// Return to our original position unless we have a better order.
|2336|2336| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2337|2337| 							this.WalkToHeldPosition();
|2338|    |-					}
|    |2338|+					
|2339|2339| 				},
|2340|2340| 
|2341|2341| 				"MoveCompleted": 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
|2365|2365| 					this.StartTimer(prepare, this.healTimers.repeat);
|2366|2366| 
|2367|2367| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2368|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2368|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2369|2369| 
|2370|2370| 					this.FaceTowardsTarget(this.order.data.target);
|2371|2371| 				},
|    | [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
|2577|2577| 					{
|2578|2578| 						// The building was already finished/fully repaired before we arrived;
|2579|2579| 						// let the ConstructionFinished handler handle this.
|2580|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2580|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2581|2581| 						return true;
|2582|2582| 					}
|2583|2583| 
|    | [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
|2577|2577| 					{
|2578|2578| 						// The building was already finished/fully repaired before we arrived;
|2579|2579| 						// let the ConstructionFinished handler handle this.
|2580|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2580|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2581|2581| 						return true;
|2582|2582| 					}
|2583|2583| 
|    | [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
|2620|2620| 					if (!inRange && this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2621|2621| 						this.SetNextState("APPROACHING");
|2622|2622| 					else if (!inRange)
|2623|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2623|+						this.FinishOrder(); // can't approach and isn't in reach
|2624|2624| 				},
|2625|2625| 			},
|2626|2626| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2707|2707| 
|2708|2708| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2709|2709| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2710|    |-				{
|    |2710|+				
|2711|2711| 					// We're already walking to the given point, so add this as a order.
|2712|2712| 					this.WalkToTarget(msg.data.newentity, true);
|2713|    |-				}
|    |2713|+				
|2714|2714| 			},
|2715|2715| 		},
|2716|2716| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2769|2769| 
|2770|2770| 					// Check that we can garrison here
|2771|2771| 					if (this.CanGarrison(target))
|2772|    |-					{
|    |2772|+					
|2773|2773| 						// Check that we're in range of the garrison target
|2774|2774| 						if (this.CheckGarrisonRange(target))
|2775|2775| 						{
|2845|2845| 								return false;
|2846|2846| 							}
|2847|2847| 						}
|2848|    |-					}
|    |2848|+					
|2849|2849| 					// Garrisoning failed for some reason, so finish the order
|2850|2850| 					this.FinishOrder();
|2851|2851| 					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
|2966|2966| 		"Attacked": function(msg) {
|2967|2967| 			if (this.template.NaturalBehaviour == "skittish" ||
|2968|2968| 			    this.template.NaturalBehaviour == "passive")
|2969|    |-			{
|    |2969|+			
|2970|2970| 				this.Flee(msg.data.attacker, false);
|2971|    |-			}
|    |2971|+			
|2972|2972| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2973|2973| 			{
|2974|2974| 				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
|2975|2975| 					this.Attack(msg.data.attacker, false);
|2976|2976| 			}
|2977|2977| 			else if (this.template.NaturalBehaviour == "domestic")
|2978|    |-			{
|    |2978|+			
|2979|2979| 				// Never flee, stop what we were doing
|2980|2980| 				this.SetNextState("IDLE");
|2981|    |-			}
|    |2981|+			
|2982|2982| 		},
|2983|2983| 
|2984|2984| 		"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
|2989|2989| 				this.FinishOrder();
|2990|2990| 				return;
|2991|2991| 			}
|2992|    |-			else
|2993|    |-			{
|    |2992|+			
|2994|2993| 				this.order.data.min = range;
|2995|2994| 				this.SetNextState("WALKING");
|2996|    |-			}
|    |2995|+			
|2997|2996| 		},
|2998|2997| 
|2999|2998| 		"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
|3033|3033| 				}
|3034|3034| 				// Start attacking one of the newly-seen enemy (if any)
|3035|3035| 				else if (this.IsDangerousAnimal())
|3036|    |-				{
|    |3036|+				
|3037|3037| 					this.AttackVisibleEntity(msg.data.added);
|3038|    |-				}
|    |3038|+				
|3039|3039| 
|3040|3040| 				// TODO: if two units enter our range together, we'll attack the
|3041|3041| 				// 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
|3076|3076| 				}
|3077|3077| 				// Start attacking one of the newly-seen enemy (if any)
|3078|3078| 				else if (this.template.NaturalBehaviour == "violent")
|3079|    |-				{
|    |3079|+				
|3080|3080| 					this.AttackVisibleEntity(msg.data.added);
|3081|    |-				}
|    |3081|+				
|3082|3082| 			},
|3083|3083| 
|3084|3084| 			"MoveCompleted": function() { },
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3093|3093| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3094|3094| 
|3095|3095| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3096|    |-							// only used for domestic animals
|    |3096|+		// only used for domestic animals
|3097|3097| 	},
|3098|3098| };
|3099|3099| 
|    | [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
|3150|3150| 
|3151|3151| UnitAI.prototype.IsAnimal = function()
|3152|3152| {
|3153|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3153|+	return (!!this.template.NaturalBehaviour);
|3154|3154| };
|3155|3155| 
|3156|3156| 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
|3188|3188| UnitAI.prototype.GetGarrisonHolder = function()
|3189|3189| {
|3190|3190| 	if (this.IsGarrisoned())
|3191|    |-	{
|    |3191|+	
|3192|3192| 		for (let order of this.orderQueue)
|3193|3193| 			if (order.type == "Garrison")
|3194|3194| 				return order.data.target;
|3195|    |-	}
|    |3195|+	
|3196|3196| 	return INVALID_ENTITY;
|3197|3197| };
|3198|3198| 
|    | [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
|3266|3266| 		{
|3267|3267| 			let index = this.GetCurrentState().indexOf(".");
|3268|3268| 			if (index != -1)
|3269|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3269|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3270|3270| 			this.Stop(false);
|3271|3271| 		}
|3272|3272| 
|    | [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
|3322|3322| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3323|3323| 			continue;
|3324|3324| 		if (i == 0)
|3325|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3325|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3326|3326| 		else
|3327|3327| 			this.orderQueue.splice(i, 1);
|3328|3328| 		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
|3322|3322| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3323|3323| 			continue;
|3324|3324| 		if (i == 0)
|3325|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3325|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3326|3326| 		else
|3327|3327| 			this.orderQueue.splice(i, 1);
|3328|3328| 		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
|3406|3406| };
|3407|3407| 
|3408|3408| 
|3409|    |-//// FSM linkage functions ////
|    |3409|+// // FSM linkage functions ////
|3410|3410| 
|3411|3411| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3412|3412| 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
|3578|3578| 				continue;
|3579|3579| 			if (this.orderQueue[i].type == type)
|3580|3580| 				continue;
|3581|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3581|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3582|3582| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3583|3583| 			return;
|3584|3584| 		}
|    | [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
|3578|3578| 				continue;
|3579|3579| 			if (this.orderQueue[i].type == type)
|3580|3580| 				continue;
|3581|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3581|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3582|3582| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3583|3583| 			return;
|3584|3584| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3592|3592| {
|3593|3593| 	// Remember the previous work orders to be able to go back to them later if required
|3594|3594| 	if (data && data.force)
|3595|    |-	{
|    |3595|+	
|3596|3596| 		if (this.IsFormationController())
|3597|3597| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3598|3598| 		else
|3599|3599| 			this.UpdateWorkOrders(type);
|3600|    |-	}
|    |3600|+	
|3601|3601| 
|3602|3602| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3603|3603| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3669|3669| 	{
|3670|3670| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3671|3671| 		if (cmpUnitAI)
|3672|    |-		{
|    |3672|+		
|3673|3673| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3674|3674| 			{
|3675|3675| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3678|3678| 					return;
|3679|3679| 				}
|3680|3680| 			}
|3681|    |-		}
|    |3681|+		
|3682|3682| 	}
|3683|3683| 
|3684|3684| 	// 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
|3671|3671| 		if (cmpUnitAI)
|3672|3672| 		{
|3673|3673| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3674|    |-			{
|    |3674|+			
|3675|3675| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3676|3676| 				{
|3677|3677| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3678|3678| 					return;
|3679|3679| 				}
|3680|    |-			}
|    |3680|+			
|3681|3681| 		}
|3682|3682| 	}
|3683|3683| 
|    | [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
|3683|3683| 
|3684|3684| 	// If nothing found, take the unit orders
|3685|3685| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3686|    |-	{
|    |3686|+	
|3687|3687| 		if (isWorkType(this.orderQueue[i].type))
|3688|3688| 		{
|3689|3689| 			this.workOrders = this.orderQueue.slice(i);
|3690|3690| 			return;
|3691|3691| 		}
|3692|    |-	}
|    |3692|+	
|3693|3693| };
|3694|3694| 
|3695|3695| 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
|3749|3749| 	if (data.timerRepeat === undefined)
|3750|3750| 		this.timer = undefined;
|3751|3751| 
|3752|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3752|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3753|3753| };
|3754|3754| 
|3755|3755| /**
|    | [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
|3749|3749| 	if (data.timerRepeat === undefined)
|3750|3750| 		this.timer = undefined;
|3751|3751| 
|3752|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3752|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3753|3753| };
|3754|3754| 
|3755|3755| /**
|    | [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
|3784|3784| 	this.timer = undefined;
|3785|3785| };
|3786|3786| 
|3787|    |-//// Message handlers /////
|    |3787|+// // Message handlers /////
|3788|3788| 
|3789|3789| UnitAI.prototype.OnMotionChanged = function(msg)
|3790|3790| {
|    | [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
|3796|3796| 	// TODO: This is a bit inefficient since every unit listens to every
|3797|3797| 	// construction message - ideally we could scope it to only the one we're building
|3798|3798| 
|3799|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3799|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3800|3800| };
|3801|3801| 
|3802|3802| 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
|3796|3796| 	// TODO: This is a bit inefficient since every unit listens to every
|3797|3797| 	// construction message - ideally we could scope it to only the one we're building
|3798|3798| 
|3799|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3799|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3800|3800| };
|3801|3801| 
|3802|3802| 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
|3821|3821| 
|3822|3822| UnitAI.prototype.OnAttacked = function(msg)
|3823|3823| {
|3824|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3824|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3825|3825| };
|3826|3826| 
|3827|3827| 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
|3821|3821| 
|3822|3822| UnitAI.prototype.OnAttacked = function(msg)
|3823|3823| {
|3824|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3824|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3825|3825| };
|3826|3826| 
|3827|3827| 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
|3826|3826| 
|3827|3827| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3828|3828| {
|3829|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3829|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3830|3830| };
|3831|3831| 
|3832|3832| 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
|3826|3826| 
|3827|3827| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3828|3828| {
|3829|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3829|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3830|3830| };
|3831|3831| 
|3832|3832| 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
|3831|3831| 
|3832|3832| UnitAI.prototype.OnHealthChanged = function(msg)
|3833|3833| {
|3834|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3834|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3835|3835| };
|3836|3836| 
|3837|3837| 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
|3831|3831| 
|3832|3832| UnitAI.prototype.OnHealthChanged = function(msg)
|3833|3833| {
|3834|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3834|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3835|3835| };
|3836|3836| 
|3837|3837| 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
|3837|3837| UnitAI.prototype.OnRangeUpdate = function(msg)
|3838|3838| {
|3839|3839| 	if (msg.tag == this.losRangeQuery)
|3840|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3840|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3841|3841| 	else if (msg.tag == this.losHealRangeQuery)
|3842|3842| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3843|3843| };
|    | [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| UnitAI.prototype.OnRangeUpdate = function(msg)
|3838|3838| {
|3839|3839| 	if (msg.tag == this.losRangeQuery)
|3840|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3840|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3841|3841| 	else if (msg.tag == this.losHealRangeQuery)
|3842|3842| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3843|3843| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3839|3839| 	if (msg.tag == this.losRangeQuery)
|3840|3840| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3841|3841| 	else if (msg.tag == this.losHealRangeQuery)
|3842|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3842|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3843|3843| };
|3844|3844| 
|3845|3845| 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
|3839|3839| 	if (msg.tag == this.losRangeQuery)
|3840|3840| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3841|3841| 	else if (msg.tag == this.losHealRangeQuery)
|3842|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3842|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3843|3843| };
|3844|3844| 
|3845|3845| 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
|3844|3844| 
|3845|3845| UnitAI.prototype.OnPackFinished = function(msg)
|3846|3846| {
|3847|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3847|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3848|3848| };
|3849|3849| 
|3850|3850| //// 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
|3844|3844| 
|3845|3845| UnitAI.prototype.OnPackFinished = function(msg)
|3846|3846| {
|3847|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3847|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3848|3848| };
|3849|3849| 
|3850|3850| //// 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
|3847|3847| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3848|3848| };
|3849|3849| 
|3850|    |-//// Helper functions to be called by the FSM ////
|    |3850|+// // Helper functions to be called by the FSM ////
|3851|3851| 
|3852|3852| UnitAI.prototype.GetWalkSpeed = function()
|3853|3853| {
|    | [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
|3949|3949| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3950|3950| 		return undefined;
|3951|3951| 
|3952|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3952|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3953|3953| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3954|3954| 		return undefined;
|3955|3955| 
|    | [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
|4034|4034| 			PlaySound(name, member);
|4035|4035| 	}
|4036|4036| 	else
|4037|    |-	{
|    |4037|+	
|4038|4038| 		// Otherwise use our own sounds
|4039|4039| 		PlaySound(name, this.entity);
|4040|    |-	}
|    |4040|+	
|4041|4041| };
|4042|4042| 
|4043|4043| /*
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4130|4130| UnitAI.prototype.MoveTo = function(data, iid, type)
|4131|4131| {
|4132|4132| 	if (data["target"])
|4133|    |-	{
|    |4133|+	
|4134|4134| 		if (data["min"] || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|4136| 		else
|4140|4140| 			else
|4141|4141| 				return this.MoveToTargetRange(data.target, iid, type);
|4142|4142| 		}
|4143|    |-	}
|    |4143|+	
|4144|4144| 	else
|4145|4145| 	{
|4146|4146| 		if (data["min"] || data["max"])
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["target"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4129|4129|  */
|4130|4130| UnitAI.prototype.MoveTo = function(data, iid, type)
|4131|4131| {
|4132|    |-	if (data["target"])
|    |4132|+	if (data.target)
|4133|4133| 	{
|4134|4134| 		if (data["min"] || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["min"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4131|4131| {
|4132|4132| 	if (data["target"])
|4133|4133| 	{
|4134|    |-		if (data["min"] || data["max"])
|    |4134|+		if (data.min || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|4136| 		else
|4137|4137| 		{
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["max"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4131|4131| {
|4132|4132| 	if (data["target"])
|4133|4133| 	{
|4134|    |-		if (data["min"] || data["max"])
|    |4134|+		if (data["min"] || data.max)
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|4136| 		else
|4137|4137| 		{
|    | [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
|4134|4134| 		if (data["min"] || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|4136| 		else
|4137|    |-		{
|    |4137|+		
|4138|4138| 			if (!iid)
|4139|4139| 				return this.MoveToTarget(data.target);
|4140|4140| 			else
|4141|4141| 				return this.MoveToTargetRange(data.target, iid, type);
|4142|    |-		}
|    |4142|+		
|4143|4143| 	}
|4144|4144| 	else
|4145|4145| 	{
|    | [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
|4133|4133| 	{
|4134|4134| 		if (data["min"] || data["max"])
|4135|4135| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4136|    |-		else
|4137|    |-		{
|    |4136|+		
|4138|4137| 			if (!iid)
|4139|4138| 				return this.MoveToTarget(data.target);
|4140|4139| 			else
|4141|4140| 				return this.MoveToTargetRange(data.target, iid, type);
|4142|    |-		}
|    |4141|+		
|4143|4142| 	}
|4144|4143| 	else
|4145|4144| 	{
|    | [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
|4137|4137| 		{
|4138|4138| 			if (!iid)
|4139|4139| 				return this.MoveToTarget(data.target);
|4140|    |-			else
|4141|    |-				return this.MoveToTargetRange(data.target, iid, type);
|    |4140|+			return this.MoveToTargetRange(data.target, iid, type);
|4142|4141| 		}
|4143|4142| 	}
|4144|4143| 	else
|    | [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
|4142|4142| 		}
|4143|4143| 	}
|4144|4144| 	else
|4145|    |-	{
|    |4145|+	
|4146|4146| 		if (data["min"] || data["max"])
|4147|4147| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4148|4148| 		else
|4149|4149| 			return this.MoveToPoint(data.x, data.z);
|4150|    |-	}
|    |4150|+	
|4151|4151| }
|4152|4152| 
|4153|4153| UnitAI.prototype.MoveToPoint = function(x, z)
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["min"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4143|4143| 	}
|4144|4144| 	else
|4145|4145| 	{
|4146|    |-		if (data["min"] || data["max"])
|    |4146|+		if (data.min || data["max"])
|4147|4147| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4148|4148| 		else
|4149|4149| 			return this.MoveToPoint(data.x, data.z);
|    | [NORMAL] ESLintBear (dot-notation):
|    | ["max"] is better written in dot notation.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4143|4143| 	}
|4144|4144| 	else
|4145|4145| 	{
|4146|    |-		if (data["min"] || data["max"])
|    |4146|+		if (data["min"] || data.max)
|4147|4147| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4148|4148| 		else
|4149|4149| 			return this.MoveToPoint(data.x, data.z);
|    | [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
|4145|4145| 	{
|4146|4146| 		if (data["min"] || data["max"])
|4147|4147| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4148|    |-		else
|4149|    |-			return this.MoveToPoint(data.x, data.z);
|    |4148|+		return this.MoveToPoint(data.x, data.z);
|4150|4149| 	}
|4151|4150| }
|4152|4151| 
|    | [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
|4148|4148| 		else
|4149|4149| 			return this.MoveToPoint(data.x, data.z);
|4150|4150| 	}
|4151|    |-}
|    |4151|+};
|4152|4152| 
|4153|4153| UnitAI.prototype.MoveToPoint = function(x, z)
|4154|4154| {
|    | [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
|4297|4297| 	if (this.IsFormationMember())
|4298|4298| 	{
|4299|4299| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4300|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4301|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4300|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4301|+			cmpFormationUnitAI.order.data.target == target)
|4302|4302| 			return true;
|4303|4303| 	}
|4304|4304| 
|    | [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
|4465|4465| UnitAI.prototype.AttackEntityInZone = function(ents)
|4466|4466| {
|4467|4467| 	var target = ents.find(target =>
|4468|    |-		this.CanAttack(target)
|4469|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4468|+		this.CanAttack(target) &&
|    |4469|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4470|4470| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4471|4471| 	);
|4472|4472| 	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
|4466|4466| {
|4467|4467| 	var target = ents.find(target =>
|4468|4468| 		this.CanAttack(target)
|4469|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4470|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4469|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4470|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4471|4471| 	);
|4472|4472| 	if (!target)
|4473|4473| 		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
|4535|4535| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4536|4536| 	if (this.isGuardOf)
|4537|4537| 	{
|4538|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4538|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4539|4539| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4540|4540| 		if (cmpUnitAI && cmpAttack &&
|4541|4541| 		    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
|4539|4539| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4540|4540| 		if (cmpUnitAI && cmpAttack &&
|4541|4541| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4542|    |-				return false;
|    |4542|+			return false;
|4543|4543| 	}
|4544|4544| 
|4545|4545| 	// 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
|4544|4544| 
|4545|4545| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4546|4546| 	if (this.GetStance().respondHoldGround)
|4547|    |-	{
|    |4547|+	
|4548|4548| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4549|4549| 			return true;
|4550|    |-	}
|    |4550|+	
|4551|4551| 
|4552|4552| 	// Stop if it's left our vision range, unless we're especially persistent
|4553|4553| 	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
|4551|4551| 
|4552|4552| 	// Stop if it's left our vision range, unless we're especially persistent
|4553|4553| 	if (!this.GetStance().respondChaseBeyondVision)
|4554|    |-	{
|    |4554|+	
|4555|4555| 		if (!this.CheckTargetIsInVisionRange(target))
|4556|4556| 			return true;
|4557|    |-	}
|    |4557|+	
|4558|4558| 
|4559|4559| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4560|4560| 	// 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
|4577|4577| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4578|4578| 	if (this.isGuardOf)
|4579|4579| 	{
|4580|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4580|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4581|4581| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4582|4582| 		if (cmpUnitAI && cmpAttack &&
|4583|4583| 		    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
|4590|4590| 	return false;
|4591|4591| };
|4592|4592| 
|4593|    |-//// External interface functions ////
|    |4593|+// // External interface functions ////
|4594|4594| 
|4595|4595| UnitAI.prototype.SetFormationController = function(ent)
|4596|4596| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4600|4600| 	// of our own formation (or ourself if not in formation)
|4601|4601| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4602|4602| 	if (cmpObstruction)
|4603|    |-	{
|    |4603|+	
|4604|4604| 		if (ent == INVALID_ENTITY)
|4605|4605| 			cmpObstruction.SetControlGroup(this.entity);
|4606|4606| 		else
|4607|4607| 			cmpObstruction.SetControlGroup(ent);
|4608|    |-	}
|    |4608|+	
|4609|4609| 
|4610|4610| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4611|4611| 	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
|4743|4743| 	// if we already had an old guard order, do nothing if the target is the same
|4744|4744| 	// and the order is running, otherwise remove the previous order
|4745|4745| 	if (this.isGuardOf)
|4746|    |-	{
|    |4746|+	
|4747|4747| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4748|4748| 			return;
|4749|4749| 		else
|4750|4750| 			this.RemoveGuard();
|4751|    |-	}
|    |4751|+	
|4752|4752| 
|4753|4753| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4754|4754| };
|    | [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
|4746|4746| 	{
|4747|4747| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4748|4748| 			return;
|4749|    |-		else
|4750|    |-			this.RemoveGuard();
|    |4749|+		this.RemoveGuard();
|4751|4750| 	}
|4752|4751| 
|4753|4752| 	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
|4917|4917| 			this.WalkToTarget(target, queued);
|4918|4918| 		return;
|4919|4919| 	}
|4920|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4920|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4921|4921| };
|4922|4922| 
|4923|4923| /**
|    | [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
|5066|5066| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5067|5067| 	{
|5068|5068| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5069|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5069|+		if (cmpTrader.HasBothMarkets() &&
|5070|5070| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5071|5071| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5072|5072| 		{
|    | [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
|5347|5347| 				{
|5348|5348| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5349|5349| 					var targetClasses = this.order.data.targetClasses;
|5350|    |-					if (targetClasses.attack && cmpIdentity
|5351|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5350|+					if (targetClasses.attack && cmpIdentity &&
|    |5351|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5352|5352| 						continue;
|5353|5353| 					if (targetClasses.avoid && cmpIdentity
|5354|5354| 						&& 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
|5350|5350| 					if (targetClasses.attack && cmpIdentity
|5351|5351| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5352|5352| 						continue;
|5353|    |-					if (targetClasses.avoid && cmpIdentity
|5354|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5353|+					if (targetClasses.avoid && cmpIdentity &&
|    |5354|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5355|5355| 						continue;
|5356|5356| 					// Only used by the AIs to prevent some choices of targets
|5357|5357| 					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
|5373|5373| 		{
|5374|5374| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5375|5375| 			var targetClasses = this.order.data.targetClasses;
|5376|    |-			if (cmpIdentity && targetClasses.attack
|5377|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5376|+			if (cmpIdentity && targetClasses.attack &&
|    |5377|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5378|5378| 				continue;
|5379|5379| 			if (cmpIdentity && targetClasses.avoid
|5380|5380| 				&& 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
|5376|5376| 			if (cmpIdentity && targetClasses.attack
|5377|5377| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5378|5378| 				continue;
|5379|    |-			if (cmpIdentity && targetClasses.avoid
|5380|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5379|+			if (cmpIdentity && targetClasses.avoid &&
|    |5380|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5381|5381| 				continue;
|5382|5382| 			// Only used by the AIs to prevent some choices of targets
|5383|5383| 			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
|5519|5519| 
|5520|5520| UnitAI.prototype.SetHeldPosition = function(x, z)
|5521|5521| {
|5522|    |-	this.heldPosition = {"x": x, "z": z};
|    |5522|+	this.heldPosition = { "x": x, "z": z};
|5523|5523| };
|5524|5524| 
|5525|5525| 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
|5519|5519| 
|5520|5520| UnitAI.prototype.SetHeldPosition = function(x, z)
|5521|5521| {
|5522|    |-	this.heldPosition = {"x": x, "z": z};
|    |5522|+	this.heldPosition = {"x": x, "z": z };
|5523|5523| };
|5524|5524| 
|5525|5525| 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
|5546|5546| 	return false;
|5547|5547| };
|5548|5548| 
|5549|    |-//// Helper functions ////
|    |5549|+// // Helper functions ////
|5550|5550| 
|5551|5551| UnitAI.prototype.CanAttack = function(target)
|5552|5552| {
|    | [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
|5750|5750| 	return cmpPack && cmpPack.IsPacking();
|5751|5751| };
|5752|5752| 
|5753|    |-//// Formation specific functions ////
|    |5753|+// // Formation specific functions ////
|5754|5754| 
|5755|5755| UnitAI.prototype.IsAttackingAsFormation = function()
|5756|5756| {
|    | [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
|5755|5755| UnitAI.prototype.IsAttackingAsFormation = function()
|5756|5756| {
|5757|5757| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5758|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5759|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5758|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5759|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5760|5760| };
|5761|5761| 
|5762|5762| //// 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
|5759|5759| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5760|5760| };
|5761|5761| 
|5762|    |-//// Animal specific functions ////
|    |5762|+// // Animal specific functions ////
|5763|5763| 
|5764|5764| UnitAI.prototype.MoveRandomly = function(distance)
|5765|5765| {

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
|1015| »   »   »   »   "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
|1050| »   »   »   "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
|1080| »   »   »   »   "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
|1290| »   »   »   "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
|1471| »   »   »   "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
|1491| »   »   »   "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
|1520| »   »   »   "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
|1673| »   »   »   "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
|1723| »   »   »   »   "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
|2072| »   »   »   »   "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
|2255| »   »   »   »   »   »   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
|2310| »   »   »   »   "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
|2428| »   »   »   »   "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
|2493| »   »   »   »   "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
|2530| »   »   »   »   "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
|2739| »   »   »   »   "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
|2922| »   »   »   »   "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
|3654| »   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
|4452| »   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
|4467| »   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
|4513| »   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
|4541| »   »   ····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
|4997| »   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
|2250| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4132| »   if·(data["target"])
|    | [NORMAL] JSHintBear:
|    | ['target'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4134| »   »   if·(data["min"]·||·data["max"])
|    | [NORMAL] JSHintBear:
|    | ['min'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4134| »   »   if·(data["min"]·||·data["max"])
|    | [NORMAL] JSHintBear:
|    | ['max'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4146| »   »   if·(data["min"]·||·data["max"])
|    | [NORMAL] JSHintBear:
|    | ['min'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4146| »   »   if·(data["min"]·||·data["max"])
|    | [NORMAL] JSHintBear:
|    | ['max'] is better written in dot notation.

binaries/data/mods/public/simulation/components/UnitAI.js
|4151| }
|    | [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
|4301| »   »   »   &&·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
|4469| »   »   &&·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
|4470| »   »   &&·(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
|4997| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5480| »   »   var·range·=·cmpVision.GetRange();
|    | [MAJOR] JSHintBear:
|    | Too many errors. (93% scanned).
Executing section cli...

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

wraitii requested changes to this revision.Sun, Jun 9, 1:10 PM
wraitii added a subscriber: wraitii.

Kind of the unitAI dilemma here. Should we abandon the order? Do we do something else? Can we abandon if the order is forced?

In this situation I agree it's a good move, but you should move the code below the "if force".

This revision now requires changes to proceed.Sun, Jun 9, 1:10 PM
Freagarach updated this revision to Diff 8395.EditedSun, Jun 9, 2:24 PM
Freagarach edited the summary of this revision. (Show Details)

Understandable, it was my dilemma as well ;)
I must warn that when explicitly giving the attack order and the unit garrisons it will look really weird. By the way is there something left to chase when the unit garrisons?

Freagarach added a comment.EditedSun, Jun 9, 2:28 PM

I just realised that this might happen more often, e.g. when a unit dies or is otherwise moved out of world.

Vulcan added a comment.Sun, Jun 9, 2:31 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
|2173|2173| 
|2174|2174| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2175|2175| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2176|    |-					{
|    |2176|+					
|2177|2177| 						// Check we can still reach and gather from the target
|2178|2178| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2179|2179| 						{
|2238|2238| 								return;
|2239|2239| 							}
|2240|2240| 						}
|2241|    |-					}
|    |2241|+					
|2242|2242| 
|2243|2243| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2244|2244| 
|    | [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
|2264|2264| 					// Also don't switch to a different type of huntable animal
|2265|2265| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2266|2266| 						return (
|2267|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2268|    |-							|| (type.specific == resourceType.specific
|    |2267|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2268|+							(type.specific == resourceType.specific
|2269|2269| 							&& (type.specific != "meat" || resourceTemplate == template))
|2270|2270| 						);
|2271|2271| 					});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2265|2265| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2266|2266| 						return (
|2267|2267| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2268|    |-							|| (type.specific == resourceType.specific
|2269|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2268|+							|| (type.specific == resourceType.specific &&
|    |2269|+							(type.specific != "meat" || resourceTemplate == template))
|2270|2270| 						);
|2271|2271| 					});
|2272|2272| 					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
|2330|2330| 
|2331|2331| 				"Timer": function(msg) {
|2332|2332| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2333|    |-					{
|    |2333|+					
|2334|2334| 						// Return to our original position unless we have a better order.
|2335|2335| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2336|2336| 							this.WalkToHeldPosition();
|2337|    |-					}
|    |2337|+					
|2338|2338| 				},
|2339|2339| 
|2340|2340| 				"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
|2364|2364| 					this.StartTimer(prepare, this.healTimers.repeat);
|2365|2365| 
|2366|2366| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2367|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2367|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2368|2368| 
|2369|2369| 					this.FaceTowardsTarget(this.order.data.target);
|2370|2370| 				},
|    | [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
|2580|2580| 					{
|2581|2581| 						// The building was already finished/fully repaired before we arrived;
|2582|2582| 						// let the ConstructionFinished handler handle this.
|2583|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2583|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2584|2584| 						return true;
|2585|2585| 					}
|2586|2586| 
|    | [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
|2580|2580| 					{
|2581|2581| 						// The building was already finished/fully repaired before we arrived;
|2582|2582| 						// let the ConstructionFinished handler handle this.
|2583|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2583|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2584|2584| 						return true;
|2585|2585| 					}
|2586|2586| 
|    | [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
|2623|2623| 					if (!inRange && this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2624|2624| 						this.SetNextState("APPROACHING");
|2625|2625| 					else if (!inRange)
|2626|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2626|+						this.FinishOrder(); // can't approach and isn't in reach
|2627|2627| 				},
|2628|2628| 			},
|2629|2629| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2710|2710| 
|2711|2711| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2712|2712| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2713|    |-				{
|    |2713|+				
|2714|2714| 					// We're already walking to the given point, so add this as a order.
|2715|2715| 					this.WalkToTarget(msg.data.newentity, true);
|2716|    |-				}
|    |2716|+				
|2717|2717| 			},
|2718|2718| 		},
|2719|2719| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2773|2773| 
|2774|2774| 					// Check that we can garrison here
|2775|2775| 					if (this.CanGarrison(target))
|2776|    |-					{
|    |2776|+					
|2777|2777| 						// Check that we're in range of the garrison target
|2778|2778| 						if (this.CheckGarrisonRange(target))
|2779|2779| 						{
|2849|2849| 								return false;
|2850|2850| 							}
|2851|2851| 						}
|2852|    |-					}
|    |2852|+					
|2853|2853| 					// Garrisoning failed for some reason, so finish the order
|2854|2854| 					this.FinishOrder();
|2855|2855| 					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
|2971|2971| 		"Attacked": function(msg) {
|2972|2972| 			if (this.template.NaturalBehaviour == "skittish" ||
|2973|2973| 			    this.template.NaturalBehaviour == "passive")
|2974|    |-			{
|    |2974|+			
|2975|2975| 				this.Flee(msg.data.attacker, false);
|2976|    |-			}
|    |2976|+			
|2977|2977| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2978|2978| 			{
|2979|2979| 				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
|2980|2980| 					this.Attack(msg.data.attacker, false);
|2981|2981| 			}
|2982|2982| 			else if (this.template.NaturalBehaviour == "domestic")
|2983|    |-			{
|    |2983|+			
|2984|2984| 				// Never flee, stop what we were doing
|2985|2985| 				this.SetNextState("IDLE");
|2986|    |-			}
|    |2986|+			
|2987|2987| 		},
|2988|2988| 
|2989|2989| 		"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
|2994|2994| 				this.FinishOrder();
|2995|2995| 				return;
|2996|2996| 			}
|2997|    |-			else
|2998|    |-			{
|    |2997|+			
|2999|2998| 				this.order.data.min = range;
|3000|2999| 				this.SetNextState("WALKING");
|3001|    |-			}
|    |3000|+			
|3002|3001| 		},
|3003|3002| 
|3004|3003| 		"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
|3038|3038| 				}
|3039|3039| 				// Start attacking one of the newly-seen enemy (if any)
|3040|3040| 				else if (this.IsDangerousAnimal())
|3041|    |-				{
|    |3041|+				
|3042|3042| 					this.AttackVisibleEntity(msg.data.added);
|3043|    |-				}
|    |3043|+				
|3044|3044| 
|3045|3045| 				// TODO: if two units enter our range together, we'll attack the
|3046|3046| 				// 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
|3081|3081| 				}
|3082|3082| 				// Start attacking one of the newly-seen enemy (if any)
|3083|3083| 				else if (this.template.NaturalBehaviour == "violent")
|3084|    |-				{
|    |3084|+				
|3085|3085| 					this.AttackVisibleEntity(msg.data.added);
|3086|    |-				}
|    |3086|+				
|3087|3087| 			},
|3088|3088| 
|3089|3089| 			"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
|3096|3096| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3097|3097| 
|3098|3098| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3099|    |-							// only used for domestic animals
|    |3099|+		// only used for domestic animals
|3100|3100| 	},
|3101|3101| };
|3102|3102| 
|    | [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
|3153|3153| 
|3154|3154| UnitAI.prototype.IsAnimal = function()
|3155|3155| {
|3156|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3156|+	return (!!this.template.NaturalBehaviour);
|3157|3157| };
|3158|3158| 
|3159|3159| 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
|3191|3191| UnitAI.prototype.GetGarrisonHolder = function()
|3192|3192| {
|3193|3193| 	if (this.IsGarrisoned())
|3194|    |-	{
|    |3194|+	
|3195|3195| 		for (let order of this.orderQueue)
|3196|3196| 			if (order.type == "Garrison")
|3197|3197| 				return order.data.target;
|3198|    |-	}
|    |3198|+	
|3199|3199| 	return INVALID_ENTITY;
|3200|3200| };
|3201|3201| 
|    | [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
|3269|3269| 		{
|3270|3270| 			let index = this.GetCurrentState().indexOf(".");
|3271|3271| 			if (index != -1)
|3272|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3272|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3273|3273| 			this.Stop(false);
|3274|3274| 		}
|3275|3275| 
|    | [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
|3325|3325| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3326|3326| 			continue;
|3327|3327| 		if (i == 0)
|3328|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3328|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3329|3329| 		else
|3330|3330| 			this.orderQueue.splice(i, 1);
|3331|3331| 		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
|3325|3325| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3326|3326| 			continue;
|3327|3327| 		if (i == 0)
|3328|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3328|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3329|3329| 		else
|3330|3330| 			this.orderQueue.splice(i, 1);
|3331|3331| 		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
|3409|3409| };
|3410|3410| 
|3411|3411| 
|3412|    |-//// FSM linkage functions ////
|    |3412|+// // FSM linkage functions ////
|3413|3413| 
|3414|3414| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3415|3415| 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
|3581|3581| 				continue;
|3582|3582| 			if (this.orderQueue[i].type == type)
|3583|3583| 				continue;
|3584|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3584|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3585|3585| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3586|3586| 			return;
|3587|3587| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3581|3581| 				continue;
|3582|3582| 			if (this.orderQueue[i].type == type)
|3583|3583| 				continue;
|3584|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3584|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3585|3585| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3586|3586| 			return;
|3587|3587| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3595|3595| {
|3596|3596| 	// Remember the previous work orders to be able to go back to them later if required
|3597|3597| 	if (data && data.force)
|3598|    |-	{
|    |3598|+	
|3599|3599| 		if (this.IsFormationController())
|3600|3600| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3601|3601| 		else
|3602|3602| 			this.UpdateWorkOrders(type);
|3603|    |-	}
|    |3603|+	
|3604|3604| 
|3605|3605| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3606|3606| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3672|3672| 	{
|3673|3673| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3674|3674| 		if (cmpUnitAI)
|3675|    |-		{
|    |3675|+		
|3676|3676| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3677|3677| 			{
|3678|3678| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3681|3681| 					return;
|3682|3682| 				}
|3683|3683| 			}
|3684|    |-		}
|    |3684|+		
|3685|3685| 	}
|3686|3686| 
|3687|3687| 	// 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
|3674|3674| 		if (cmpUnitAI)
|3675|3675| 		{
|3676|3676| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3677|    |-			{
|    |3677|+			
|3678|3678| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3679|3679| 				{
|3680|3680| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3681|3681| 					return;
|3682|3682| 				}
|3683|    |-			}
|    |3683|+			
|3684|3684| 		}
|3685|3685| 	}
|3686|3686| 
|    | [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
|3686|3686| 
|3687|3687| 	// If nothing found, take the unit orders
|3688|3688| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3689|    |-	{
|    |3689|+	
|3690|3690| 		if (isWorkType(this.orderQueue[i].type))
|3691|3691| 		{
|3692|3692| 			this.workOrders = this.orderQueue.slice(i);
|3693|3693| 			return;
|3694|3694| 		}
|3695|    |-	}
|    |3695|+	
|3696|3696| };
|3697|3697| 
|3698|3698| 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
|3752|3752| 	if (data.timerRepeat === undefined)
|3753|3753| 		this.timer = undefined;
|3754|3754| 
|3755|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3755|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3756|3756| };
|3757|3757| 
|3758|3758| /**
|    | [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
|3752|3752| 	if (data.timerRepeat === undefined)
|3753|3753| 		this.timer = undefined;
|3754|3754| 
|3755|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3755|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3756|3756| };
|3757|3757| 
|3758|3758| /**
|    | [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
|3787|3787| 	this.timer = undefined;
|3788|3788| };
|3789|3789| 
|3790|    |-//// Message handlers /////
|    |3790|+// // Message handlers /////
|3791|3791| 
|3792|3792| UnitAI.prototype.OnMotionChanged = function(msg)
|3793|3793| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3799|3799| 	// TODO: This is a bit inefficient since every unit listens to every
|3800|3800| 	// construction message - ideally we could scope it to only the one we're building
|3801|3801| 
|3802|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3802|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3803|3803| };
|3804|3804| 
|3805|3805| 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
|3799|3799| 	// TODO: This is a bit inefficient since every unit listens to every
|3800|3800| 	// construction message - ideally we could scope it to only the one we're building
|3801|3801| 
|3802|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3802|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3803|3803| };
|3804|3804| 
|3805|3805| 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
|3824|3824| 
|3825|3825| UnitAI.prototype.OnAttacked = function(msg)
|3826|3826| {
|3827|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3827|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3828|3828| };
|3829|3829| 
|3830|3830| 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
|3824|3824| 
|3825|3825| UnitAI.prototype.OnAttacked = function(msg)
|3826|3826| {
|3827|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3827|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3828|3828| };
|3829|3829| 
|3830|3830| 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
|3829|3829| 
|3830|3830| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3831|3831| {
|3832|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3832|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3833|3833| };
|3834|3834| 
|3835|3835| 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
|3829|3829| 
|3830|3830| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3831|3831| {
|3832|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3832|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3833|3833| };
|3834|3834| 
|3835|3835| 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
|3834|3834| 
|3835|3835| UnitAI.prototype.OnHealthChanged = function(msg)
|3836|3836| {
|3837|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3837|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3838|3838| };
|3839|3839| 
|3840|3840| 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
|3834|3834| 
|3835|3835| UnitAI.prototype.OnHealthChanged = function(msg)
|3836|3836| {
|3837|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3837|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3838|3838| };
|3839|3839| 
|3840|3840| 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
|3840|3840| UnitAI.prototype.OnRangeUpdate = function(msg)
|3841|3841| {
|3842|3842| 	if (msg.tag == this.losRangeQuery)
|3843|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3843|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3844|3844| 	else if (msg.tag == this.losHealRangeQuery)
|3845|3845| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3846|3846| };
|    | [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
|3840|3840| UnitAI.prototype.OnRangeUpdate = function(msg)
|3841|3841| {
|3842|3842| 	if (msg.tag == this.losRangeQuery)
|3843|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3843|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3844|3844| 	else if (msg.tag == this.losHealRangeQuery)
|3845|3845| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3846|3846| };
|    | [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
|3842|3842| 	if (msg.tag == this.losRangeQuery)
|3843|3843| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3844|3844| 	else if (msg.tag == this.losHealRangeQuery)
|3845|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3845|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3846|3846| };
|3847|3847| 
|3848|3848| 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
|3842|3842| 	if (msg.tag == this.losRangeQuery)
|3843|3843| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3844|3844| 	else if (msg.tag == this.losHealRangeQuery)
|3845|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3845|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3846|3846| };
|3847|3847| 
|3848|3848| 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
|3847|3847| 
|3848|3848| UnitAI.prototype.OnPackFinished = function(msg)
|3849|3849| {
|3850|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3850|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3851|3851| };
|3852|3852| 
|3853|3853| //// 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
|3847|3847| 
|3848|3848| UnitAI.prototype.OnPackFinished = function(msg)
|3849|3849| {
|3850|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3850|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3851|3851| };
|3852|3852| 
|3853|3853| //// 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
|3850|3850| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3851|3851| };
|3852|3852| 
|3853|    |-//// Helper functions to be called by the FSM ////
|    |3853|+// // Helper functions to be called by the FSM ////
|3854|3854| 
|3855|3855| UnitAI.prototype.GetWalkSpeed = function()
|3856|3856| {
|    | [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
|3952|3952| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3953|3953| 		return undefined;
|3954|3954| 
|3955|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3955|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3956|3956| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3957|3957| 		return undefined;
|3958|3958| 
|    | [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
|4037|4037| 			PlaySound(name, member);
|4038|4038| 	}
|4039|4039| 	else
|4040|    |-	{
|    |4040|+	
|4041|4041| 		// Otherwise use our own sounds
|4042|4042| 		PlaySound(name, this.entity);
|4043|    |-	}
|    |4043|+	
|4044|4044| };
|4045|4045| 
|4046|4046| /*
|    | [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
|4229|4229| 	else
|4230|4230| 		// return false? Or hope you come close enough?
|4231|4231| 		var parabolicMaxRange = 0;
|4232|    |-		//return false;
|    |4232|+		// return false;
|4233|4233| 
|4234|4234| 	// the parabole changes while walking, take something in the middle
|4235|4235| 	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
|4316|4316| 	if (this.IsFormationMember())
|4317|4317| 	{
|4318|4318| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4319|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4320|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4319|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4320|+			cmpFormationUnitAI.order.data.target == target)
|4321|4321| 			return true;
|4322|4322| 	}
|4323|4323| 
|    | [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
|4484|4484| UnitAI.prototype.AttackEntityInZone = function(ents)
|4485|4485| {
|4486|4486| 	var target = ents.find(target =>
|4487|    |-		this.CanAttack(target)
|4488|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4487|+		this.CanAttack(target) &&
|    |4488|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4489|4489| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4490|4490| 	);
|4491|4491| 	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
|4485|4485| {
|4486|4486| 	var target = ents.find(target =>
|4487|4487| 		this.CanAttack(target)
|4488|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4489|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4488|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4489|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4490|4490| 	);
|4491|4491| 	if (!target)
|4492|4492| 		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
|4554|4554| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4555|4555| 	if (this.isGuardOf)
|4556|4556| 	{
|4557|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4557|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4558|4558| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4559|4559| 		if (cmpUnitAI && cmpAttack &&
|4560|4560| 		    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
|4558|4558| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4559|4559| 		if (cmpUnitAI && cmpAttack &&
|4560|4560| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4561|    |-				return false;
|    |4561|+			return false;
|4562|4562| 	}
|4563|4563| 
|4564|4564| 	// 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
|4563|4563| 
|4564|4564| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4565|4565| 	if (this.GetStance().respondHoldGround)
|4566|    |-	{
|    |4566|+	
|4567|4567| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4568|4568| 			return true;
|4569|    |-	}
|    |4569|+	
|4570|4570| 
|4571|4571| 	// Stop if it's left our vision range, unless we're especially persistent
|4572|4572| 	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
|4570|4570| 
|4571|4571| 	// Stop if it's left our vision range, unless we're especially persistent
|4572|4572| 	if (!this.GetStance().respondChaseBeyondVision)
|4573|    |-	{
|    |4573|+	
|4574|4574| 		if (!this.CheckTargetIsInVisionRange(target))
|4575|4575| 			return true;
|4576|    |-	}
|    |4576|+	
|4577|4577| 
|4578|4578| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4579|4579| 	// 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
|4596|4596| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4597|4597| 	if (this.isGuardOf)
|4598|4598| 	{
|4599|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4599|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4600|4600| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4601|4601| 		if (cmpUnitAI && cmpAttack &&
|4602|4602| 		    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
|4609|4609| 	return false;
|4610|4610| };
|4611|4611| 
|4612|    |-//// External interface functions ////
|    |4612|+// // External interface functions ////
|4613|4613| 
|4614|4614| UnitAI.prototype.SetFormationController = function(ent)
|4615|4615| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4619|4619| 	// of our own formation (or ourself if not in formation)
|4620|4620| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4621|4621| 	if (cmpObstruction)
|4622|    |-	{
|    |4622|+	
|4623|4623| 		if (ent == INVALID_ENTITY)
|4624|4624| 			cmpObstruction.SetControlGroup(this.entity);
|4625|4625| 		else
|4626|4626| 			cmpObstruction.SetControlGroup(ent);
|4627|    |-	}
|    |4627|+	
|4628|4628| 
|4629|4629| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4630|4630| 	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
|4762|4762| 	// if we already had an old guard order, do nothing if the target is the same
|4763|4763| 	// and the order is running, otherwise remove the previous order
|4764|4764| 	if (this.isGuardOf)
|4765|    |-	{
|    |4765|+	
|4766|4766| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4767|4767| 			return;
|4768|4768| 		else
|4769|4769| 			this.RemoveGuard();
|4770|    |-	}
|    |4770|+	
|4771|4771| 
|4772|4772| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4773|4773| };
|    | [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
|4765|4765| 	{
|4766|4766| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4767|4767| 			return;
|4768|    |-		else
|4769|    |-			this.RemoveGuard();
|    |4768|+		this.RemoveGuard();
|4770|4769| 	}
|4771|4770| 
|4772|4771| 	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
|4936|4936| 			this.WalkToTarget(target, queued);
|4937|4937| 		return;
|4938|4938| 	}
|4939|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4939|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4940|4940| };
|4941|4941| 
|4942|4942| /**
|    | [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
|5085|5085| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5086|5086| 	{
|5087|5087| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5088|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5088|+		if (cmpTrader.HasBothMarkets() &&
|5089|5089| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5090|5090| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5091|5091| 		{
|    | [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
|5366|5366| 				{
|5367|5367| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5368|5368| 					var targetClasses = this.order.data.targetClasses;
|5369|    |-					if (targetClasses.attack && cmpIdentity
|5370|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5369|+					if (targetClasses.attack && cmpIdentity &&
|    |5370|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5371|5371| 						continue;
|5372|5372| 					if (targetClasses.avoid && cmpIdentity
|5373|5373| 						&& 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
|5369|5369| 					if (targetClasses.attack && cmpIdentity
|5370|5370| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5371|5371| 						continue;
|5372|    |-					if (targetClasses.avoid && cmpIdentity
|5373|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5372|+					if (targetClasses.avoid && cmpIdentity &&
|    |5373|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5374|5374| 						continue;
|5375|5375| 					// Only used by the AIs to prevent some choices of targets
|5376|5376| 					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
|5392|5392| 		{
|5393|5393| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5394|5394| 			var targetClasses = this.order.data.targetClasses;
|5395|    |-			if (cmpIdentity && targetClasses.attack
|5396|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5395|+			if (cmpIdentity && targetClasses.attack &&
|    |5396|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5397|5397| 				continue;
|5398|5398| 			if (cmpIdentity && targetClasses.avoid
|5399|5399| 				&& 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
|5395|5395| 			if (cmpIdentity && targetClasses.attack
|5396|5396| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5397|5397| 				continue;
|5398|    |-			if (cmpIdentity && targetClasses.avoid
|5399|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5398|+			if (cmpIdentity && targetClasses.avoid &&
|    |5399|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5400|5400| 				continue;
|5401|5401| 			// Only used by the AIs to prevent some choices of targets
|5402|5402| 			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
|5538|5538| 
|5539|5539| UnitAI.prototype.SetHeldPosition = function(x, z)
|5540|5540| {
|5541|    |-	this.heldPosition = {"x": x, "z": z};
|    |5541|+	this.heldPosition = { "x": x, "z": z};
|5542|5542| };
|5543|5543| 
|5544|5544| 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
|5538|5538| 
|5539|5539| UnitAI.prototype.SetHeldPosition = function(x, z)
|5540|5540| {
|5541|    |-	this.heldPosition = {"x": x, "z": z};
|    |5541|+	this.heldPosition = {"x": x, "z": z };
|5542|5542| };
|5543|5543| 
|5544|5544| 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
|5565|5565| 	return false;
|5566|5566| };
|5567|5567| 
|5568|    |-//// Helper functions ////
|    |5568|+// // Helper functions ////
|5569|5569| 
|5570|5570| UnitAI.prototype.CanAttack = function(target)
|5571|5571| {
|    | [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
|5769|5769| 	return cmpPack && cmpPack.IsPacking();
|5770|5770| };
|5771|5771| 
|5772|    |-//// Formation specific functions ////
|    |5772|+// // Formation specific functions ////
|5773|5773| 
|5774|5774| UnitAI.prototype.IsAttackingAsFormation = function()
|5775|5775| {
|    | [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
|5774|5774| UnitAI.prototype.IsAttackingAsFormation = function()
|5775|5775| {
|5776|5776| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5777|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5778|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5777|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5778|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5779|5779| };
|5780|5780| 
|5781|5781| //// 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
|5778|5778| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5779|5779| };
|5780|5780| 
|5781|    |-//// Animal specific functions ////
|    |5781|+// // Animal specific functions ////
|5782|5782| 
|5783|5783| UnitAI.prototype.MoveRandomly = function(distance)
|5784|5784| {

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
|2071| »   »   »   »   "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
|2254| »   »   »   »   »   »   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
|2309| »   »   »   »   "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
|2427| »   »   »   »   "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
|2492| »   »   »   »   "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
|2532| »   »   »   »   "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
|2742| »   »   »   »   "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
|2926| »   »   »   »   "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
|3657| »   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
|4471| »   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
|4486| »   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
|4532| »   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
|4560| »   »   ····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
|5016| »   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
|2249| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4242| »   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
|4320| »   »   »   &&·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
|4488| »   »   &&·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
|4489| »   »   &&·(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
|5016| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

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

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

It appears that "MovementUpdate" is not called when the attacker comes near the unit that garrisons. While it *is* called when the targetted unit dies. Therein lies the problem I guess, this is now just treating symptoms.
I'm going to stop checking it now, because it seems many movement-related bugs have been introduced.

Stan added a subscriber: Stan.Sun, Jun 9, 3:15 PM

Maybe you could chase the wall instead ? Like stop at vision range of the wall ?

It appears that "MovementUpdate" is not called when the attacker comes near the unit that garrisons. While it *is* called when the targetted unit dies. Therein lies the problem I guess, this is now just treating symptoms.
I'm going to stop checking it now, because it seems many movement-related bugs have been introduced.

Yeah some of that is going to be fixed upstream.

I must warn that when explicitly giving the attack order and the unit garrisons it will look really weird.

Well the question is "what would the player prefer? That the unit just stops? That it goes to the last known position?". I don't have a perfect answer for this.

By the way is there something left to chase when the unit garrisons?

Another excellent question. In the case of a forced order... Perhaps? Otherwise, I think we probably want to try and attack another unit.