Page MenuHomeWildfire Games

Additional fixes following rP22313 - units no longer return to gather nearby resources when depleting a chicken/tree/...
ClosedPublic

Authored by wraitii on Jun 5 2019, 9:04 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22342: Additional fixes following rP22313 - units no longer return to gather nearby…
Summary

Noticed by @minohaka, following rP22313 units no longer collected nearby resources after depleting one.

The cause for this is that the old code, in Order.Gather, started moving right away and put us in APPROACHING state. This failed, but that failure didn't actually change our state. Then MoveCompleted() was triggered (probably errored out), and this put us in GATHERING state, which did correctly handle returning to collect resources.

I think this "find nearby resources" code should be moved to another state, but in the meantime this fixes the issue appropriately, and adds a test case for it.

Test Plan

Test that all chickens are gathered by one unit in one order.

Diff Detail

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

Event Timeline

wraitii created this revision.Jun 5 2019, 9:04 PM
Owners added a subscriber: Restricted Owners Package.Jun 5 2019, 9:04 PM
Vulcan added a comment.Jun 5 2019, 9:12 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
| 356| 356| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 357| 357| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 358| 358| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 359|    |-		{
|    | 359|+		
| 360| 360| 			// we were already on the shoreline, and have not moved since
| 361| 361| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 362| 362| 				needToMove = false;
| 363|    |-		}
|    | 363|+		
| 364| 364| 
| 365| 365| 		if (needToMove)
| 366| 366| 			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
| 354| 354| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 355| 355| 		var needToMove = true;
| 356| 356| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 357|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 358|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 357|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 358|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 359| 359| 		{
| 360| 360| 			// we were already on the shoreline, and have not moved since
| 361| 361| 			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
| 519| 519| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 520| 520| 				}
| 521| 521| 				else
| 522|    |-				{
|    | 522|+				
| 523| 523| 					// We couldn't move there, or the target moved away
| 524| 524| 					this.FinishOrder();
| 525|    |-				}
|    | 525|+				
| 526| 526| 				return;
| 527| 527| 			}
| 528| 528| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 734| 734| 			}
| 735| 735| 			// Check if we are already in range, otherwise walk there
| 736| 736| 			if (!this.CheckGarrisonRange(msg.data.target))
| 737|    |-			{
|    | 737|+			
| 738| 738| 				if (!this.CheckTargetVisible(msg.data.target))
| 739| 739| 				{
| 740| 740| 					this.FinishOrder();
| 745| 745| 					this.SetNextState("GARRISON.APPROACHING");
| 746| 746| 					return;
| 747| 747| 				}
| 748|    |-			}
|    | 748|+			
| 749| 749| 
| 750| 750| 			this.SetNextState("GARRISON.GARRISONING");
| 751| 751| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 740| 740| 					this.FinishOrder();
| 741| 741| 					return;
| 742| 742| 				}
| 743|    |-				else
| 744|    |-				{
|    | 743|+				
| 745| 744| 					this.SetNextState("GARRISON.APPROACHING");
| 746| 745| 					return;
| 747|    |-				}
|    | 746|+				
| 748| 747| 			}
| 749| 748| 
| 750| 749| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 763| 763| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 764| 764| 					}
| 765| 765| 					else
| 766|    |-					{
|    | 766|+					
| 767| 767| 						// We couldn't move there, or the target moved away
| 768| 768| 						this.FinishOrder();
| 769|    |-					}
|    | 769|+					
| 770| 770| 					return;
| 771| 771| 				}
| 772| 772| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1011|1011| 			},
|1012|1012| 		},
|1013|1013| 
|1014|    |-		"GARRISON":{
|    |1014|+		"GARRISON": {
|1015|1015| 			"enter": function() {
|1016|1016| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1017|1017| 				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
|1231|1231| 			// If the controller handled an order but some members rejected it,
|1232|1232| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1233|1233| 			if (this.orderQueue.length)
|1234|    |-			{
|    |1234|+			
|1235|1235| 				// We're leaving the formation, so stop our FormationWalk order
|1236|1236| 				if (this.FinishOrder())
|1237|1237| 					return;
|1238|    |-			}
|    |1238|+			
|1239|1239| 
|1240|1240| 			// No orders left, we're an individual now
|1241|1241| 			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
|1259|1259| 			// Move a tile outside the building
|1260|1260| 			let range = 4;
|1261|1261| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1262|    |-			{
|    |1262|+			
|1263|1263| 				// We are already at the target, or can't move at all
|1264|1264| 				this.FinishOrder();
|1265|    |-			}
|    |1265|+			
|1266|1266| 			else
|1267|1267| 			{
|1268|1268| 				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
|1474|1474| 
|1475|1475| 			"LosRangeUpdate": function(msg) {
|1476|1476| 				if (this.GetStance().targetVisibleEnemies)
|1477|    |-				{
|    |1477|+				
|1478|1478| 					// Start attacking one of the newly-seen enemy (if any)
|1479|1479| 					this.AttackEntitiesByPreference(msg.data.added);
|1480|    |-				}
|    |1480|+				
|1481|1481| 			},
|1482|1482| 
|1483|1483| 			"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
|1511|1511| 				this.SelectAnimation("move");
|1512|1512| 			},
|1513|1513| 
|1514|    |-			"leave": function () {
|    |1514|+			"leave": function() {
|1515|1515| 				this.SelectAnimation("idle");
|1516|1516| 				this.StopMoving();
|1517|1517| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1688|1688| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1689|1689| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1690|1690| 						if (cmpHealth && cmpHealth.IsInjured())
|1691|    |-						{
|    |1691|+						
|1692|1692| 							if (this.CanHeal(this.isGuardOf))
|1693|1693| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1694|1694| 							else if (this.CanRepair(this.isGuardOf))
|1695|1695| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1696|    |-						}
|    |1696|+						
|1697|1697| 					}
|1698|1698| 				},
|1699|1699| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1791|1791| 				"MoveCompleted": function() {
|1792|1792| 
|1793|1793| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1794|    |-					{
|    |1794|+					
|1795|1795| 						// If the unit needs to unpack, do so
|1796|1796| 						if (this.CanUnpack())
|1797|1797| 						{
|1800|1800| 						}
|1801|1801| 						else
|1802|1802| 							this.SetNextState("ATTACKING");
|1803|    |-					}
|    |1803|+					
|1804|1804| 					else
|1805|1805| 					{
|1806|1806| 						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
|1798|1798| 							this.PushOrderFront("Unpack", { "force": true });
|1799|1799| 							return;
|1800|1800| 						}
|1801|    |-						else
|1802|    |-							this.SetNextState("ATTACKING");
|    |1801|+						this.SetNextState("ATTACKING");
|1803|1802| 					}
|1804|1803| 					else
|1805|1804| 					{
|    | [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
|1802|1802| 							this.SetNextState("ATTACKING");
|1803|1803| 					}
|1804|1804| 					else
|1805|    |-					{
|    |1805|+					
|1806|1806| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1807|1807| 						{
|1808|1808| 							this.SetNextState("APPROACHING");
|1812|1812| 							// Give up
|1813|1813| 							this.FinishOrder();
|1814|1814| 						}
|1815|    |-					}
|    |1815|+					
|1816|1816| 				},
|1817|1817| 			},
|1818|1818| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1804|1804| 					else
|1805|1805| 					{
|1806|1806| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1807|    |-						{
|    |1807|+						
|1808|1808| 							this.SetNextState("APPROACHING");
|1809|    |-						}
|    |1809|+						
|1810|1810| 						else
|1811|1811| 						{
|1812|1812| 							// 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
|1808|1808| 							this.SetNextState("APPROACHING");
|1809|1809| 						}
|1810|1810| 						else
|1811|    |-						{
|    |1811|+						
|1812|1812| 							// Give up
|1813|1813| 							this.FinishOrder();
|1814|    |-						}
|    |1814|+						
|1815|1815| 					}
|1816|1816| 				},
|1817|1817| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1829|1829| 					}
|1830|1830| 					// Check the target is still alive and attackable
|1831|1831| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1832|    |-					{
|    |1832|+					
|1833|1833| 						// Can't reach it - try to chase after it
|1834|1834| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1835|1835| 						{
|1844|1844| 								return true;
|1845|1845| 							}
|1846|1846| 						}
|1847|    |-					}
|    |1847|+					
|1848|1848| 
|1849|1849| 					this.StopMoving();
|1850|1850| 
|    | [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
|1877|1877| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1878|1878| 
|1879|1879| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1880|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1880|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1881|1881| 
|1882|1882| 					this.FaceTowardsTarget(this.order.data.target);
|1883|1883| 
|    | [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
|2006|2006| 
|2007|2007| 				"Attacked": function(msg) {
|2008|2008| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2009|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2010|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2009|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2010|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2011|2011| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2012|2012| 				},
|2013|2013| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2026|2026| 					this.SelectAnimation("move");
|2027|2027| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2028|2028| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2029|    |-					{
|    |2029|+					
|2030|2030| 						// Run after a fleeing target
|2031|2031| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2032|    |-					}
|    |2032|+					
|2033|2033| 					this.StartTimer(1000, 1000);
|2034|2034| 				},
|2035|2035| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2210|2210| 
|2211|2211| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2212|2212| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2213|    |-					{
|    |2213|+					
|2214|2214| 						// Check we can still reach and gather from the target
|2215|2215| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2216|2216| 						{
|2275|2275| 								return;
|2276|2276| 							}
|2277|2277| 						}
|2278|    |-					}
|    |2278|+					
|2279|2279| 
|2280|2280| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2281|2281| 
|    | [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
|2301|2301| 					// Also don't switch to a different type of huntable animal
|2302|2302| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2303|2303| 						return (
|2304|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2305|    |-							|| (type.specific == resourceType.specific
|    |2304|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2305|+							(type.specific == resourceType.specific
|2306|2306| 							&& (type.specific != "meat" || resourceTemplate == template))
|2307|2307| 						);
|2308|2308| 					});
|    | [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
|2302|2302| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2303|2303| 						return (
|2304|2304| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2305|    |-							|| (type.specific == resourceType.specific
|2306|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2305|+							|| (type.specific == resourceType.specific &&
|    |2306|+							(type.specific != "meat" || resourceTemplate == template))
|2307|2307| 						);
|2308|2308| 					});
|2309|2309| 					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
|2367|2367| 
|2368|2368| 				"Timer": function(msg) {
|2369|2369| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2370|    |-					{
|    |2370|+					
|2371|2371| 						// Return to our original position unless we have a better order.
|2372|2372| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2373|2373| 							this.WalkToHeldPosition();
|2374|    |-					}
|    |2374|+					
|2375|2375| 				},
|2376|2376| 
|2377|2377| 				"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
|2401|2401| 					this.StartTimer(prepare, this.healTimers.repeat);
|2402|2402| 
|2403|2403| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2404|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2404|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2405|2405| 
|2406|2406| 					this.FaceTowardsTarget(this.order.data.target);
|2407|2407| 				},
|    | [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
|2613|2613| 					{
|2614|2614| 						// The building was already finished/fully repaired before we arrived;
|2615|2615| 						// let the ConstructionFinished handler handle this.
|2616|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2616|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2617|2617| 						return true;
|2618|2618| 					}
|2619|2619| 
|    | [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
|2613|2613| 					{
|2614|2614| 						// The building was already finished/fully repaired before we arrived;
|2615|2615| 						// let the ConstructionFinished handler handle this.
|2616|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2616|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2617|2617| 						return true;
|2618|2618| 					}
|2619|2619| 
|    | [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
|2656|2656| 					if (!inRange && this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2657|2657| 						this.SetNextState("APPROACHING");
|2658|2658| 					else if (!inRange)
|2659|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2659|+						this.FinishOrder(); // can't approach and isn't in reach
|2660|2660| 				},
|2661|2661| 			},
|2662|2662| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2743|2743| 
|2744|2744| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2745|2745| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2746|    |-				{
|    |2746|+				
|2747|2747| 					// We're already walking to the given point, so add this as a order.
|2748|2748| 					this.WalkToTarget(msg.data.newentity, true);
|2749|    |-				}
|    |2749|+				
|2750|2750| 			},
|2751|2751| 		},
|2752|2752| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2805|2805| 
|2806|2806| 					// Check that we can garrison here
|2807|2807| 					if (this.CanGarrison(target))
|2808|    |-					{
|    |2808|+					
|2809|2809| 						// Check that we're in range of the garrison target
|2810|2810| 						if (this.CheckGarrisonRange(target))
|2811|2811| 						{
|2881|2881| 								return false;
|2882|2882| 							}
|2883|2883| 						}
|2884|    |-					}
|    |2884|+					
|2885|2885| 					// Garrisoning failed for some reason, so finish the order
|2886|2886| 					this.FinishOrder();
|2887|2887| 					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
|3002|3002| 		"Attacked": function(msg) {
|3003|3003| 			if (this.template.NaturalBehaviour == "skittish" ||
|3004|3004| 			    this.template.NaturalBehaviour == "passive")
|3005|    |-			{
|    |3005|+			
|3006|3006| 				this.Flee(msg.data.attacker, false);
|3007|    |-			}
|    |3007|+			
|3008|3008| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3009|3009| 			{
|3010|3010| 				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
|3011|3011| 					this.Attack(msg.data.attacker, false);
|3012|3012| 			}
|3013|3013| 			else if (this.template.NaturalBehaviour == "domestic")
|3014|    |-			{
|    |3014|+			
|3015|3015| 				// Never flee, stop what we were doing
|3016|3016| 				this.SetNextState("IDLE");
|3017|    |-			}
|    |3017|+			
|3018|3018| 		},
|3019|3019| 
|3020|3020| 		"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
|3025|3025| 				this.FinishOrder();
|3026|3026| 				return;
|3027|3027| 			}
|3028|    |-			else
|3029|    |-			{
|    |3028|+			
|3030|3029| 				this.order.data.min = range;
|3031|3030| 				this.SetNextState("WALKING");
|3032|    |-			}
|    |3031|+			
|3033|3032| 		},
|3034|3033| 
|3035|3034| 		"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
|3069|3069| 				}
|3070|3070| 				// Start attacking one of the newly-seen enemy (if any)
|3071|3071| 				else if (this.IsDangerousAnimal())
|3072|    |-				{
|    |3072|+				
|3073|3073| 					this.AttackVisibleEntity(msg.data.added);
|3074|    |-				}
|    |3074|+				
|3075|3075| 
|3076|3076| 				// TODO: if two units enter our range together, we'll attack the
|3077|3077| 				// 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
|3112|3112| 				}
|3113|3113| 				// Start attacking one of the newly-seen enemy (if any)
|3114|3114| 				else if (this.template.NaturalBehaviour == "violent")
|3115|    |-				{
|    |3115|+				
|3116|3116| 					this.AttackVisibleEntity(msg.data.added);
|3117|    |-				}
|    |3117|+				
|3118|3118| 			},
|3119|3119| 
|3120|3120| 			"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
|3129|3129| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3130|3130| 
|3131|3131| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3132|    |-							// only used for domestic animals
|    |3132|+		// only used for domestic animals
|3133|3133| 	},
|3134|3134| };
|3135|3135| 
|    | [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
|3186|3186| 
|3187|3187| UnitAI.prototype.IsAnimal = function()
|3188|3188| {
|3189|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3189|+	return (!!this.template.NaturalBehaviour);
|3190|3190| };
|3191|3191| 
|3192|3192| 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
|3224|3224| UnitAI.prototype.GetGarrisonHolder = function()
|3225|3225| {
|3226|3226| 	if (this.IsGarrisoned())
|3227|    |-	{
|    |3227|+	
|3228|3228| 		for (let order of this.orderQueue)
|3229|3229| 			if (order.type == "Garrison")
|3230|3230| 				return order.data.target;
|3231|    |-	}
|    |3231|+	
|3232|3232| 	return INVALID_ENTITY;
|3233|3233| };
|3234|3234| 
|    | [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
|3302|3302| 		{
|3303|3303| 			let index = this.GetCurrentState().indexOf(".");
|3304|3304| 			if (index != -1)
|3305|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3305|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3306|3306| 			this.Stop(false);
|3307|3307| 		}
|3308|3308| 
|    | [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
|3358|3358| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3359|3359| 			continue;
|3360|3360| 		if (i == 0)
|3361|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3361|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3362|3362| 		else
|3363|3363| 			this.orderQueue.splice(i, 1);
|3364|3364| 		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
|3358|3358| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3359|3359| 			continue;
|3360|3360| 		if (i == 0)
|3361|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3361|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3362|3362| 		else
|3363|3363| 			this.orderQueue.splice(i, 1);
|3364|3364| 		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
|3442|3442| };
|3443|3443| 
|3444|3444| 
|3445|    |-//// FSM linkage functions ////
|    |3445|+// // FSM linkage functions ////
|3446|3446| 
|3447|3447| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3448|3448| 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
|3614|3614| 				continue;
|3615|3615| 			if (this.orderQueue[i].type == type)
|3616|3616| 				continue;
|3617|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3617|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3618|3618| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3619|3619| 			return;
|3620|3620| 		}
|    | [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
|3614|3614| 				continue;
|3615|3615| 			if (this.orderQueue[i].type == type)
|3616|3616| 				continue;
|3617|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3617|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3618|3618| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3619|3619| 			return;
|3620|3620| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3628|3628| {
|3629|3629| 	// Remember the previous work orders to be able to go back to them later if required
|3630|3630| 	if (data && data.force)
|3631|    |-	{
|    |3631|+	
|3632|3632| 		if (this.IsFormationController())
|3633|3633| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3634|3634| 		else
|3635|3635| 			this.UpdateWorkOrders(type);
|3636|    |-	}
|    |3636|+	
|3637|3637| 
|3638|3638| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3639|3639| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3705|3705| 	{
|3706|3706| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3707|3707| 		if (cmpUnitAI)
|3708|    |-		{
|    |3708|+		
|3709|3709| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3710|3710| 			{
|3711|3711| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3714|3714| 					return;
|3715|3715| 				}
|3716|3716| 			}
|3717|    |-		}
|    |3717|+		
|3718|3718| 	}
|3719|3719| 
|3720|3720| 	// 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
|3707|3707| 		if (cmpUnitAI)
|3708|3708| 		{
|3709|3709| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3710|    |-			{
|    |3710|+			
|3711|3711| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3712|3712| 				{
|3713|3713| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3714|3714| 					return;
|3715|3715| 				}
|3716|    |-			}
|    |3716|+			
|3717|3717| 		}
|3718|3718| 	}
|3719|3719| 
|    | [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
|3719|3719| 
|3720|3720| 	// If nothing found, take the unit orders
|3721|3721| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3722|    |-	{
|    |3722|+	
|3723|3723| 		if (isWorkType(this.orderQueue[i].type))
|3724|3724| 		{
|3725|3725| 			this.workOrders = this.orderQueue.slice(i);
|3726|3726| 			return;
|3727|3727| 		}
|3728|    |-	}
|    |3728|+	
|3729|3729| };
|3730|3730| 
|3731|3731| 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
|3785|3785| 	if (data.timerRepeat === undefined)
|3786|3786| 		this.timer = undefined;
|3787|3787| 
|3788|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3788|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3789|3789| };
|3790|3790| 
|3791|3791| /**
|    | [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
|3785|3785| 	if (data.timerRepeat === undefined)
|3786|3786| 		this.timer = undefined;
|3787|3787| 
|3788|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3788|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3789|3789| };
|3790|3790| 
|3791|3791| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3820|3820| 	this.timer = undefined;
|3821|3821| };
|3822|3822| 
|3823|    |-//// Message handlers /////
|    |3823|+// // Message handlers /////
|3824|3824| 
|3825|3825| UnitAI.prototype.OnMotionChanged = function(msg)
|3826|3826| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3825|3825| UnitAI.prototype.OnMotionChanged = function(msg)
|3826|3826| {
|3827|3827| 	if (msg.starting && !msg.error)
|3828|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3828|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3829|3829| 	else if (!msg.starting || msg.error)
|3830|3830| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3831|3831| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3825|3825| UnitAI.prototype.OnMotionChanged = function(msg)
|3826|3826| {
|3827|3827| 	if (msg.starting && !msg.error)
|3828|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3828|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3829|3829| 	else if (!msg.starting || msg.error)
|3830|3830| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3831|3831| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3827|3827| 	if (msg.starting && !msg.error)
|3828|3828| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3829|3829| 	else if (!msg.starting || msg.error)
|3830|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3830|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3831|3831| };
|3832|3832| 
|3833|3833| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3827|3827| 	if (msg.starting && !msg.error)
|3828|3828| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3829|3829| 	else if (!msg.starting || msg.error)
|3830|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3830|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3831|3831| };
|3832|3832| 
|3833|3833| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3835|3835| 	// TODO: This is a bit inefficient since every unit listens to every
|3836|3836| 	// construction message - ideally we could scope it to only the one we're building
|3837|3837| 
|3838|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3838|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3839|3839| };
|3840|3840| 
|3841|3841| 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
|3835|3835| 	// TODO: This is a bit inefficient since every unit listens to every
|3836|3836| 	// construction message - ideally we could scope it to only the one we're building
|3837|3837| 
|3838|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3838|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3839|3839| };
|3840|3840| 
|3841|3841| 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
|3860|3860| 
|3861|3861| UnitAI.prototype.OnAttacked = function(msg)
|3862|3862| {
|3863|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3863|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3864|3864| };
|3865|3865| 
|3866|3866| 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
|3860|3860| 
|3861|3861| UnitAI.prototype.OnAttacked = function(msg)
|3862|3862| {
|3863|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3863|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3864|3864| };
|3865|3865| 
|3866|3866| 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
|3865|3865| 
|3866|3866| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3867|3867| {
|3868|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3868|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3869|3869| };
|3870|3870| 
|3871|3871| 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
|3865|3865| 
|3866|3866| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3867|3867| {
|3868|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3868|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3869|3869| };
|3870|3870| 
|3871|3871| 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
|3870|3870| 
|3871|3871| UnitAI.prototype.OnHealthChanged = function(msg)
|3872|3872| {
|3873|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3873|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3874|3874| };
|3875|3875| 
|3876|3876| 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
|3870|3870| 
|3871|3871| UnitAI.prototype.OnHealthChanged = function(msg)
|3872|3872| {
|3873|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3873|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3874|3874| };
|3875|3875| 
|3876|3876| 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
|3876|3876| UnitAI.prototype.OnRangeUpdate = function(msg)
|3877|3877| {
|3878|3878| 	if (msg.tag == this.losRangeQuery)
|3879|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3879|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3880|3880| 	else if (msg.tag == this.losHealRangeQuery)
|3881|3881| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3882|3882| };
|    | [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
|3876|3876| UnitAI.prototype.OnRangeUpdate = function(msg)
|3877|3877| {
|3878|3878| 	if (msg.tag == this.losRangeQuery)
|3879|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3879|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3880|3880| 	else if (msg.tag == this.losHealRangeQuery)
|3881|3881| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3882|3882| };
|    | [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
|3878|3878| 	if (msg.tag == this.losRangeQuery)
|3879|3879| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3880|3880| 	else if (msg.tag == this.losHealRangeQuery)
|3881|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3881|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3882|3882| };
|3883|3883| 
|3884|3884| 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
|3878|3878| 	if (msg.tag == this.losRangeQuery)
|3879|3879| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3880|3880| 	else if (msg.tag == this.losHealRangeQuery)
|3881|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3881|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3882|3882| };
|3883|3883| 
|3884|3884| 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
|3883|3883| 
|3884|3884| UnitAI.prototype.OnPackFinished = function(msg)
|3885|3885| {
|3886|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3886|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3887|3887| };
|3888|3888| 
|3889|3889| //// 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
|3883|3883| 
|3884|3884| UnitAI.prototype.OnPackFinished = function(msg)
|3885|3885| {
|3886|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3886|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3887|3887| };
|3888|3888| 
|3889|3889| //// 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
|3886|3886| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3887|3887| };
|3888|3888| 
|3889|    |-//// Helper functions to be called by the FSM ////
|    |3889|+// // Helper functions to be called by the FSM ////
|3890|3890| 
|3891|3891| UnitAI.prototype.GetWalkSpeed = function()
|3892|3892| {
|    | [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
|3988|3988| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3989|3989| 		return undefined;
|3990|3990| 
|3991|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3991|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3992|3992| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3993|3993| 		return undefined;
|3994|3994| 
|    | [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
|4073|4073| 			PlaySound(name, member);
|4074|4074| 	}
|4075|4075| 	else
|4076|    |-	{
|    |4076|+	
|4077|4077| 		// Otherwise use our own sounds
|4078|4078| 		PlaySound(name, this.entity);
|4079|    |-	}
|    |4079|+	
|4080|4080| };
|4081|4081| 
|4082|4082| /*
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4169|4169| UnitAI.prototype.MoveTo = function(data, iid, type)
|4170|4170| {
|4171|4171| 	if (data["target"])
|4172|    |-	{
|    |4172|+	
|4173|4173| 		if (data["min"] || data["max"])
|4174|4174| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4175|4175| 		else
|4179|4179| 			else
|4180|4180| 				return this.MoveToTargetRange(data.target, iid, type);
|4181|4181| 		}
|4182|    |-	}
|    |4182|+	
|4183|4183| 	else
|4184|4184| 	{
|4185|4185| 		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
|4168|4168|  */
|4169|4169| UnitAI.prototype.MoveTo = function(data, iid, type)
|4170|4170| {
|4171|    |-	if (data["target"])
|    |4171|+	if (data.target)
|4172|4172| 	{
|4173|4173| 		if (data["min"] || data["max"])
|4174|4174| 			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
|4170|4170| {
|4171|4171| 	if (data["target"])
|4172|4172| 	{
|4173|    |-		if (data["min"] || data["max"])
|    |4173|+		if (data.min || data["max"])
|4174|4174| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4175|4175| 		else
|4176|4176| 		{
|    | [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
|4170|4170| {
|4171|4171| 	if (data["target"])
|4172|4172| 	{
|4173|    |-		if (data["min"] || data["max"])
|    |4173|+		if (data["min"] || data.max)
|4174|4174| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4175|4175| 		else
|4176|4176| 		{
|    | [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
|4173|4173| 		if (data["min"] || data["max"])
|4174|4174| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4175|4175| 		else
|4176|    |-		{
|    |4176|+		
|4177|4177| 			if (!iid)
|4178|4178| 				return this.MoveToTarget(data.target);
|4179|4179| 			else
|4180|4180| 				return this.MoveToTargetRange(data.target, iid, type);
|4181|    |-		}
|    |4181|+		
|4182|4182| 	}
|4183|4183| 	else
|4184|4184| 	{
|    | [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
|4172|4172| 	{
|4173|4173| 		if (data["min"] || data["max"])
|4174|4174| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4175|    |-		else
|4176|    |-		{
|    |4175|+		
|4177|4176| 			if (!iid)
|4178|4177| 				return this.MoveToTarget(data.target);
|4179|4178| 			else
|4180|4179| 				return this.MoveToTargetRange(data.target, iid, type);
|4181|    |-		}
|    |4180|+		
|4182|4181| 	}
|4183|4182| 	else
|4184|4183| 	{
|    | [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
|4176|4176| 		{
|4177|4177| 			if (!iid)
|4178|4178| 				return this.MoveToTarget(data.target);
|4179|    |-			else
|4180|    |-				return this.MoveToTargetRange(data.target, iid, type);
|    |4179|+			return this.MoveToTargetRange(data.target, iid, type);
|4181|4180| 		}
|4182|4181| 	}
|4183|4182| 	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
|4181|4181| 		}
|4182|4182| 	}
|4183|4183| 	else
|4184|    |-	{
|    |4184|+	
|4185|4185| 		if (data["min"] || data["max"])
|4186|4186| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4187|4187| 		else
|4188|4188| 			return this.MoveToPoint(data.x, data.z);
|4189|    |-	}
|    |4189|+	
|4190|4190| }
|4191|4191| 
|4192|4192| 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
|4182|4182| 	}
|4183|4183| 	else
|4184|4184| 	{
|4185|    |-		if (data["min"] || data["max"])
|    |4185|+		if (data.min || data["max"])
|4186|4186| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4187|4187| 		else
|4188|4188| 			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
|4182|4182| 	}
|4183|4183| 	else
|4184|4184| 	{
|4185|    |-		if (data["min"] || data["max"])
|    |4185|+		if (data["min"] || data.max)
|4186|4186| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4187|4187| 		else
|4188|4188| 			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
|4184|4184| 	{
|4185|4185| 		if (data["min"] || data["max"])
|4186|4186| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4187|    |-		else
|4188|    |-			return this.MoveToPoint(data.x, data.z);
|    |4187|+		return this.MoveToPoint(data.x, data.z);
|4189|4188| 	}
|4190|4189| }
|4191|4190| 
|    | [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
|4187|4187| 		else
|4188|4188| 			return this.MoveToPoint(data.x, data.z);
|4189|4189| 	}
|4190|    |-}
|    |4190|+};
|4191|4191| 
|4192|4192| UnitAI.prototype.MoveToPoint = function(x, z)
|4193|4193| {
|    | [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
|4271|4271| 	else
|4272|4272| 		// return false? Or hope you come close enough?
|4273|4273| 		var parabolicMaxRange = 0;
|4274|    |-		//return false;
|    |4274|+		// return false;
|4275|4275| 
|4276|4276| 	// the parabole changes while walking, take something in the middle
|4277|4277| 	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
|4336|4336| 	if (this.IsFormationMember())
|4337|4337| 	{
|4338|4338| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4339|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4340|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4339|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4340|+			cmpFormationUnitAI.order.data.target == target)
|4341|4341| 			return true;
|4342|4342| 	}
|4343|4343| 
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4504|4504| UnitAI.prototype.AttackEntityInZone = function(ents)
|4505|4505| {
|4506|4506| 	var target = ents.find(target =>
|4507|    |-		this.CanAttack(target)
|4508|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4507|+		this.CanAttack(target) &&
|    |4508|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4509|4509| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4510|4510| 	);
|4511|4511| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4505|4505| {
|4506|4506| 	var target = ents.find(target =>
|4507|4507| 		this.CanAttack(target)
|4508|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4509|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4508|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4509|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4510|4510| 	);
|4511|4511| 	if (!target)
|4512|4512| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4569|4569| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4570|4570| 	if (this.isGuardOf)
|4571|4571| 	{
|4572|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4572|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4573|4573| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4574|4574| 		if (cmpUnitAI && cmpAttack &&
|4575|4575| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4573|4573| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4574|4574| 		if (cmpUnitAI && cmpAttack &&
|4575|4575| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4576|    |-				return false;
|    |4576|+			return false;
|4577|4577| 	}
|4578|4578| 
|4579|4579| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4578|4578| 
|4579|4579| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4580|4580| 	if (this.GetStance().respondHoldGround)
|4581|    |-	{
|    |4581|+	
|4582|4582| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4583|4583| 			return true;
|4584|    |-	}
|    |4584|+	
|4585|4585| 
|4586|4586| 	// Stop if it's left our vision range, unless we're especially persistent
|4587|4587| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4585|4585| 
|4586|4586| 	// Stop if it's left our vision range, unless we're especially persistent
|4587|4587| 	if (!this.GetStance().respondChaseBeyondVision)
|4588|    |-	{
|    |4588|+	
|4589|4589| 		if (!this.CheckTargetIsInVisionRange(target))
|4590|4590| 			return true;
|4591|    |-	}
|    |4591|+	
|4592|4592| 
|4593|4593| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4594|4594| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4611|4611| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4612|4612| 	if (this.isGuardOf)
|4613|4613| 	{
|4614|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4614|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4615|4615| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4616|4616| 		if (cmpUnitAI && cmpAttack &&
|4617|4617| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4624|4624| 	return false;
|4625|4625| };
|4626|4626| 
|4627|    |-//// External interface functions ////
|    |4627|+// // External interface functions ////
|4628|4628| 
|4629|4629| UnitAI.prototype.SetFormationController = function(ent)
|4630|4630| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4634|4634| 	// of our own formation (or ourself if not in formation)
|4635|4635| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4636|4636| 	if (cmpObstruction)
|4637|    |-	{
|    |4637|+	
|4638|4638| 		if (ent == INVALID_ENTITY)
|4639|4639| 			cmpObstruction.SetControlGroup(this.entity);
|4640|4640| 		else
|4641|4641| 			cmpObstruction.SetControlGroup(ent);
|4642|    |-	}
|    |4642|+	
|4643|4643| 
|4644|4644| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4645|4645| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4777|4777| 	// if we already had an old guard order, do nothing if the target is the same
|4778|4778| 	// and the order is running, otherwise remove the previous order
|4779|4779| 	if (this.isGuardOf)
|4780|    |-	{
|    |4780|+	
|4781|4781| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4782|4782| 			return;
|4783|4783| 		else
|4784|4784| 			this.RemoveGuard();
|4785|    |-	}
|    |4785|+	
|4786|4786| 
|4787|4787| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4788|4788| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4780|4780| 	{
|4781|4781| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4782|4782| 			return;
|4783|    |-		else
|4784|    |-			this.RemoveGuard();
|    |4783|+		this.RemoveGuard();
|4785|4784| 	}
|4786|4785| 
|4787|4786| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (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
|4951|4951| 			this.WalkToTarget(target, queued);
|4952|4952| 		return;
|4953|4953| 	}
|4954|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4954|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4955|4955| };
|4956|4956| 
|4957|4957| /**
|    | [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
|5100|5100| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5101|5101| 	{
|5102|5102| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5103|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5103|+		if (cmpTrader.HasBothMarkets() &&
|5104|5104| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5105|5105| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5106|5106| 		{
|    | [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
|5381|5381| 				{
|5382|5382| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5383|5383| 					var targetClasses = this.order.data.targetClasses;
|5384|    |-					if (targetClasses.attack && cmpIdentity
|5385|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5384|+					if (targetClasses.attack && cmpIdentity &&
|    |5385|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5386|5386| 						continue;
|5387|5387| 					if (targetClasses.avoid && cmpIdentity
|5388|5388| 						&& 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
|5384|5384| 					if (targetClasses.attack && cmpIdentity
|5385|5385| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5386|5386| 						continue;
|5387|    |-					if (targetClasses.avoid && cmpIdentity
|5388|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5387|+					if (targetClasses.avoid && cmpIdentity &&
|    |5388|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5389|5389| 						continue;
|5390|5390| 					// Only used by the AIs to prevent some choices of targets
|5391|5391| 					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
|5407|5407| 		{
|5408|5408| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5409|5409| 			var targetClasses = this.order.data.targetClasses;
|5410|    |-			if (cmpIdentity && targetClasses.attack
|5411|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5410|+			if (cmpIdentity && targetClasses.attack &&
|    |5411|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5412|5412| 				continue;
|5413|5413| 			if (cmpIdentity && targetClasses.avoid
|5414|5414| 				&& 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
|5410|5410| 			if (cmpIdentity && targetClasses.attack
|5411|5411| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5412|5412| 				continue;
|5413|    |-			if (cmpIdentity && targetClasses.avoid
|5414|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5413|+			if (cmpIdentity && targetClasses.avoid &&
|    |5414|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5415|5415| 				continue;
|5416|5416| 			// Only used by the AIs to prevent some choices of targets
|5417|5417| 			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
|5553|5553| 
|5554|5554| UnitAI.prototype.SetHeldPosition = function(x, z)
|5555|5555| {
|5556|    |-	this.heldPosition = {"x": x, "z": z};
|    |5556|+	this.heldPosition = { "x": x, "z": z};
|5557|5557| };
|5558|5558| 
|5559|5559| 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
|5553|5553| 
|5554|5554| UnitAI.prototype.SetHeldPosition = function(x, z)
|5555|5555| {
|5556|    |-	this.heldPosition = {"x": x, "z": z};
|    |5556|+	this.heldPosition = {"x": x, "z": z };
|5557|5557| };
|5558|5558| 
|5559|5559| 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
|5580|5580| 	return false;
|5581|5581| };
|5582|5582| 
|5583|    |-//// Helper functions ////
|    |5583|+// // Helper functions ////
|5584|5584| 
|5585|5585| UnitAI.prototype.CanAttack = function(target)
|5586|5586| {
|    | [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
|5784|5784| 	return cmpPack && cmpPack.IsPacking();
|5785|5785| };
|5786|5786| 
|5787|    |-//// Formation specific functions ////
|    |5787|+// // Formation specific functions ////
|5788|5788| 
|5789|5789| UnitAI.prototype.IsAttackingAsFormation = function()
|5790|5790| {
|    | [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
|5789|5789| UnitAI.prototype.IsAttackingAsFormation = function()
|5790|5790| {
|5791|5791| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5792|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5793|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5792|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5793|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5794|5794| };
|5795|5795| 
|5796|5796| //// 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
|5793|5793| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5794|5794| };
|5795|5795| 
|5796|    |-//// Animal specific functions ////
|    |5796|+// // Animal specific functions ////
|5797|5797| 
|5798|5798| UnitAI.prototype.MoveRandomly = function(distance)
|5799|5799| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 895| »   »   »   "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
| 920| »   »   »   "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
| 938| »   »   »   "leave":·function(msg)·{
|    | [NORMAL] ESLintBear (no-dupe-keys):
|    | Duplicate key 'leave'.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|1036| »   »   »   »   "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
|1074| »   »   »   "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
|1107| »   »   »   »   "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
|1320| »   »   »   "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
|1505| »   »   »   "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
|1525| »   »   »   "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
|1554| »   »   »   "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
|1708| »   »   »   "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
|1758| »   »   »   »   "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
|1844| »   »   »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|2016| »   »   »   »   "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
|2107| »   »   »   »   "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
|2291| »   »   »   »   »   »   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
|2346| »   »   »   »   "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
|2464| »   »   »   »   "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
|2529| »   »   »   »   "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
|2566| »   »   »   »   "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
|2775| »   »   »   »   "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
|2958| »   »   »   »   "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
|3690| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5031| »   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
| 358| »   »   ····&&·(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
| 938| »   »   »   "leave":·function(msg)·{
|    | [NORMAL] JSHintBear:
|    | Duplicate key 'leave'.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4190| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4284| »   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
|4340| »   »   »   &&·cmpFormationUnitAI.order.data.target·==·target)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Stan added a subscriber: Stan.Jun 5 2019, 9:26 PM
Stan added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
2132 ↗(On Diff #8326)

Could also check whether it's already INVALID_ENTITY;

2135 ↗(On Diff #8326)

check for that.

wraitii added inline comments.Jun 5 2019, 9:27 PM
binaries/data/mods/public/simulation/components/UnitAI.js
2132 ↗(On Diff #8326)

It can be undefined here, I think it's just easier here.

Angen added a subscriber: Angen.Jun 5 2019, 9:38 PM
Angen added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
2132 ↗(On Diff #8326)

This have to go into if (!cmpSupply || ...) and be set to INVALID_ENTITY allways
Idea of this was that timer will not gather from that resource as number of gatherers is full

wraitii updated this revision to Diff 8329.Jun 5 2019, 9:54 PM
wraitii retitled this revision from Additional fixes for rP22313 - units no longer return to gather nearby resources when depleting a chicken/tree/... to Additional fixes following rP22313 - units no longer return to gather nearby resources when depleting a chicken/tree/....

Cleaner like this.

Stan added inline comments.Jun 5 2019, 9:59 PM
binaries/data/mods/public/simulation/components/UnitAI.js
2138 ↗(On Diff #8329)

Missing a parameter.

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
| 356| 356| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 357| 357| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 358| 358| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 359|    |-		{
|    | 359|+		
| 360| 360| 			// we were already on the shoreline, and have not moved since
| 361| 361| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 362| 362| 				needToMove = false;
| 363|    |-		}
|    | 363|+		
| 364| 364| 
| 365| 365| 		if (needToMove)
| 366| 366| 			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
| 354| 354| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 355| 355| 		var needToMove = true;
| 356| 356| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 357|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 358|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 357|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 358|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 359| 359| 		{
| 360| 360| 			// we were already on the shoreline, and have not moved since
| 361| 361| 			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
| 519| 519| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 520| 520| 				}
| 521| 521| 				else
| 522|    |-				{
|    | 522|+				
| 523| 523| 					// We couldn't move there, or the target moved away
| 524| 524| 					this.FinishOrder();
| 525|    |-				}
|    | 525|+				
| 526| 526| 				return;
| 527| 527| 			}
| 528| 528| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 734| 734| 			}
| 735| 735| 			// Check if we are already in range, otherwise walk there
| 736| 736| 			if (!this.CheckGarrisonRange(msg.data.target))
| 737|    |-			{
|    | 737|+			
| 738| 738| 				if (!this.CheckTargetVisible(msg.data.target))
| 739| 739| 				{
| 740| 740| 					this.FinishOrder();
| 745| 745| 					this.SetNextState("GARRISON.APPROACHING");
| 746| 746| 					return;
| 747| 747| 				}
| 748|    |-			}
|    | 748|+			
| 749| 749| 
| 750| 750| 			this.SetNextState("GARRISON.GARRISONING");
| 751| 751| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 740| 740| 					this.FinishOrder();
| 741| 741| 					return;
| 742| 742| 				}
| 743|    |-				else
| 744|    |-				{
|    | 743|+				
| 745| 744| 					this.SetNextState("GARRISON.APPROACHING");
| 746| 745| 					return;
| 747|    |-				}
|    | 746|+				
| 748| 747| 			}
| 749| 748| 
| 750| 749| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 763| 763| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 764| 764| 					}
| 765| 765| 					else
| 766|    |-					{
|    | 766|+					
| 767| 767| 						// We couldn't move there, or the target moved away
| 768| 768| 						this.FinishOrder();
| 769|    |-					}
|    | 769|+					
| 770| 770| 					return;
| 771| 771| 				}
| 772| 772| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1011|1011| 			},
|1012|1012| 		},
|1013|1013| 
|1014|    |-		"GARRISON":{
|    |1014|+		"GARRISON": {
|1015|1015| 			"enter": function() {
|1016|1016| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1017|1017| 				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
|1231|1231| 			// If the controller handled an order but some members rejected it,
|1232|1232| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1233|1233| 			if (this.orderQueue.length)
|1234|    |-			{
|    |1234|+			
|1235|1235| 				// We're leaving the formation, so stop our FormationWalk order
|1236|1236| 				if (this.FinishOrder())
|1237|1237| 					return;
|1238|    |-			}
|    |1238|+			
|1239|1239| 
|1240|1240| 			// No orders left, we're an individual now
|1241|1241| 			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
|1259|1259| 			// Move a tile outside the building
|1260|1260| 			let range = 4;
|1261|1261| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1262|    |-			{
|    |1262|+			
|1263|1263| 				// We are already at the target, or can't move at all
|1264|1264| 				this.FinishOrder();
|1265|    |-			}
|    |1265|+			
|1266|1266| 			else
|1267|1267| 			{
|1268|1268| 				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
|1474|1474| 
|1475|1475| 			"LosRangeUpdate": function(msg) {
|1476|1476| 				if (this.GetStance().targetVisibleEnemies)
|1477|    |-				{
|    |1477|+				
|1478|1478| 					// Start attacking one of the newly-seen enemy (if any)
|1479|1479| 					this.AttackEntitiesByPreference(msg.data.added);
|1480|    |-				}
|    |1480|+				
|1481|1481| 			},
|1482|1482| 
|1483|1483| 			"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
|1511|1511| 				this.SelectAnimation("move");
|1512|1512| 			},
|1513|1513| 
|1514|    |-			"leave": function () {
|    |1514|+			"leave": function() {
|1515|1515| 				this.SelectAnimation("idle");
|1516|1516| 				this.StopMoving();
|1517|1517| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1688|1688| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1689|1689| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1690|1690| 						if (cmpHealth && cmpHealth.IsInjured())
|1691|    |-						{
|    |1691|+						
|1692|1692| 							if (this.CanHeal(this.isGuardOf))
|1693|1693| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1694|1694| 							else if (this.CanRepair(this.isGuardOf))
|1695|1695| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1696|    |-						}
|    |1696|+						
|1697|1697| 					}
|1698|1698| 				},
|1699|1699| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1791|1791| 				"MoveCompleted": function() {
|1792|1792| 
|1793|1793| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1794|    |-					{
|    |1794|+					
|1795|1795| 						// If the unit needs to unpack, do so
|1796|1796| 						if (this.CanUnpack())
|1797|1797| 						{
|1800|1800| 						}
|1801|1801| 						else
|1802|1802| 							this.SetNextState("ATTACKING");
|1803|    |-					}
|    |1803|+					
|1804|1804| 					else
|1805|1805| 					{
|1806|1806| 						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
|1798|1798| 							this.PushOrderFront("Unpack", { "force": true });
|1799|1799| 							return;
|1800|1800| 						}
|1801|    |-						else
|1802|    |-							this.SetNextState("ATTACKING");
|    |1801|+						this.SetNextState("ATTACKING");
|1803|1802| 					}
|1804|1803| 					else
|1805|1804| 					{
|    | [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
|1802|1802| 							this.SetNextState("ATTACKING");
|1803|1803| 					}
|1804|1804| 					else
|1805|    |-					{
|    |1805|+					
|1806|1806| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1807|1807| 						{
|1808|1808| 							this.SetNextState("APPROACHING");
|1812|1812| 							// Give up
|1813|1813| 							this.FinishOrder();
|1814|1814| 						}
|1815|    |-					}
|    |1815|+					
|1816|1816| 				},
|1817|1817| 			},
|1818|1818| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1804|1804| 					else
|1805|1805| 					{
|1806|1806| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1807|    |-						{
|    |1807|+						
|1808|1808| 							this.SetNextState("APPROACHING");
|1809|    |-						}
|    |1809|+						
|1810|1810| 						else
|1811|1811| 						{
|1812|1812| 							// 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
|1808|1808| 							this.SetNextState("APPROACHING");
|1809|1809| 						}
|1810|1810| 						else
|1811|    |-						{
|    |1811|+						
|1812|1812| 							// Give up
|1813|1813| 							this.FinishOrder();
|1814|    |-						}
|    |1814|+						
|1815|1815| 					}
|1816|1816| 				},
|1817|1817| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1829|1829| 					}
|1830|1830| 					// Check the target is still alive and attackable
|1831|1831| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1832|    |-					{
|    |1832|+					
|1833|1833| 						// Can't reach it - try to chase after it
|1834|1834| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1835|1835| 						{
|1844|1844| 								return true;
|1845|1845| 							}
|1846|1846| 						}
|1847|    |-					}
|    |1847|+					
|1848|1848| 
|1849|1849| 					this.StopMoving();
|1850|1850| 
|    | [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
|1877|1877| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1878|1878| 
|1879|1879| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1880|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1880|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1881|1881| 
|1882|1882| 					this.FaceTowardsTarget(this.order.data.target);
|1883|1883| 
|    | [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
|2006|2006| 
|2007|2007| 				"Attacked": function(msg) {
|2008|2008| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2009|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2010|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2009|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2010|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2011|2011| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2012|2012| 				},
|2013|2013| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2026|2026| 					this.SelectAnimation("move");
|2027|2027| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2028|2028| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2029|    |-					{
|    |2029|+					
|2030|2030| 						// Run after a fleeing target
|2031|2031| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2032|    |-					}
|    |2032|+					
|2033|2033| 					this.StartTimer(1000, 1000);
|2034|2034| 				},
|2035|2035| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2209|2209| 
|2210|2210| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2211|2211| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2212|    |-					{
|    |2212|+					
|2213|2213| 						// Check we can still reach and gather from the target
|2214|2214| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2215|2215| 						{
|2274|2274| 								return;
|2275|2275| 							}
|2276|2276| 						}
|2277|    |-					}
|    |2277|+					
|2278|2278| 
|2279|2279| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2280|2280| 
|    | [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
|2300|2300| 					// Also don't switch to a different type of huntable animal
|2301|2301| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2302|2302| 						return (
|2303|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2304|    |-							|| (type.specific == resourceType.specific
|    |2303|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2304|+							(type.specific == resourceType.specific
|2305|2305| 							&& (type.specific != "meat" || resourceTemplate == template))
|2306|2306| 						);
|2307|2307| 					});
|    | [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
|2301|2301| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2302|2302| 						return (
|2303|2303| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2304|    |-							|| (type.specific == resourceType.specific
|2305|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2304|+							|| (type.specific == resourceType.specific &&
|    |2305|+							(type.specific != "meat" || resourceTemplate == template))
|2306|2306| 						);
|2307|2307| 					});
|2308|2308| 					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
|2366|2366| 
|2367|2367| 				"Timer": function(msg) {
|2368|2368| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2369|    |-					{
|    |2369|+					
|2370|2370| 						// Return to our original position unless we have a better order.
|2371|2371| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2372|2372| 							this.WalkToHeldPosition();
|2373|    |-					}
|    |2373|+					
|2374|2374| 				},
|2375|2375| 
|2376|2376| 				"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
|2400|2400| 					this.StartTimer(prepare, this.healTimers.repeat);
|2401|2401| 
|2402|2402| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2403|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2403|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2404|2404| 
|2405|2405| 					this.FaceTowardsTarget(this.order.data.target);
|2406|2406| 				},
|    | [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
|2612|2612| 					{
|2613|2613| 						// The building was already finished/fully repaired before we arrived;
|2614|2614| 						// let the ConstructionFinished handler handle this.
|2615|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2615|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2616|2616| 						return true;
|2617|2617| 					}
|2618|2618| 
|    | [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
|2612|2612| 					{
|2613|2613| 						// The building was already finished/fully repaired before we arrived;
|2614|2614| 						// let the ConstructionFinished handler handle this.
|2615|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2615|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2616|2616| 						return true;
|2617|2617| 					}
|2618|2618| 
|    | [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
|2655|2655| 					if (!inRange && this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2656|2656| 						this.SetNextState("APPROACHING");
|2657|2657| 					else if (!inRange)
|2658|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2658|+						this.FinishOrder(); // can't approach and isn't in reach
|2659|2659| 				},
|2660|2660| 			},
|2661|2661| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2742|2742| 
|2743|2743| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2744|2744| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2745|    |-				{
|    |2745|+				
|2746|2746| 					// We're already walking to the given point, so add this as a order.
|2747|2747| 					this.WalkToTarget(msg.data.newentity, true);
|2748|    |-				}
|    |2748|+				
|2749|2749| 			},
|2750|2750| 		},
|2751|2751| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2804|2804| 
|2805|2805| 					// Check that we can garrison here
|2806|2806| 					if (this.CanGarrison(target))
|2807|    |-					{
|    |2807|+					
|2808|2808| 						// Check that we're in range of the garrison target
|2809|2809| 						if (this.CheckGarrisonRange(target))
|2810|2810| 						{
|2880|2880| 								return false;
|2881|2881| 							}
|2882|2882| 						}
|2883|    |-					}
|    |2883|+					
|2884|2884| 					// Garrisoning failed for some reason, so finish the order
|2885|2885| 					this.FinishOrder();
|2886|2886| 					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
|3001|3001| 		"Attacked": function(msg) {
|3002|3002| 			if (this.template.NaturalBehaviour == "skittish" ||
|3003|3003| 			    this.template.NaturalBehaviour == "passive")
|3004|    |-			{
|    |3004|+			
|3005|3005| 				this.Flee(msg.data.attacker, false);
|3006|    |-			}
|    |3006|+			
|3007|3007| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3008|3008| 			{
|3009|3009| 				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
|3010|3010| 					this.Attack(msg.data.attacker, false);
|3011|3011| 			}
|3012|3012| 			else if (this.template.NaturalBehaviour == "domestic")
|3013|    |-			{
|    |3013|+			
|3014|3014| 				// Never flee, stop what we were doing
|3015|3015| 				this.SetNextState("IDLE");
|3016|    |-			}
|    |3016|+			
|3017|3017| 		},
|3018|3018| 
|3019|3019| 		"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
|3024|3024| 				this.FinishOrder();
|3025|3025| 				return;
|3026|3026| 			}
|3027|    |-			else
|3028|    |-			{
|    |3027|+			
|3029|3028| 				this.order.data.min = range;
|3030|3029| 				this.SetNextState("WALKING");
|3031|    |-			}
|    |3030|+			
|3032|3031| 		},
|3033|3032| 
|3034|3033| 		"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
|3068|3068| 				}
|3069|3069| 				// Start attacking one of the newly-seen enemy (if any)
|3070|3070| 				else if (this.IsDangerousAnimal())
|3071|    |-				{
|    |3071|+				
|3072|3072| 					this.AttackVisibleEntity(msg.data.added);
|3073|    |-				}
|    |3073|+				
|3074|3074| 
|3075|3075| 				// TODO: if two units enter our range together, we'll attack the
|3076|3076| 				// 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
|3111|3111| 				}
|3112|3112| 				// Start attacking one of the newly-seen enemy (if any)
|3113|3113| 				else if (this.template.NaturalBehaviour == "violent")
|3114|    |-				{
|    |3114|+				
|3115|3115| 					this.AttackVisibleEntity(msg.data.added);
|3116|    |-				}
|    |3116|+				
|3117|3117| 			},
|3118|3118| 
|3119|3119| 			"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
|3128|3128| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3129|3129| 
|3130|3130| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3131|    |-							// only used for domestic animals
|    |3131|+		// only used for domestic animals
|3132|3132| 	},
|3133|3133| };
|3134|3134| 
|    | [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
|3185|3185| 
|3186|3186| UnitAI.prototype.IsAnimal = function()
|3187|3187| {
|3188|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3188|+	return (!!this.template.NaturalBehaviour);
|3189|3189| };
|3190|3190| 
|3191|3191| 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
|3223|3223| UnitAI.prototype.GetGarrisonHolder = function()
|3224|3224| {
|3225|3225| 	if (this.IsGarrisoned())
|3226|    |-	{
|    |3226|+	
|3227|3227| 		for (let order of this.orderQueue)
|3228|3228| 			if (order.type == "Garrison")
|3229|3229| 				return order.data.target;
|3230|    |-	}
|    |3230|+	
|3231|3231| 	return INVALID_ENTITY;
|3232|3232| };
|3233|3233| 
|    | [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
|3301|3301| 		{
|3302|3302| 			let index = this.GetCurrentState().indexOf(".");
|3303|3303| 			if (index != -1)
|3304|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3304|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3305|3305| 			this.Stop(false);
|3306|3306| 		}
|3307|3307| 
|    | [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
|3357|3357| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3358|3358| 			continue;
|3359|3359| 		if (i == 0)
|3360|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3360|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3361|3361| 		else
|3362|3362| 			this.orderQueue.splice(i, 1);
|3363|3363| 		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
|3357|3357| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3358|3358| 			continue;
|3359|3359| 		if (i == 0)
|3360|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3360|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3361|3361| 		else
|3362|3362| 			this.orderQueue.splice(i, 1);
|3363|3363| 		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
|3441|3441| };
|3442|3442| 
|3443|3443| 
|3444|    |-//// FSM linkage functions ////
|    |3444|+// // FSM linkage functions ////
|3445|3445| 
|3446|3446| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3447|3447| 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
|3613|3613| 				continue;
|3614|3614| 			if (this.orderQueue[i].type == type)
|3615|3615| 				continue;
|3616|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3616|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3617|3617| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3618|3618| 			return;
|3619|3619| 		}
|    | [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
|3613|3613| 				continue;
|3614|3614| 			if (this.orderQueue[i].type == type)
|3615|3615| 				continue;
|3616|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3616|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3617|3617| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3618|3618| 			return;
|3619|3619| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3627|3627| {
|3628|3628| 	// Remember the previous work orders to be able to go back to them later if required
|3629|3629| 	if (data && data.force)
|3630|    |-	{
|    |3630|+	
|3631|3631| 		if (this.IsFormationController())
|3632|3632| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3633|3633| 		else
|3634|3634| 			this.UpdateWorkOrders(type);
|3635|    |-	}
|    |3635|+	
|3636|3636| 
|3637|3637| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3638|3638| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3704|3704| 	{
|3705|3705| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3706|3706| 		if (cmpUnitAI)
|3707|    |-		{
|    |3707|+		
|3708|3708| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3709|3709| 			{
|3710|3710| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3713|3713| 					return;
|3714|3714| 				}
|3715|3715| 			}
|3716|    |-		}
|    |3716|+		
|3717|3717| 	}
|3718|3718| 
|3719|3719| 	// 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
|3706|3706| 		if (cmpUnitAI)
|3707|3707| 		{
|3708|3708| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3709|    |-			{
|    |3709|+			
|3710|3710| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3711|3711| 				{
|3712|3712| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3713|3713| 					return;
|3714|3714| 				}
|3715|    |-			}
|    |3715|+			
|3716|3716| 		}
|3717|3717| 	}
|3718|3718| 
|    | [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
|3718|3718| 
|3719|3719| 	// If nothing found, take the unit orders
|3720|3720| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3721|    |-	{
|    |3721|+	
|3722|3722| 		if (isWorkType(this.orderQueue[i].type))
|3723|3723| 		{
|3724|3724| 			this.workOrders = this.orderQueue.slice(i);
|3725|3725| 			return;
|3726|3726| 		}
|3727|    |-	}
|    |3727|+	
|3728|3728| };
|3729|3729| 
|3730|3730| 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
|3784|3784| 	if (data.timerRepeat === undefined)
|3785|3785| 		this.timer = undefined;
|3786|3786| 
|3787|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3787|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3788|3788| };
|3789|3789| 
|3790|3790| /**
|    | [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
|3784|3784| 	if (data.timerRepeat === undefined)
|3785|3785| 		this.timer = undefined;
|3786|3786| 
|3787|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3787|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3788|3788| };
|3789|3789| 
|3790|3790| /**
|    | [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
|3819|3819| 	this.timer = undefined;
|3820|3820| };
|3821|3821| 
|3822|    |-//// Message handlers /////
|    |3822|+// // Message handlers /////
|3823|3823| 
|3824|3824| UnitAI.prototype.OnMotionChanged = function(msg)
|3825|3825| {
|    | [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| UnitAI.prototype.OnMotionChanged = function(msg)
|3825|3825| {
|3826|3826| 	if (msg.starting && !msg.error)
|3827|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3827|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3828|3828| 	else if (!msg.starting || msg.error)
|3829|3829| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3830|3830| };
|    | [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| UnitAI.prototype.OnMotionChanged = function(msg)
|3825|3825| {
|3826|3826| 	if (msg.starting && !msg.error)
|3827|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3827|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3828|3828| 	else if (!msg.starting || msg.error)
|3829|3829| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3830|3830| };
|    | [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| 	if (msg.starting && !msg.error)
|3827|3827| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3828|3828| 	else if (!msg.starting || msg.error)
|3829|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3829|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3830|3830| };
|3831|3831| 
|3832|3832| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3826|3826| 	if (msg.starting && !msg.error)
|3827|3827| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3828|3828| 	else if (!msg.starting || msg.error)
|3829|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3829|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3830|3830| };
|3831|3831| 
|3832|3832| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3834|3834| 	// TODO: This is a bit inefficient since every unit listens to every
|3835|3835| 	// construction message - ideally we could scope it to only the one we're building
|3836|3836| 
|3837|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3837|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3838|3838| };
|3839|3839| 
|3840|3840| 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
|3834|3834| 	// TODO: This is a bit inefficient since every unit listens to every
|3835|3835| 	// construction message - ideally we could scope it to only the one we're building
|3836|3836| 
|3837|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3837|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3838|3838| };
|3839|3839| 
|3840|3840| 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
|3859|3859| 
|3860|3860| UnitAI.prototype.OnAttacked = function(msg)
|3861|3861| {
|3862|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3862|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3863|3863| };
|3864|3864| 
|3865|3865| 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
|3859|3859| 
|3860|3860| UnitAI.prototype.OnAttacked = function(msg)
|3861|3861| {
|3862|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3862|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3863|3863| };
|3864|3864| 
|3865|3865| 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
|3864|3864| 
|3865|3865| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3866|3866| {
|3867|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3867|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3868|3868| };
|3869|3869| 
|3870|3870| 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
|3864|3864| 
|3865|3865| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3866|3866| {
|3867|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3867|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3868|3868| };
|3869|3869| 
|3870|3870| 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
|3869|3869| 
|3870|3870| UnitAI.prototype.OnHealthChanged = function(msg)
|3871|3871| {
|3872|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3872|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3873|3873| };
|3874|3874| 
|3875|3875| 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
|3869|3869| 
|3870|3870| UnitAI.prototype.OnHealthChanged = function(msg)
|3871|3871| {
|3872|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3872|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3873|3873| };
|3874|3874| 
|3875|3875| 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
|3875|3875| UnitAI.prototype.OnRangeUpdate = function(msg)
|3876|3876| {
|3877|3877| 	if (msg.tag == this.losRangeQuery)
|3878|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3878|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3879|3879| 	else if (msg.tag == this.losHealRangeQuery)
|3880|3880| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3881|3881| };
|    | [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
|3875|3875| UnitAI.prototype.OnRangeUpdate = function(msg)
|3876|3876| {
|3877|3877| 	if (msg.tag == this.losRangeQuery)
|3878|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3878|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3879|3879| 	else if (msg.tag == this.losHealRangeQuery)
|3880|3880| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3881|3881| };
|    | [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
|3877|3877| 	if (msg.tag == this.losRangeQuery)
|3878|3878| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3879|3879| 	else if (msg.tag == this.losHealRangeQuery)
|3880|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3880|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3881|3881| };
|3882|3882| 
|3883|3883| 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
|3877|3877| 	if (msg.tag == this.losRangeQuery)
|3878|3878| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3879|3879| 	else if (msg.tag == this.losHealRangeQuery)
|3880|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3880|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3881|3881| };
|3882|3882| 
|3883|3883| 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
|3882|3882| 
|3883|3883| UnitAI.prototype.OnPackFinished = function(msg)
|3884|3884| {
|3885|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3885|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3886|3886| };
|3887|3887| 
|3888|3888| //// 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
|3882|3882| 
|3883|3883| UnitAI.prototype.OnPackFinished = function(msg)
|3884|3884| {
|3885|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3885|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3886|3886| };
|3887|3887| 
|3888|3888| //// 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
|3885|3885| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3886|3886| };
|3887|3887| 
|3888|    |-//// Helper functions to be called by the FSM ////
|    |3888|+// // Helper functions to be called by the FSM ////
|3889|3889| 
|3890|3890| UnitAI.prototype.GetWalkSpeed = function()
|3891|3891| {
|    | [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
|3987|3987| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3988|3988| 		return undefined;
|3989|3989| 
|3990|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3990|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3991|3991| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3992|3992| 		return undefined;
|3993|3993| 
|    | [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
|4072|4072| 			PlaySound(name, member);
|4073|4073| 	}
|4074|4074| 	else
|4075|    |-	{
|    |4075|+	
|4076|4076| 		// Otherwise use our own sounds
|4077|4077| 		PlaySound(name, this.entity);
|4078|    |-	}
|    |4078|+	
|4079|4079| };
|4080|4080| 
|4081|4081| /*
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4168|4168| UnitAI.prototype.MoveTo = function(data, iid, type)
|4169|4169| {
|4170|4170| 	if (data["target"])
|4171|    |-	{
|    |4171|+	
|4172|4172| 		if (data["min"] || data["max"])
|4173|4173| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4174|4174| 		else
|4178|4178| 			else
|4179|4179| 				return this.MoveToTargetRange(data.target, iid, type);
|4180|4180| 		}
|4181|    |-	}
|    |4181|+	
|4182|4182| 	else
|4183|4183| 	{
|4184|4184| 		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
|4167|4167|  */
|4168|4168| UnitAI.prototype.MoveTo = function(data, iid, type)
|4169|4169| {
|4170|    |-	if (data["target"])
|    |4170|+	if (data.target)
|4171|4171| 	{
|4172|4172| 		if (data["min"] || data["max"])
|4173|4173| 			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
|4169|4169| {
|4170|4170| 	if (data["target"])
|4171|4171| 	{
|4172|    |-		if (data["min"] || data["max"])
|    |4172|+		if (data.min || data["max"])
|4173|4173| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4174|4174| 		else
|4175|4175| 		{
|    | [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
|4169|4169| {
|4170|4170| 	if (data["target"])
|4171|4171| 	{
|4172|    |-		if (data["min"] || data["max"])
|    |4172|+		if (data["min"] || data.max)
|4173|4173| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4174|4174| 		else
|4175|4175| 		{
|    | [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
|4172|4172| 		if (data["min"] || data["max"])
|4173|4173| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4174|4174| 		else
|4175|    |-		{
|    |4175|+		
|4176|4176| 			if (!iid)
|4177|4177| 				return this.MoveToTarget(data.target);
|4178|4178| 			else
|4179|4179| 				return this.MoveToTargetRange(data.target, iid, type);
|4180|    |-		}
|    |4180|+		
|4181|4181| 	}
|4182|4182| 	else
|4183|4183| 	{
|    | [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
|4171|4171| 	{
|4172|4172| 		if (data["min"] || data["max"])
|4173|4173| 			return this.MoveToTargetRangeExplicit(data.target, data.min || -1, data.max || -1);
|4174|    |-		else
|4175|    |-		{
|    |4174|+		
|4176|4175| 			if (!iid)
|4177|4176| 				return this.MoveToTarget(data.target);
|4178|4177| 			else
|4179|4178| 				return this.MoveToTargetRange(data.target, iid, type);
|4180|    |-		}
|    |4179|+		
|4181|4180| 	}
|4182|4181| 	else
|4183|4182| 	{
|    | [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
|4175|4175| 		{
|4176|4176| 			if (!iid)
|4177|4177| 				return this.MoveToTarget(data.target);
|4178|    |-			else
|4179|    |-				return this.MoveToTargetRange(data.target, iid, type);
|    |4178|+			return this.MoveToTargetRange(data.target, iid, type);
|4180|4179| 		}
|4181|4180| 	}
|4182|4181| 	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
|4180|4180| 		}
|4181|4181| 	}
|4182|4182| 	else
|4183|    |-	{
|    |4183|+	
|4184|4184| 		if (data["min"] || data["max"])
|4185|4185| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4186|4186| 		else
|4187|4187| 			return this.MoveToPoint(data.x, data.z);
|4188|    |-	}
|    |4188|+	
|4189|4189| }
|4190|4190| 
|4191|4191| 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
|4181|4181| 	}
|4182|4182| 	else
|4183|4183| 	{
|4184|    |-		if (data["min"] || data["max"])
|    |4184|+		if (data.min || data["max"])
|4185|4185| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4186|4186| 		else
|4187|4187| 			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
|4181|4181| 	}
|4182|4182| 	else
|4183|4183| 	{
|4184|    |-		if (data["min"] || data["max"])
|    |4184|+		if (data["min"] || data.max)
|4185|4185| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4186|4186| 		else
|4187|4187| 			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
|4183|4183| 	{
|4184|4184| 		if (data["min"] || data["max"])
|4185|4185| 			return this.MoveToPointRange(data.x, data.z, data.min || -1, data.max || -1);
|4186|    |-		else
|4187|    |-			return this.MoveToPoint(data.x, data.z);
|    |4186|+		return this.MoveToPoint(data.x, data.z);
|4188|4187| 	}
|4189|4188| }
|4190|4189| 
|    | [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
|4186|4186| 		else
|4187|4187| 			return this.MoveToPoint(data.x, data.z);
|4188|4188| 	}
|4189|    |-}
|    |4189|+};
|4190|4190| 
|4191|4191| UnitAI.prototype.MoveToPoint = function(x, z)
|4192|4192| {
|    | [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
|4270|4270| 	else
|4271|4271| 		// return false? Or hope you come close enough?
|4272|4272| 		var parabolicMaxRange = 0;
|4273|    |-		//return false;
|    |4273|+		// return false;
|4274|4274| 
|4275|4275| 	// the parabole changes while walking, take something in the middle
|4276|4276| 	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
|4335|4335| 	if (this.IsFormationMember())
|4336|4336| 	{
|4337|4337| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4338|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4339|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4338|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4339|+			cmpFormationUnitAI.order.data.target == target)
|4340|4340| 			return true;
|4341|4341| 	}
|4342|4342| 
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4503|4503| UnitAI.prototype.AttackEntityInZone = function(ents)
|4504|4504| {
|4505|4505| 	var target = ents.find(target =>
|4506|    |-		this.CanAttack(target)
|4507|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4506|+		this.CanAttack(target) &&
|    |4507|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4508|4508| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4509|4509| 	);
|4510|4510| 	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
|4504|4504| {
|4505|4505| 	var target = ents.find(target =>
|4506|4506| 		this.CanAttack(target)
|4507|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4508|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4507|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4508|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4509|4509| 	);
|4510|4510| 	if (!target)
|4511|4511| 		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
|4568|4568| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4569|4569| 	if (this.isGuardOf)
|4570|4570| 	{
|4571|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4571|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4572|4572| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4573|4573| 		if (cmpUnitAI && cmpAttack &&
|4574|4574| 		    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
|4572|4572| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4573|4573| 		if (cmpUnitAI && cmpAttack &&
|4574|4574| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4575|    |-				return false;
|    |4575|+			return false;
|4576|4576| 	}
|4577|4577| 
|4578|4578| 	// 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
|4577|4577| 
|4578|4578| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4579|4579| 	if (this.GetStance().respondHoldGround)
|4580|    |-	{
|    |4580|+	
|4581|4581| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4582|4582| 			return true;
|4583|    |-	}
|    |4583|+	
|4584|4584| 
|4585|4585| 	// Stop if it's left our vision range, unless we're especially persistent
|4586|4586| 	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
|4584|4584| 
|4585|4585| 	// Stop if it's left our vision range, unless we're especially persistent
|4586|4586| 	if (!this.GetStance().respondChaseBeyondVision)
|4587|    |-	{
|    |4587|+	
|4588|4588| 		if (!this.CheckTargetIsInVisionRange(target))
|4589|4589| 			return true;
|4590|    |-	}
|    |4590|+	
|4591|4591| 
|4592|4592| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4593|4593| 	// 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
|4610|4610| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4611|4611| 	if (this.isGuardOf)
|4612|4612| 	{
|4613|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4613|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4614|4614| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4615|4615| 		if (cmpUnitAI && cmpAttack &&
|4616|4616| 		    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
|4623|4623| 	return false;
|4624|4624| };
|4625|4625| 
|4626|    |-//// External interface functions ////
|    |4626|+// // External interface functions ////
|4627|4627| 
|4628|4628| UnitAI.prototype.SetFormationController = function(ent)
|4629|4629| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4633|4633| 	// of our own formation (or ourself if not in formation)
|4634|4634| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4635|4635| 	if (cmpObstruction)
|4636|    |-	{
|    |4636|+	
|4637|4637| 		if (ent == INVALID_ENTITY)
|4638|4638| 			cmpObstruction.SetControlGroup(this.entity);
|4639|4639| 		else
|4640|4640| 			cmpObstruction.SetControlGroup(ent);
|4641|    |-	}
|    |4641|+	
|4642|4642| 
|4643|4643| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4644|4644| 	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
|4776|4776| 	// if we already had an old guard order, do nothing if the target is the same
|4777|4777| 	// and the order is running, otherwise remove the previous order
|4778|4778| 	if (this.isGuardOf)
|4779|    |-	{
|    |4779|+	
|4780|4780| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4781|4781| 			return;
|4782|4782| 		else
|4783|4783| 			this.RemoveGuard();
|4784|    |-	}
|    |4784|+	
|4785|4785| 
|4786|4786| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4787|4787| };
|    | [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
|4779|4779| 	{
|4780|4780| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4781|4781| 			return;
|4782|    |-		else
|4783|    |-			this.RemoveGuard();
|    |4782|+		this.RemoveGuard();
|4784|4783| 	}
|4785|4784| 
|4786|4785| 	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
|4950|4950| 			this.WalkToTarget(target, queued);
|4951|4951| 		return;
|4952|4952| 	}
|4953|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4953|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4954|4954| };
|4955|4955| 
|4956|4956| /**
|    | [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
|5099|5099| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5100|5100| 	{
|5101|5101| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5102|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5102|+		if (cmpTrader.HasBothMarkets() &&
|5103|5103| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5104|5104| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5105|5105| 		{
|    | [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
|5380|5380| 				{
|5381|5381| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5382|5382| 					var targetClasses = this.order.data.targetClasses;
|5383|    |-					if (targetClasses.attack && cmpIdentity
|5384|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5383|+					if (targetClasses.attack && cmpIdentity &&
|    |5384|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5385|5385| 						continue;
|5386|5386| 					if (targetClasses.avoid && cmpIdentity
|5387|5387| 						&& 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
|5383|5383| 					if (targetClasses.attack && cmpIdentity
|5384|5384| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5385|5385| 						continue;
|5386|    |-					if (targetClasses.avoid && cmpIdentity
|5387|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5386|+					if (targetClasses.avoid && cmpIdentity &&
|    |5387|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5388|5388| 						continue;
|5389|5389| 					// Only used by the AIs to prevent some choices of targets
|5390|5390| 					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
|5406|5406| 		{
|5407|5407| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5408|5408| 			var targetClasses = this.order.data.targetClasses;
|5409|    |-			if (cmpIdentity && targetClasses.attack
|5410|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5409|+			if (cmpIdentity && targetClasses.attack &&
|    |5410|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5411|5411| 				continue;
|5412|5412| 			if (cmpIdentity && targetClasses.avoid
|5413|5413| 				&& 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
|5409|5409| 			if (cmpIdentity && targetClasses.attack
|5410|5410| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5411|5411| 				continue;
|5412|    |-			if (cmpIdentity && targetClasses.avoid
|5413|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5412|+			if (cmpIdentity && targetClasses.avoid &&
|    |5413|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5414|5414| 				continue;
|5415|5415| 			// Only used by the AIs to prevent some choices of targets
|5416|5416| 			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
|5552|5552| 
|5553|5553| UnitAI.prototype.SetHeldPosition = function(x, z)
|5554|5554| {
|5555|    |-	this.heldPosition = {"x": x, "z": z};
|    |5555|+	this.heldPosition = { "x": x, "z": z};
|5556|5556| };
|5557|5557| 
|5558|5558| 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
|5552|5552| 
|5553|5553| UnitAI.prototype.SetHeldPosition = function(x, z)
|5554|5554| {
|5555|    |-	this.heldPosition = {"x": x, "z": z};
|    |5555|+	this.heldPosition = {"x": x, "z": z };
|5556|5556| };
|5557|5557| 
|5558|5558| 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
|5579|5579| 	return false;
|5580|5580| };
|5581|5581| 
|5582|    |-//// Helper functions ////
|    |5582|+// // Helper functions ////
|5583|5583| 
|5584|5584| UnitAI.prototype.CanAttack = function(target)
|5585|5585| {
|    | [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
|5783|5783| 	return cmpPack && cmpPack.IsPacking();
|5784|5784| };
|5785|5785| 
|5786|    |-//// Formation specific functions ////
|    |5786|+// // Formation specific functions ////
|5787|5787| 
|5788|5788| UnitAI.prototype.IsAttackingAsFormation = function()
|5789|5789| {
|    | [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
|5788|5788| UnitAI.prototype.IsAttackingAsFormation = function()
|5789|5789| {
|5790|5790| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5791|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5792|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5791|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5792|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5793|5793| };
|5794|5794| 
|5795|5795| //// 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
|5792|5792| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5793|5793| };
|5794|5794| 
|5795|    |-//// Animal specific functions ////
|    |5795|+// // Animal specific functions ////
|5796|5796| 
|5797|5797| UnitAI.prototype.MoveRandomly = function(distance)
|5798|5798| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 895| »   »   »   "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
| 920| »   »   »   "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
| 938| »   »   »   "leave":·function(msg)·{
|    | [NORMAL] ESLintBear (no-dupe-keys):
|    | Duplicate key 'leave'.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|1036| »   »   »   »   "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
|1074| »   »   »   "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
|1107| »   »   »   »   "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
|1320| »   »   »   "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
|1505| »   »   »   "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
|1525| »   »   »   "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
|1554| »   »   »   "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
|1708| »   »   »   "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
|1758| »   »   »   »   "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
|1844| »   »   »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|2016| »   »   »   »   "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
|2107| »   »   »   »   "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
|2290| »   »   »   »   »   »   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
|2345| »   »   »   »   "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
|2463| »   »   »   »   "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
|2528| »   »   »   »   "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
|2565| »   »   »   »   "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
|2774| »   »   »   »   "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
|2957| »   »   »   »   "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
|3689| »   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
|4490| »   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
|4505| »   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
|4551| »   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
|4574| »   »   ····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
|5030| »   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
| 358| »   »   ····&&·(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
| 938| »   »   »   "leave":·function(msg)·{
|    | [NORMAL] JSHintBear:
|    | Duplicate key 'leave'.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4189| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4283| »   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
|4339| »   »   »   &&·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
|4507| »   »   &&·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
|4508| »   »   &&·(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
|5030| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

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

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

This revision was not accepted when it landed; it landed in state Needs Review.Jun 5 2019, 10:44 PM
This revision was automatically updated to reflect the committed changes.