Page MenuHomeWildfire Games

Fix resource-returning (missed in rP22367 / from rP22313)
ClosedPublic

Authored by wraitii on Jun 15 2019, 4:15 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22374: Fix resource-returning order sometimes not working correctly (introduced by…
Summary

Thought I got all I've missed in rP22313 in rP22367, but as it turns our returning resources missed their interface.

I've quadruple-checked, and I haven't found any order that still remains buggy, but given my track record on this change, I could still be missing one.

The order did completely redundant things with the call so remove that duplication.

Test Plan

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 15 2019, 4:15 PM
wraitii updated this revision to Diff 8481.Jun 15 2019, 4:19 PM

Er actually removing stuff in the order was wrong since it might fail when we never moved, the correct approach is the one taken by D1876.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 515| 515| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 516| 516| 				}
| 517| 517| 				else
| 518|    |-				{
|    | 518|+				
| 519| 519| 					// We couldn't move there, or the target moved away
| 520| 520| 					this.FinishOrder();
| 521|    |-				}
|    | 521|+				
| 522| 522| 				return;
| 523| 523| 			}
| 524| 524| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 711| 711| 			}
| 712| 712| 			// Check if we are already in range, otherwise walk there
| 713| 713| 			if (!this.CheckGarrisonRange(msg.data.target))
| 714|    |-			{
|    | 714|+			
| 715| 715| 				if (!this.CheckTargetVisible(msg.data.target))
| 716| 716| 				{
| 717| 717| 					this.FinishOrder();
| 722| 722| 					this.SetNextState("GARRISON.APPROACHING");
| 723| 723| 					return;
| 724| 724| 				}
| 725|    |-			}
|    | 725|+			
| 726| 726| 
| 727| 727| 			this.SetNextState("GARRISON.GARRISONING");
| 728| 728| 		},
|    | [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
| 717| 717| 					this.FinishOrder();
| 718| 718| 					return;
| 719| 719| 				}
| 720|    |-				else
| 721|    |-				{
|    | 720|+				
| 722| 721| 					this.SetNextState("GARRISON.APPROACHING");
| 723| 722| 					return;
| 724|    |-				}
|    | 723|+				
| 725| 724| 			}
| 726| 725| 
| 727| 726| 			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
| 740| 740| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 741| 741| 					}
| 742| 742| 					else
| 743|    |-					{
|    | 743|+					
| 744| 744| 						// We couldn't move there, or the target moved away
| 745| 745| 						this.FinishOrder();
| 746|    |-					}
|    | 746|+					
| 747| 747| 					return;
| 748| 748| 				}
| 749| 749| 
|    | [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
| 973| 973| 			},
| 974| 974| 		},
| 975| 975| 
| 976|    |-		"GARRISON":{
|    | 976|+		"GARRISON": {
| 977| 977| 			"enter": function() {
| 978| 978| 				// If the garrisonholder should pickup, warn it so it can take needed action
| 979| 979| 				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
|1186|1186| 			// If the controller handled an order but some members rejected it,
|1187|1187| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1188|1188| 			if (this.orderQueue.length)
|1189|    |-			{
|    |1189|+			
|1190|1190| 				// We're leaving the formation, so stop our FormationWalk order
|1191|1191| 				if (this.FinishOrder())
|1192|1192| 					return;
|1193|    |-			}
|    |1193|+			
|1194|1194| 
|1195|1195| 			// No orders left, we're an individual now
|1196|1196| 			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
|1214|1214| 			// Move a tile outside the building
|1215|1215| 			let range = 4;
|1216|1216| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1217|    |-			{
|    |1217|+			
|1218|1218| 				// We are already at the target, or can't move at all
|1219|1219| 				this.FinishOrder();
|1220|    |-			}
|    |1220|+			
|1221|1221| 			else
|1222|1222| 			{
|1223|1223| 				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
|1435|1435| 
|1436|1436| 			"LosRangeUpdate": function(msg) {
|1437|1437| 				if (this.GetStance().targetVisibleEnemies)
|1438|    |-				{
|    |1438|+				
|1439|1439| 					// Start attacking one of the newly-seen enemy (if any)
|1440|1440| 					this.AttackEntitiesByPreference(msg.data.added);
|1441|    |-				}
|    |1441|+				
|1442|1442| 			},
|1443|1443| 
|1444|1444| 			"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
|1468|1468| 				this.SelectAnimation("move");
|1469|1469| 			},
|1470|1470| 
|1471|    |-			"leave": function () {
|    |1471|+			"leave": function() {
|1472|1472| 				this.SelectAnimation("idle");
|1473|1473| 				this.StopMoving();
|1474|1474| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1648|1648| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1649|1649| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1650|1650| 						if (cmpHealth && cmpHealth.IsInjured())
|1651|    |-						{
|    |1651|+						
|1652|1652| 							if (this.CanHeal(this.isGuardOf))
|1653|1653| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1654|1654| 							else if (this.CanRepair(this.isGuardOf))
|1655|1655| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1656|    |-						}
|    |1656|+						
|1657|1657| 					}
|1658|1658| 				},
|1659|1659| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1775|1775| 					}
|1776|1776| 					// Check the target is still alive and attackable
|1777|1777| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1778|    |-					{
|    |1778|+					
|1779|1779| 						// Can't reach it - try to chase after it
|1780|1780| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1781|1781| 						{
|1788|1788| 							this.SetNextState("COMBAT.CHASING");
|1789|1789| 							return true;
|1790|1790| 						}
|1791|    |-					}
|    |1791|+					
|1792|1792| 
|1793|1793| 					this.StopMoving();
|1794|1794| 
|    | [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
|1821|1821| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1822|1822| 
|1823|1823| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1824|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1824|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1825|1825| 
|1826|1826| 					this.FaceTowardsTarget(this.order.data.target);
|1827|1827| 
|    | [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
|1947|1947| 
|1948|1948| 				"Attacked": function(msg) {
|1949|1949| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1950|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1951|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1950|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1951|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1952|1952| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1953|1953| 				},
|1954|1954| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1967|1967| 					this.SelectAnimation("move");
|1968|1968| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1969|1969| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1970|    |-					{
|    |1970|+					
|1971|1971| 						// Run after a fleeing target
|1972|1972| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|1973|    |-					}
|    |1973|+					
|1974|1974| 					this.StartTimer(1000, 1000);
|1975|1975| 				},
|1976|1976| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2149|2149| 
|2150|2150| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2151|2151| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2152|    |-					{
|    |2152|+					
|2153|2153| 						// Check we can still reach and gather from the target
|2154|2154| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2155|2155| 						{
|2200|2200| 								return;
|2201|2201| 							}
|2202|2202| 						}
|2203|    |-					}
|    |2203|+					
|2204|2204| 
|2205|2205| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2206|2206| 
|    | [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
|2192|2192| 								return;
|2193|2193| 						}
|2194|2194| 						else
|2195|    |-						{
|    |2195|+						
|2196|2196| 							// Try to follow the target
|2197|2197| 							if (this.MoveToTargetRange(this.gatheringTarget, IID_ResourceGatherer))
|2198|2198| 							{
|2199|2199| 								this.SetNextState("APPROACHING");
|2200|2200| 								return;
|2201|2201| 							}
|2202|    |-						}
|    |2202|+						
|2203|2203| 					}
|2204|2204| 
|2205|2205| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|    | [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
|2226|2226| 					// Also don't switch to a different type of huntable animal
|2227|2227| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2228|2228| 						return (
|2229|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2230|    |-							|| (type.specific == resourceType.specific
|    |2229|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2230|+							(type.specific == resourceType.specific
|2231|2231| 							&& (type.specific != "meat" || resourceTemplate == template))
|2232|2232| 						);
|2233|2233| 					});
|    | [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
|2227|2227| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2228|2228| 						return (
|2229|2229| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2230|    |-							|| (type.specific == resourceType.specific
|2231|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2230|+							|| (type.specific == resourceType.specific &&
|    |2231|+							(type.specific != "meat" || resourceTemplate == template))
|2232|2232| 						);
|2233|2233| 					});
|2234|2234| 					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
|2292|2292| 
|2293|2293| 				"Timer": function(msg) {
|2294|2294| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2295|    |-					{
|    |2295|+					
|2296|2296| 						// Return to our original position unless we have a better order.
|2297|2297| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2298|2298| 							this.WalkToHeldPosition();
|2299|    |-					}
|    |2299|+					
|2300|2300| 				},
|2301|2301| 
|2302|2302| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2326|2326| 					this.StartTimer(prepare, this.healTimers.repeat);
|2327|2327| 
|2328|2328| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2329|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2329|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2330|2330| 
|2331|2331| 					this.FaceTowardsTarget(this.order.data.target);
|2332|2332| 				},
|    | [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
|2539|2539| 					{
|2540|2540| 						// The building was already finished/fully repaired before we arrived;
|2541|2541| 						// let the ConstructionFinished handler handle this.
|2542|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2542|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2543|2543| 						return true;
|2544|2544| 					}
|2545|2545| 
|    | [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
|2539|2539| 					{
|2540|2540| 						// The building was already finished/fully repaired before we arrived;
|2541|2541| 						// let the ConstructionFinished handler handle this.
|2542|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2542|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2543|2543| 						return true;
|2544|2544| 					}
|2545|2545| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2666|2666| 
|2667|2667| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2668|2668| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2669|    |-				{
|    |2669|+				
|2670|2670| 					// We're already walking to the given point, so add this as a order.
|2671|2671| 					this.WalkToTarget(msg.data.newentity, true);
|2672|    |-				}
|    |2672|+				
|2673|2673| 			},
|2674|2674| 		},
|2675|2675| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2729|2729| 
|2730|2730| 					// Check that we can garrison here
|2731|2731| 					if (this.CanGarrison(target))
|2732|    |-					{
|    |2732|+					
|2733|2733| 						// Check that we're in range of the garrison target
|2734|2734| 						if (this.CheckGarrisonRange(target))
|2735|2735| 						{
|2805|2805| 								return false;
|2806|2806| 							}
|2807|2807| 						}
|2808|    |-					}
|    |2808|+					
|2809|2809| 					// Garrisoning failed for some reason, so finish the order
|2810|2810| 					this.FinishOrder();
|2811|2811| 					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
|2927|2927| 		"Attacked": function(msg) {
|2928|2928| 			if (this.template.NaturalBehaviour == "skittish" ||
|2929|2929| 			    this.template.NaturalBehaviour == "passive")
|2930|    |-			{
|    |2930|+			
|2931|2931| 				this.Flee(msg.data.attacker, false);
|2932|    |-			}
|    |2932|+			
|2933|2933| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2934|2934| 			{
|2935|2935| 				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
|2936|2936| 					this.Attack(msg.data.attacker, false);
|2937|2937| 			}
|2938|2938| 			else if (this.template.NaturalBehaviour == "domestic")
|2939|    |-			{
|    |2939|+			
|2940|2940| 				// Never flee, stop what we were doing
|2941|2941| 				this.SetNextState("IDLE");
|2942|    |-			}
|    |2942|+			
|2943|2943| 		},
|2944|2944| 
|2945|2945| 		"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
|2950|2950| 				this.FinishOrder();
|2951|2951| 				return;
|2952|2952| 			}
|2953|    |-			else
|2954|    |-			{
|    |2953|+			
|2955|2954| 				this.order.data.min = range;
|2956|2955| 				this.SetNextState("WALKING");
|2957|    |-			}
|    |2956|+			
|2958|2957| 		},
|2959|2958| 
|2960|2959| 		"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
|2994|2994| 				}
|2995|2995| 				// Start attacking one of the newly-seen enemy (if any)
|2996|2996| 				else if (this.IsDangerousAnimal())
|2997|    |-				{
|    |2997|+				
|2998|2998| 					this.AttackVisibleEntity(msg.data.added);
|2999|    |-				}
|    |2999|+				
|3000|3000| 
|3001|3001| 				// TODO: if two units enter our range together, we'll attack the
|3002|3002| 				// 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
|3037|3037| 				}
|3038|3038| 				// Start attacking one of the newly-seen enemy (if any)
|3039|3039| 				else if (this.template.NaturalBehaviour == "violent")
|3040|    |-				{
|    |3040|+				
|3041|3041| 					this.AttackVisibleEntity(msg.data.added);
|3042|    |-				}
|    |3042|+				
|3043|3043| 			},
|3044|3044| 
|3045|3045| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3052|3052| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3053|3053| 
|3054|3054| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3055|    |-							// only used for domestic animals
|    |3055|+		// only used for domestic animals
|3056|3056| 	},
|3057|3057| };
|3058|3058| 
|    | [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
|3109|3109| 
|3110|3110| UnitAI.prototype.IsAnimal = function()
|3111|3111| {
|3112|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3112|+	return (!!this.template.NaturalBehaviour);
|3113|3113| };
|3114|3114| 
|3115|3115| 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
|3147|3147| UnitAI.prototype.GetGarrisonHolder = function()
|3148|3148| {
|3149|3149| 	if (this.IsGarrisoned())
|3150|    |-	{
|    |3150|+	
|3151|3151| 		for (let order of this.orderQueue)
|3152|3152| 			if (order.type == "Garrison")
|3153|3153| 				return order.data.target;
|3154|    |-	}
|    |3154|+	
|3155|3155| 	return INVALID_ENTITY;
|3156|3156| };
|3157|3157| 
|    | [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
|3225|3225| 		{
|3226|3226| 			let index = this.GetCurrentState().indexOf(".");
|3227|3227| 			if (index != -1)
|3228|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3228|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3229|3229| 			this.Stop(false);
|3230|3230| 		}
|3231|3231| 
|    | [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
|3281|3281| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3282|3282| 			continue;
|3283|3283| 		if (i == 0)
|3284|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3284|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3285|3285| 		else
|3286|3286| 			this.orderQueue.splice(i, 1);
|3287|3287| 		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
|3281|3281| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3282|3282| 			continue;
|3283|3283| 		if (i == 0)
|3284|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3284|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3285|3285| 		else
|3286|3286| 			this.orderQueue.splice(i, 1);
|3287|3287| 		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
|3365|3365| };
|3366|3366| 
|3367|3367| 
|3368|    |-//// FSM linkage functions ////
|    |3368|+// // FSM linkage functions ////
|3369|3369| 
|3370|3370| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3371|3371| 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
|3537|3537| 				continue;
|3538|3538| 			if (this.orderQueue[i].type == type)
|3539|3539| 				continue;
|3540|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3540|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3541|3541| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3542|3542| 			return;
|3543|3543| 		}
|    | [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
|3537|3537| 				continue;
|3538|3538| 			if (this.orderQueue[i].type == type)
|3539|3539| 				continue;
|3540|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3540|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3541|3541| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3542|3542| 			return;
|3543|3543| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3551|3551| {
|3552|3552| 	// Remember the previous work orders to be able to go back to them later if required
|3553|3553| 	if (data && data.force)
|3554|    |-	{
|    |3554|+	
|3555|3555| 		if (this.IsFormationController())
|3556|3556| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3557|3557| 		else
|3558|3558| 			this.UpdateWorkOrders(type);
|3559|    |-	}
|    |3559|+	
|3560|3560| 
|3561|3561| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3562|3562| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/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| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3630|3630| 		if (cmpUnitAI)
|3631|    |-		{
|    |3631|+		
|3632|3632| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3633|3633| 			{
|3634|3634| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3637|3637| 					return;
|3638|3638| 				}
|3639|3639| 			}
|3640|    |-		}
|    |3640|+		
|3641|3641| 	}
|3642|3642| 
|3643|3643| 	// 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
|3630|3630| 		if (cmpUnitAI)
|3631|3631| 		{
|3632|3632| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3633|    |-			{
|    |3633|+			
|3634|3634| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3635|3635| 				{
|3636|3636| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3637|3637| 					return;
|3638|3638| 				}
|3639|    |-			}
|    |3639|+			
|3640|3640| 		}
|3641|3641| 	}
|3642|3642| 
|    | [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
|3642|3642| 
|3643|3643| 	// If nothing found, take the unit orders
|3644|3644| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3645|    |-	{
|    |3645|+	
|3646|3646| 		if (isWorkType(this.orderQueue[i].type))
|3647|3647| 		{
|3648|3648| 			this.workOrders = this.orderQueue.slice(i);
|3649|3649| 			return;
|3650|3650| 		}
|3651|    |-	}
|    |3651|+	
|3652|3652| };
|3653|3653| 
|3654|3654| 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
|3708|3708| 	if (data.timerRepeat === undefined)
|3709|3709| 		this.timer = undefined;
|3710|3710| 
|3711|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3711|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3712|3712| };
|3713|3713| 
|3714|3714| /**
|    | [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
|3708|3708| 	if (data.timerRepeat === undefined)
|3709|3709| 		this.timer = undefined;
|3710|3710| 
|3711|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3711|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3712|3712| };
|3713|3713| 
|3714|3714| /**
|    | [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
|3743|3743| 	this.timer = undefined;
|3744|3744| };
|3745|3745| 
|3746|    |-//// Message handlers /////
|    |3746|+// // Message handlers /////
|3747|3747| 
|3748|3748| UnitAI.prototype.OnMotionChanged = function(msg)
|3749|3749| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3755|3755| 	// TODO: This is a bit inefficient since every unit listens to every
|3756|3756| 	// construction message - ideally we could scope it to only the one we're building
|3757|3757| 
|3758|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3758|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3759|3759| };
|3760|3760| 
|3761|3761| 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
|3755|3755| 	// TODO: This is a bit inefficient since every unit listens to every
|3756|3756| 	// construction message - ideally we could scope it to only the one we're building
|3757|3757| 
|3758|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3758|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3759|3759| };
|3760|3760| 
|3761|3761| 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
|3780|3780| 
|3781|3781| UnitAI.prototype.OnAttacked = function(msg)
|3782|3782| {
|3783|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3783|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3784|3784| };
|3785|3785| 
|3786|3786| 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
|3780|3780| 
|3781|3781| UnitAI.prototype.OnAttacked = function(msg)
|3782|3782| {
|3783|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3783|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3784|3784| };
|3785|3785| 
|3786|3786| 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
|3785|3785| 
|3786|3786| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3787|3787| {
|3788|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3788|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3789|3789| };
|3790|3790| 
|3791|3791| 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
|3785|3785| 
|3786|3786| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3787|3787| {
|3788|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3788|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3789|3789| };
|3790|3790| 
|3791|3791| 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
|3790|3790| 
|3791|3791| UnitAI.prototype.OnHealthChanged = function(msg)
|3792|3792| {
|3793|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3793|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3794|3794| };
|3795|3795| 
|3796|3796| 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
|3790|3790| 
|3791|3791| UnitAI.prototype.OnHealthChanged = function(msg)
|3792|3792| {
|3793|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3793|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3794|3794| };
|3795|3795| 
|3796|3796| 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
|3796|3796| UnitAI.prototype.OnRangeUpdate = function(msg)
|3797|3797| {
|3798|3798| 	if (msg.tag == this.losRangeQuery)
|3799|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3799|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3800|3800| 	else if (msg.tag == this.losHealRangeQuery)
|3801|3801| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3802|3802| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3796|3796| UnitAI.prototype.OnRangeUpdate = function(msg)
|3797|3797| {
|3798|3798| 	if (msg.tag == this.losRangeQuery)
|3799|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3799|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3800|3800| 	else if (msg.tag == this.losHealRangeQuery)
|3801|3801| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3802|3802| };
|    | [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
|3798|3798| 	if (msg.tag == this.losRangeQuery)
|3799|3799| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3800|3800| 	else if (msg.tag == this.losHealRangeQuery)
|3801|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3801|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3802|3802| };
|3803|3803| 
|3804|3804| 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
|3798|3798| 	if (msg.tag == this.losRangeQuery)
|3799|3799| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3800|3800| 	else if (msg.tag == this.losHealRangeQuery)
|3801|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3801|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3802|3802| };
|3803|3803| 
|3804|3804| 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
|3803|3803| 
|3804|3804| UnitAI.prototype.OnPackFinished = function(msg)
|3805|3805| {
|3806|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3806|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3807|3807| };
|3808|3808| 
|3809|3809| //// 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
|3803|3803| 
|3804|3804| UnitAI.prototype.OnPackFinished = function(msg)
|3805|3805| {
|3806|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3806|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3807|3807| };
|3808|3808| 
|3809|3809| //// 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
|3806|3806| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3807|3807| };
|3808|3808| 
|3809|    |-//// Helper functions to be called by the FSM ////
|    |3809|+// // Helper functions to be called by the FSM ////
|3810|3810| 
|3811|3811| UnitAI.prototype.GetWalkSpeed = function()
|3812|3812| {
|    | [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
|3908|3908| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3909|3909| 		return undefined;
|3910|3910| 
|3911|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3911|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3912|3912| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3913|3913| 		return undefined;
|3914|3914| 
|    | [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
|3993|3993| 			PlaySound(name, member);
|3994|3994| 	}
|3995|3995| 	else
|3996|    |-	{
|    |3996|+	
|3997|3997| 		// Otherwise use our own sounds
|3998|3998| 		PlaySound(name, this.entity);
|3999|    |-	}
|    |3999|+	
|4000|4000| };
|4001|4001| 
|4002|4002| /*
|    | [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
|4185|4185| 	else
|4186|4186| 		// return false? Or hope you come close enough?
|4187|4187| 		var parabolicMaxRange = 0;
|4188|    |-		//return false;
|    |4188|+		// return false;
|4189|4189| 
|4190|4190| 	// the parabole changes while walking, take something in the middle
|4191|4191| 	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
|4272|4272| 	if (this.IsFormationMember())
|4273|4273| 	{
|4274|4274| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4275|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4276|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4275|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4276|+			cmpFormationUnitAI.order.data.target == target)
|4277|4277| 			return true;
|4278|4278| 	}
|4279|4279| 
|    | [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
|4440|4440| UnitAI.prototype.AttackEntityInZone = function(ents)
|4441|4441| {
|4442|4442| 	var target = ents.find(target =>
|4443|    |-		this.CanAttack(target)
|4444|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4443|+		this.CanAttack(target) &&
|    |4444|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4445|4445| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4446|4446| 	);
|4447|4447| 	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
|4441|4441| {
|4442|4442| 	var target = ents.find(target =>
|4443|4443| 		this.CanAttack(target)
|4444|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4445|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4444|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4445|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4446|4446| 	);
|4447|4447| 	if (!target)
|4448|4448| 		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
|4505|4505| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4506|4506| 	if (this.isGuardOf)
|4507|4507| 	{
|4508|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4508|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4509|4509| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4510|4510| 		if (cmpUnitAI && cmpAttack &&
|4511|4511| 		    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
|4509|4509| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4510|4510| 		if (cmpUnitAI && cmpAttack &&
|4511|4511| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4512|    |-				return false;
|    |4512|+			return false;
|4513|4513| 	}
|4514|4514| 
|4515|4515| 	// 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
|4514|4514| 
|4515|4515| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4516|4516| 	if (this.GetStance().respondHoldGround)
|4517|    |-	{
|    |4517|+	
|4518|4518| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4519|4519| 			return true;
|4520|    |-	}
|    |4520|+	
|4521|4521| 
|4522|4522| 	// Stop if it's left our vision range, unless we're especially persistent
|4523|4523| 	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
|4521|4521| 
|4522|4522| 	// Stop if it's left our vision range, unless we're especially persistent
|4523|4523| 	if (!this.GetStance().respondChaseBeyondVision)
|4524|    |-	{
|    |4524|+	
|4525|4525| 		if (!this.CheckTargetIsInVisionRange(target))
|4526|4526| 			return true;
|4527|    |-	}
|    |4527|+	
|4528|4528| 
|4529|4529| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4530|4530| 	// 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
|4547|4547| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4548|4548| 	if (this.isGuardOf)
|4549|4549| 	{
|4550|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4550|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4551|4551| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4552|4552| 		if (cmpUnitAI && cmpAttack &&
|4553|4553| 		    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
|4560|4560| 	return false;
|4561|4561| };
|4562|4562| 
|4563|    |-//// External interface functions ////
|    |4563|+// // External interface functions ////
|4564|4564| 
|4565|4565| UnitAI.prototype.SetFormationController = function(ent)
|4566|4566| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4570|4570| 	// of our own formation (or ourself if not in formation)
|4571|4571| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4572|4572| 	if (cmpObstruction)
|4573|    |-	{
|    |4573|+	
|4574|4574| 		if (ent == INVALID_ENTITY)
|4575|4575| 			cmpObstruction.SetControlGroup(this.entity);
|4576|4576| 		else
|4577|4577| 			cmpObstruction.SetControlGroup(ent);
|4578|    |-	}
|    |4578|+	
|4579|4579| 
|4580|4580| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4581|4581| 	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
|4713|4713| 	// if we already had an old guard order, do nothing if the target is the same
|4714|4714| 	// and the order is running, otherwise remove the previous order
|4715|4715| 	if (this.isGuardOf)
|4716|    |-	{
|    |4716|+	
|4717|4717| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4718|4718| 			return;
|4719|4719| 		else
|4720|4720| 			this.RemoveGuard();
|4721|    |-	}
|    |4721|+	
|4722|4722| 
|4723|4723| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4724|4724| };
|    | [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
|4716|4716| 	{
|4717|4717| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4718|4718| 			return;
|4719|    |-		else
|4720|    |-			this.RemoveGuard();
|    |4719|+		this.RemoveGuard();
|4721|4720| 	}
|4722|4721| 
|4723|4722| 	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
|4887|4887| 			this.WalkToTarget(target, queued);
|4888|4888| 		return;
|4889|4889| 	}
|4890|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4890|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4891|4891| };
|4892|4892| 
|4893|4893| /**
|    | [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
|5036|5036| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5037|5037| 	{
|5038|5038| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5039|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5039|+		if (cmpTrader.HasBothMarkets() &&
|5040|5040| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5041|5041| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5042|5042| 		{
|    | [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
|5317|5317| 				{
|5318|5318| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5319|5319| 					var targetClasses = this.order.data.targetClasses;
|5320|    |-					if (targetClasses.attack && cmpIdentity
|5321|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5320|+					if (targetClasses.attack && cmpIdentity &&
|    |5321|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5322|5322| 						continue;
|5323|5323| 					if (targetClasses.avoid && cmpIdentity
|5324|5324| 						&& 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
|5320|5320| 					if (targetClasses.attack && cmpIdentity
|5321|5321| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5322|5322| 						continue;
|5323|    |-					if (targetClasses.avoid && cmpIdentity
|5324|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5323|+					if (targetClasses.avoid && cmpIdentity &&
|    |5324|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5325|5325| 						continue;
|5326|5326| 					// Only used by the AIs to prevent some choices of targets
|5327|5327| 					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
|5343|5343| 		{
|5344|5344| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5345|5345| 			var targetClasses = this.order.data.targetClasses;
|5346|    |-			if (cmpIdentity && targetClasses.attack
|5347|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5346|+			if (cmpIdentity && targetClasses.attack &&
|    |5347|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5348|5348| 				continue;
|5349|5349| 			if (cmpIdentity && targetClasses.avoid
|5350|5350| 				&& 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
|5346|5346| 			if (cmpIdentity && targetClasses.attack
|5347|5347| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5348|5348| 				continue;
|5349|    |-			if (cmpIdentity && targetClasses.avoid
|5350|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5349|+			if (cmpIdentity && targetClasses.avoid &&
|    |5350|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5351|5351| 				continue;
|5352|5352| 			// Only used by the AIs to prevent some choices of targets
|5353|5353| 			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
|5489|5489| 
|5490|5490| UnitAI.prototype.SetHeldPosition = function(x, z)
|5491|5491| {
|5492|    |-	this.heldPosition = {"x": x, "z": z};
|    |5492|+	this.heldPosition = { "x": x, "z": z};
|5493|5493| };
|5494|5494| 
|5495|5495| 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
|5489|5489| 
|5490|5490| UnitAI.prototype.SetHeldPosition = function(x, z)
|5491|5491| {
|5492|    |-	this.heldPosition = {"x": x, "z": z};
|    |5492|+	this.heldPosition = {"x": x, "z": z };
|5493|5493| };
|5494|5494| 
|5495|5495| 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
|5516|5516| 	return false;
|5517|5517| };
|5518|5518| 
|5519|    |-//// Helper functions ////
|    |5519|+// // Helper functions ////
|5520|5520| 
|5521|5521| UnitAI.prototype.CanAttack = function(target)
|5522|5522| {
|    | [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
|5720|5720| 	return cmpPack && cmpPack.IsPacking();
|5721|5721| };
|5722|5722| 
|5723|    |-//// Formation specific functions ////
|    |5723|+// // Formation specific functions ////
|5724|5724| 
|5725|5725| UnitAI.prototype.IsAttackingAsFormation = function()
|5726|5726| {
|    | [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
|5725|5725| UnitAI.prototype.IsAttackingAsFormation = function()
|5726|5726| {
|5727|5727| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5728|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5729|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5728|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5729|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5730|5730| };
|5731|5731| 
|5732|5732| //// 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
|5729|5729| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5730|5730| };
|5731|5731| 
|5732|    |-//// Animal specific functions ////
|    |5732|+// // Animal specific functions ////
|5733|5733| 
|5734|5734| UnitAI.prototype.MoveRandomly = function(distance)
|5735|5735| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 866| »   »   »   "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
| 888| »   »   »   "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
| 935| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 998| »   »   »   »   "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
|1033| »   »   »   "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
|1065| »   »   »   »   "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
|1279| »   »   »   "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
|1462| »   »   »   "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
|1483| »   »   »   "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
|1513| »   »   »   "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
|1668| »   »   »   "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
|1719| »   »   »   »   "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
|1789| »   »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2494| »   »   »   »   "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
|2698| »   »   »   »   "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
|2882| »   »   »   »   "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
|3613| »   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
|4427| »   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
|4442| »   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
|4488| »   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
|4511| »   »   ····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
|4967| »   var·lastPos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4198| »   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
|4276| »   »   »   &&·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
|4444| »   »   &&·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
|4445| »   »   &&·(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
|4967| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 515| 515| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 516| 516| 				}
| 517| 517| 				else
| 518|    |-				{
|    | 518|+				
| 519| 519| 					// We couldn't move there, or the target moved away
| 520| 520| 					this.FinishOrder();
| 521|    |-				}
|    | 521|+				
| 522| 522| 				return;
| 523| 523| 			}
| 524| 524| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 730| 730| 			}
| 731| 731| 			// Check if we are already in range, otherwise walk there
| 732| 732| 			if (!this.CheckGarrisonRange(msg.data.target))
| 733|    |-			{
|    | 733|+			
| 734| 734| 				if (!this.CheckTargetVisible(msg.data.target))
| 735| 735| 				{
| 736| 736| 					this.FinishOrder();
| 741| 741| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 742| 					return;
| 743| 743| 				}
| 744|    |-			}
|    | 744|+			
| 745| 745| 
| 746| 746| 			this.SetNextState("GARRISON.GARRISONING");
| 747| 747| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 					this.FinishOrder();
| 737| 737| 					return;
| 738| 738| 				}
| 739|    |-				else
| 740|    |-				{
|    | 739|+				
| 741| 740| 					this.SetNextState("GARRISON.APPROACHING");
| 742| 741| 					return;
| 743|    |-				}
|    | 742|+				
| 744| 743| 			}
| 745| 744| 
| 746| 745| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 759| 759| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 760| 760| 					}
| 761| 761| 					else
| 762|    |-					{
|    | 762|+					
| 763| 763| 						// We couldn't move there, or the target moved away
| 764| 764| 						this.FinishOrder();
| 765|    |-					}
|    | 765|+					
| 766| 766| 					return;
| 767| 767| 				}
| 768| 768| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 992| 992| 			},
| 993| 993| 		},
| 994| 994| 
| 995|    |-		"GARRISON":{
|    | 995|+		"GARRISON": {
| 996| 996| 			"enter": function() {
| 997| 997| 				// If the garrisonholder should pickup, warn it so it can take needed action
| 998| 998| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1205|1205| 			// If the controller handled an order but some members rejected it,
|1206|1206| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1207|1207| 			if (this.orderQueue.length)
|1208|    |-			{
|    |1208|+			
|1209|1209| 				// We're leaving the formation, so stop our FormationWalk order
|1210|1210| 				if (this.FinishOrder())
|1211|1211| 					return;
|1212|    |-			}
|    |1212|+			
|1213|1213| 
|1214|1214| 			// No orders left, we're an individual now
|1215|1215| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1233|1233| 			// Move a tile outside the building
|1234|1234| 			let range = 4;
|1235|1235| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, range))
|1236|    |-			{
|    |1236|+			
|1237|1237| 				// We are already at the target, or can't move at all
|1238|1238| 				this.FinishOrder();
|1239|    |-			}
|    |1239|+			
|1240|1240| 			else
|1241|1241| 			{
|1242|1242| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1454|1454| 
|1455|1455| 			"LosRangeUpdate": function(msg) {
|1456|1456| 				if (this.GetStance().targetVisibleEnemies)
|1457|    |-				{
|    |1457|+				
|1458|1458| 					// Start attacking one of the newly-seen enemy (if any)
|1459|1459| 					this.AttackEntitiesByPreference(msg.data.added);
|1460|    |-				}
|    |1460|+				
|1461|1461| 			},
|1462|1462| 
|1463|1463| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1487|1487| 				this.SelectAnimation("move");
|1488|1488| 			},
|1489|1489| 
|1490|    |-			"leave": function () {
|    |1490|+			"leave": function() {
|1491|1491| 				this.SelectAnimation("idle");
|1492|1492| 				this.StopMoving();
|1493|1493| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1667|1667| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1668|1668| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1669|1669| 						if (cmpHealth && cmpHealth.IsInjured())
|1670|    |-						{
|    |1670|+						
|1671|1671| 							if (this.CanHeal(this.isGuardOf))
|1672|1672| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1673|1673| 							else if (this.CanRepair(this.isGuardOf))
|1674|1674| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1675|    |-						}
|    |1675|+						
|1676|1676| 					}
|1677|1677| 				},
|1678|1678| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1794|1794| 					}
|1795|1795| 					// Check the target is still alive and attackable
|1796|1796| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1797|    |-					{
|    |1797|+					
|1798|1798| 						// Can't reach it - try to chase after it
|1799|1799| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1800|1800| 						{
|1807|1807| 							this.SetNextState("COMBAT.CHASING");
|1808|1808| 							return true;
|1809|1809| 						}
|1810|    |-					}
|    |1810|+					
|1811|1811| 
|1812|1812| 					this.StopMoving();
|1813|1813| 
|    | [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
|1840|1840| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1841|1841| 
|1842|1842| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1843|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1843|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1844|1844| 
|1845|1845| 					this.FaceTowardsTarget(this.order.data.target);
|1846|1846| 
|    | [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
|1966|1966| 
|1967|1967| 				"Attacked": function(msg) {
|1968|1968| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1969|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1970|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1969|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1970|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1971|1971| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1972|1972| 				},
|1973|1973| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1986|1986| 					this.SelectAnimation("move");
|1987|1987| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1988|1988| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1989|    |-					{
|    |1989|+					
|1990|1990| 						// Run after a fleeing target
|1991|1991| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|1992|    |-					}
|    |1992|+					
|1993|1993| 					this.StartTimer(1000, 1000);
|1994|1994| 				},
|1995|1995| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2168|2168| 
|2169|2169| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2170|2170| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2171|    |-					{
|    |2171|+					
|2172|2172| 						// Check we can still reach and gather from the target
|2173|2173| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2174|2174| 						{
|2219|2219| 								return;
|2220|2220| 							}
|2221|2221| 						}
|2222|    |-					}
|    |2222|+					
|2223|2223| 
|2224|2224| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2225|2225| 
|    | [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
|2211|2211| 								return;
|2212|2212| 						}
|2213|2213| 						else
|2214|    |-						{
|    |2214|+						
|2215|2215| 							// Try to follow the target
|2216|2216| 							if (this.MoveToTargetRange(this.gatheringTarget, IID_ResourceGatherer))
|2217|2217| 							{
|2218|2218| 								this.SetNextState("APPROACHING");
|2219|2219| 								return;
|2220|2220| 							}
|2221|    |-						}
|    |2221|+						
|2222|2222| 					}
|2223|2223| 
|2224|2224| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|    | [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
|2245|2245| 					// Also don't switch to a different type of huntable animal
|2246|2246| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2247|2247| 						return (
|2248|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2249|    |-							|| (type.specific == resourceType.specific
|    |2248|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2249|+							(type.specific == resourceType.specific
|2250|2250| 							&& (type.specific != "meat" || resourceTemplate == template))
|2251|2251| 						);
|2252|2252| 					});
|    | [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
|2246|2246| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2247|2247| 						return (
|2248|2248| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2249|    |-							|| (type.specific == resourceType.specific
|2250|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2249|+							|| (type.specific == resourceType.specific &&
|    |2250|+							(type.specific != "meat" || resourceTemplate == template))
|2251|2251| 						);
|2252|2252| 					});
|2253|2253| 					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
|2311|2311| 
|2312|2312| 				"Timer": function(msg) {
|2313|2313| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2314|    |-					{
|    |2314|+					
|2315|2315| 						// Return to our original position unless we have a better order.
|2316|2316| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2317|2317| 							this.WalkToHeldPosition();
|2318|    |-					}
|    |2318|+					
|2319|2319| 				},
|2320|2320| 
|2321|2321| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2345|2345| 					this.StartTimer(prepare, this.healTimers.repeat);
|2346|2346| 
|2347|2347| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2348|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2348|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2349|2349| 
|2350|2350| 					this.FaceTowardsTarget(this.order.data.target);
|2351|2351| 				},
|    | [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
|2558|2558| 					{
|2559|2559| 						// The building was already finished/fully repaired before we arrived;
|2560|2560| 						// let the ConstructionFinished handler handle this.
|2561|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2561|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2562|2562| 						return true;
|2563|2563| 					}
|2564|2564| 
|    | [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
|2558|2558| 					{
|2559|2559| 						// The building was already finished/fully repaired before we arrived;
|2560|2560| 						// let the ConstructionFinished handler handle this.
|2561|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2561|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2562|2562| 						return true;
|2563|2563| 					}
|2564|2564| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2685|2685| 
|2686|2686| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2687|2687| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2688|    |-				{
|    |2688|+				
|2689|2689| 					// We're already walking to the given point, so add this as a order.
|2690|2690| 					this.WalkToTarget(msg.data.newentity, true);
|2691|    |-				}
|    |2691|+				
|2692|2692| 			},
|2693|2693| 		},
|2694|2694| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2748|2748| 
|2749|2749| 					// Check that we can garrison here
|2750|2750| 					if (this.CanGarrison(target))
|2751|    |-					{
|    |2751|+					
|2752|2752| 						// Check that we're in range of the garrison target
|2753|2753| 						if (this.CheckGarrisonRange(target))
|2754|2754| 						{
|2824|2824| 								return false;
|2825|2825| 							}
|2826|2826| 						}
|2827|    |-					}
|    |2827|+					
|2828|2828| 					// Garrisoning failed for some reason, so finish the order
|2829|2829| 					this.FinishOrder();
|2830|2830| 					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
|2946|2946| 		"Attacked": function(msg) {
|2947|2947| 			if (this.template.NaturalBehaviour == "skittish" ||
|2948|2948| 			    this.template.NaturalBehaviour == "passive")
|2949|    |-			{
|    |2949|+			
|2950|2950| 				this.Flee(msg.data.attacker, false);
|2951|    |-			}
|    |2951|+			
|2952|2952| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2953|2953| 			{
|2954|2954| 				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
|2955|2955| 					this.Attack(msg.data.attacker, false);
|2956|2956| 			}
|2957|2957| 			else if (this.template.NaturalBehaviour == "domestic")
|2958|    |-			{
|    |2958|+			
|2959|2959| 				// Never flee, stop what we were doing
|2960|2960| 				this.SetNextState("IDLE");
|2961|    |-			}
|    |2961|+			
|2962|2962| 		},
|2963|2963| 
|2964|2964| 		"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
|2969|2969| 				this.FinishOrder();
|2970|2970| 				return;
|2971|2971| 			}
|2972|    |-			else
|2973|    |-			{
|    |2972|+			
|2974|2973| 				this.order.data.min = range;
|2975|2974| 				this.SetNextState("WALKING");
|2976|    |-			}
|    |2975|+			
|2977|2976| 		},
|2978|2977| 
|2979|2978| 		"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
|3013|3013| 				}
|3014|3014| 				// Start attacking one of the newly-seen enemy (if any)
|3015|3015| 				else if (this.IsDangerousAnimal())
|3016|    |-				{
|    |3016|+				
|3017|3017| 					this.AttackVisibleEntity(msg.data.added);
|3018|    |-				}
|    |3018|+				
|3019|3019| 
|3020|3020| 				// TODO: if two units enter our range together, we'll attack the
|3021|3021| 				// 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
|3056|3056| 				}
|3057|3057| 				// Start attacking one of the newly-seen enemy (if any)
|3058|3058| 				else if (this.template.NaturalBehaviour == "violent")
|3059|    |-				{
|    |3059|+				
|3060|3060| 					this.AttackVisibleEntity(msg.data.added);
|3061|    |-				}
|    |3061|+				
|3062|3062| 			},
|3063|3063| 
|3064|3064| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3071|3071| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3072|3072| 
|3073|3073| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3074|    |-							// only used for domestic animals
|    |3074|+		// only used for domestic animals
|3075|3075| 	},
|3076|3076| };
|3077|3077| 
|    | [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
|3128|3128| 
|3129|3129| UnitAI.prototype.IsAnimal = function()
|3130|3130| {
|3131|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3131|+	return (!!this.template.NaturalBehaviour);
|3132|3132| };
|3133|3133| 
|3134|3134| 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
|3166|3166| UnitAI.prototype.GetGarrisonHolder = function()
|3167|3167| {
|3168|3168| 	if (this.IsGarrisoned())
|3169|    |-	{
|    |3169|+	
|3170|3170| 		for (let order of this.orderQueue)
|3171|3171| 			if (order.type == "Garrison")
|3172|3172| 				return order.data.target;
|3173|    |-	}
|    |3173|+	
|3174|3174| 	return INVALID_ENTITY;
|3175|3175| };
|3176|3176| 
|    | [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
|3244|3244| 		{
|3245|3245| 			let index = this.GetCurrentState().indexOf(".");
|3246|3246| 			if (index != -1)
|3247|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3247|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3248|3248| 			this.Stop(false);
|3249|3249| 		}
|3250|3250| 
|    | [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
|3300|3300| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3301|3301| 			continue;
|3302|3302| 		if (i == 0)
|3303|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3303|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3304|3304| 		else
|3305|3305| 			this.orderQueue.splice(i, 1);
|3306|3306| 		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
|3300|3300| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3301|3301| 			continue;
|3302|3302| 		if (i == 0)
|3303|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3303|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3304|3304| 		else
|3305|3305| 			this.orderQueue.splice(i, 1);
|3306|3306| 		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
|3384|3384| };
|3385|3385| 
|3386|3386| 
|3387|    |-//// FSM linkage functions ////
|    |3387|+// // FSM linkage functions ////
|3388|3388| 
|3389|3389| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3390|3390| 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
|3556|3556| 				continue;
|3557|3557| 			if (this.orderQueue[i].type == type)
|3558|3558| 				continue;
|3559|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3559|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3560|3560| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3561|3561| 			return;
|3562|3562| 		}
|    | [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
|3556|3556| 				continue;
|3557|3557| 			if (this.orderQueue[i].type == type)
|3558|3558| 				continue;
|3559|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3559|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3560|3560| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3561|3561| 			return;
|3562|3562| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3570|3570| {
|3571|3571| 	// Remember the previous work orders to be able to go back to them later if required
|3572|3572| 	if (data && data.force)
|3573|    |-	{
|    |3573|+	
|3574|3574| 		if (this.IsFormationController())
|3575|3575| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3576|3576| 		else
|3577|3577| 			this.UpdateWorkOrders(type);
|3578|    |-	}
|    |3578|+	
|3579|3579| 
|3580|3580| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3581|3581| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3647|3647| 	{
|3648|3648| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3649|3649| 		if (cmpUnitAI)
|3650|    |-		{
|    |3650|+		
|3651|3651| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3652|3652| 			{
|3653|3653| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3656|3656| 					return;
|3657|3657| 				}
|3658|3658| 			}
|3659|    |-		}
|    |3659|+		
|3660|3660| 	}
|3661|3661| 
|3662|3662| 	// 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
|3649|3649| 		if (cmpUnitAI)
|3650|3650| 		{
|3651|3651| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3652|    |-			{
|    |3652|+			
|3653|3653| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3654|3654| 				{
|3655|3655| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3656|3656| 					return;
|3657|3657| 				}
|3658|    |-			}
|    |3658|+			
|3659|3659| 		}
|3660|3660| 	}
|3661|3661| 
|    | [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
|3661|3661| 
|3662|3662| 	// If nothing found, take the unit orders
|3663|3663| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3664|    |-	{
|    |3664|+	
|3665|3665| 		if (isWorkType(this.orderQueue[i].type))
|3666|3666| 		{
|3667|3667| 			this.workOrders = this.orderQueue.slice(i);
|3668|3668| 			return;
|3669|3669| 		}
|3670|    |-	}
|    |3670|+	
|3671|3671| };
|3672|3672| 
|3673|3673| 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
|3727|3727| 	if (data.timerRepeat === undefined)
|3728|3728| 		this.timer = undefined;
|3729|3729| 
|3730|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3730|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3731|3731| };
|3732|3732| 
|3733|3733| /**
|    | [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
|3727|3727| 	if (data.timerRepeat === undefined)
|3728|3728| 		this.timer = undefined;
|3729|3729| 
|3730|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3730|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3731|3731| };
|3732|3732| 
|3733|3733| /**
|    | [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
|3762|3762| 	this.timer = undefined;
|3763|3763| };
|3764|3764| 
|3765|    |-//// Message handlers /////
|    |3765|+// // Message handlers /////
|3766|3766| 
|3767|3767| UnitAI.prototype.OnMotionChanged = function(msg)
|3768|3768| {
|    | [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
|3774|3774| 	// TODO: This is a bit inefficient since every unit listens to every
|3775|3775| 	// construction message - ideally we could scope it to only the one we're building
|3776|3776| 
|3777|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3777|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3778|3778| };
|3779|3779| 
|3780|3780| 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
|3774|3774| 	// TODO: This is a bit inefficient since every unit listens to every
|3775|3775| 	// construction message - ideally we could scope it to only the one we're building
|3776|3776| 
|3777|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3777|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3778|3778| };
|3779|3779| 
|3780|3780| 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
|3799|3799| 
|3800|3800| UnitAI.prototype.OnAttacked = function(msg)
|3801|3801| {
|3802|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3802|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3803|3803| };
|3804|3804| 
|3805|3805| 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
|3799|3799| 
|3800|3800| UnitAI.prototype.OnAttacked = function(msg)
|3801|3801| {
|3802|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3802|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3803|3803| };
|3804|3804| 
|3805|3805| 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
|3804|3804| 
|3805|3805| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3806|3806| {
|3807|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3807|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3808|3808| };
|3809|3809| 
|3810|3810| 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
|3804|3804| 
|3805|3805| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3806|3806| {
|3807|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3807|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3808|3808| };
|3809|3809| 
|3810|3810| 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
|3809|3809| 
|3810|3810| UnitAI.prototype.OnHealthChanged = function(msg)
|3811|3811| {
|3812|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3812|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3813|3813| };
|3814|3814| 
|3815|3815| 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
|3809|3809| 
|3810|3810| UnitAI.prototype.OnHealthChanged = function(msg)
|3811|3811| {
|3812|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3812|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3813|3813| };
|3814|3814| 
|3815|3815| 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
|3815|3815| UnitAI.prototype.OnRangeUpdate = function(msg)
|3816|3816| {
|3817|3817| 	if (msg.tag == this.losRangeQuery)
|3818|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3818|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3819|3819| 	else if (msg.tag == this.losHealRangeQuery)
|3820|3820| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3821|3821| };
|    | [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
|3815|3815| UnitAI.prototype.OnRangeUpdate = function(msg)
|3816|3816| {
|3817|3817| 	if (msg.tag == this.losRangeQuery)
|3818|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3818|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3819|3819| 	else if (msg.tag == this.losHealRangeQuery)
|3820|3820| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3821|3821| };
|    | [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
|3817|3817| 	if (msg.tag == this.losRangeQuery)
|3818|3818| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3819|3819| 	else if (msg.tag == this.losHealRangeQuery)
|3820|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3820|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3821|3821| };
|3822|3822| 
|3823|3823| 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
|3817|3817| 	if (msg.tag == this.losRangeQuery)
|3818|3818| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3819|3819| 	else if (msg.tag == this.losHealRangeQuery)
|3820|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3820|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3821|3821| };
|3822|3822| 
|3823|3823| 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
|3822|3822| 
|3823|3823| UnitAI.prototype.OnPackFinished = function(msg)
|3824|3824| {
|3825|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3825|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3826|3826| };
|3827|3827| 
|3828|3828| //// 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
|3822|3822| 
|3823|3823| UnitAI.prototype.OnPackFinished = function(msg)
|3824|3824| {
|3825|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3825|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3826|3826| };
|3827|3827| 
|3828|3828| //// 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
|3825|3825| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3826|3826| };
|3827|3827| 
|3828|    |-//// Helper functions to be called by the FSM ////
|    |3828|+// // Helper functions to be called by the FSM ////
|3829|3829| 
|3830|3830| UnitAI.prototype.GetWalkSpeed = function()
|3831|3831| {
|    | [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
|3927|3927| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|3928|3928| 		return undefined;
|3929|3929| 
|3930|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |3930|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|3931|3931| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|3932|3932| 		return undefined;
|3933|3933| 
|    | [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
|4012|4012| 			PlaySound(name, member);
|4013|4013| 	}
|4014|4014| 	else
|4015|    |-	{
|    |4015|+	
|4016|4016| 		// Otherwise use our own sounds
|4017|4017| 		PlaySound(name, this.entity);
|4018|    |-	}
|    |4018|+	
|4019|4019| };
|4020|4020| 
|4021|4021| /*
|    | [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
|4204|4204| 	else
|4205|4205| 		// return false? Or hope you come close enough?
|4206|4206| 		var parabolicMaxRange = 0;
|4207|    |-		//return false;
|    |4207|+		// return false;
|4208|4208| 
|4209|4209| 	// the parabole changes while walking, take something in the middle
|4210|4210| 	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
|4291|4291| 	if (this.IsFormationMember())
|4292|4292| 	{
|4293|4293| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4294|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4295|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4294|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4295|+			cmpFormationUnitAI.order.data.target == target)
|4296|4296| 			return true;
|4297|4297| 	}
|4298|4298| 
|    | [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
|4459|4459| UnitAI.prototype.AttackEntityInZone = function(ents)
|4460|4460| {
|4461|4461| 	var target = ents.find(target =>
|4462|    |-		this.CanAttack(target)
|4463|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4462|+		this.CanAttack(target) &&
|    |4463|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4464|4464| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4465|4465| 	);
|4466|4466| 	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
|4460|4460| {
|4461|4461| 	var target = ents.find(target =>
|4462|4462| 		this.CanAttack(target)
|4463|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4464|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4463|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4464|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4465|4465| 	);
|4466|4466| 	if (!target)
|4467|4467| 		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
|4524|4524| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4525|4525| 	if (this.isGuardOf)
|4526|4526| 	{
|4527|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4527|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4528|4528| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4529|4529| 		if (cmpUnitAI && cmpAttack &&
|4530|4530| 		    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
|4528|4528| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4529|4529| 		if (cmpUnitAI && cmpAttack &&
|4530|4530| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4531|    |-				return false;
|    |4531|+			return false;
|4532|4532| 	}
|4533|4533| 
|4534|4534| 	// 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
|4533|4533| 
|4534|4534| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4535|4535| 	if (this.GetStance().respondHoldGround)
|4536|    |-	{
|    |4536|+	
|4537|4537| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4538|4538| 			return true;
|4539|    |-	}
|    |4539|+	
|4540|4540| 
|4541|4541| 	// Stop if it's left our vision range, unless we're especially persistent
|4542|4542| 	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
|4540|4540| 
|4541|4541| 	// Stop if it's left our vision range, unless we're especially persistent
|4542|4542| 	if (!this.GetStance().respondChaseBeyondVision)
|4543|    |-	{
|    |4543|+	
|4544|4544| 		if (!this.CheckTargetIsInVisionRange(target))
|4545|4545| 			return true;
|4546|    |-	}
|    |4546|+	
|4547|4547| 
|4548|4548| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4549|4549| 	// 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
|4566|4566| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4567|4567| 	if (this.isGuardOf)
|4568|4568| 	{
|4569|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4569|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4570|4570| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4571|4571| 		if (cmpUnitAI && cmpAttack &&
|4572|4572| 		    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
|4579|4579| 	return false;
|4580|4580| };
|4581|4581| 
|4582|    |-//// External interface functions ////
|    |4582|+// // External interface functions ////
|4583|4583| 
|4584|4584| UnitAI.prototype.SetFormationController = function(ent)
|4585|4585| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4589|4589| 	// of our own formation (or ourself if not in formation)
|4590|4590| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4591|4591| 	if (cmpObstruction)
|4592|    |-	{
|    |4592|+	
|4593|4593| 		if (ent == INVALID_ENTITY)
|4594|4594| 			cmpObstruction.SetControlGroup(this.entity);
|4595|4595| 		else
|4596|4596| 			cmpObstruction.SetControlGroup(ent);
|4597|    |-	}
|    |4597|+	
|4598|4598| 
|4599|4599| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4600|4600| 	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
|4732|4732| 	// if we already had an old guard order, do nothing if the target is the same
|4733|4733| 	// and the order is running, otherwise remove the previous order
|4734|4734| 	if (this.isGuardOf)
|4735|    |-	{
|    |4735|+	
|4736|4736| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4737|4737| 			return;
|4738|4738| 		else
|4739|4739| 			this.RemoveGuard();
|4740|    |-	}
|    |4740|+	
|4741|4741| 
|4742|4742| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4743|4743| };
|    | [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
|4735|4735| 	{
|4736|4736| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4737|4737| 			return;
|4738|    |-		else
|4739|    |-			this.RemoveGuard();
|    |4738|+		this.RemoveGuard();
|4740|4739| 	}
|4741|4740| 
|4742|4741| 	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
|4906|4906| 			this.WalkToTarget(target, queued);
|4907|4907| 		return;
|4908|4908| 	}
|4909|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4909|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4910|4910| };
|4911|4911| 
|4912|4912| /**
|    | [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
|5055|5055| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5056|5056| 	{
|5057|5057| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5058|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5058|+		if (cmpTrader.HasBothMarkets() &&
|5059|5059| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5060|5060| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5061|5061| 		{
|    | [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
|5336|5336| 				{
|5337|5337| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5338|5338| 					var targetClasses = this.order.data.targetClasses;
|5339|    |-					if (targetClasses.attack && cmpIdentity
|5340|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5339|+					if (targetClasses.attack && cmpIdentity &&
|    |5340|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5341|5341| 						continue;
|5342|5342| 					if (targetClasses.avoid && cmpIdentity
|5343|5343| 						&& 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
|5339|5339| 					if (targetClasses.attack && cmpIdentity
|5340|5340| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5341|5341| 						continue;
|5342|    |-					if (targetClasses.avoid && cmpIdentity
|5343|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5342|+					if (targetClasses.avoid && cmpIdentity &&
|    |5343|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5344|5344| 						continue;
|5345|5345| 					// Only used by the AIs to prevent some choices of targets
|5346|5346| 					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
|5362|5362| 		{
|5363|5363| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5364|5364| 			var targetClasses = this.order.data.targetClasses;
|5365|    |-			if (cmpIdentity && targetClasses.attack
|5366|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5365|+			if (cmpIdentity && targetClasses.attack &&
|    |5366|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5367|5367| 				continue;
|5368|5368| 			if (cmpIdentity && targetClasses.avoid
|5369|5369| 				&& 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
|5365|5365| 			if (cmpIdentity && targetClasses.attack
|5366|5366| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5367|5367| 				continue;
|5368|    |-			if (cmpIdentity && targetClasses.avoid
|5369|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5368|+			if (cmpIdentity && targetClasses.avoid &&
|    |5369|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5370|5370| 				continue;
|5371|5371| 			// Only used by the AIs to prevent some choices of targets
|5372|5372| 			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
|5508|5508| 
|5509|5509| UnitAI.prototype.SetHeldPosition = function(x, z)
|5510|5510| {
|5511|    |-	this.heldPosition = {"x": x, "z": z};
|    |5511|+	this.heldPosition = { "x": x, "z": z};
|5512|5512| };
|5513|5513| 
|5514|5514| 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
|5508|5508| 
|5509|5509| UnitAI.prototype.SetHeldPosition = function(x, z)
|5510|5510| {
|5511|    |-	this.heldPosition = {"x": x, "z": z};
|    |5511|+	this.heldPosition = {"x": x, "z": z };
|5512|5512| };
|5513|5513| 
|5514|5514| 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
|5535|5535| 	return false;
|5536|5536| };
|5537|5537| 
|5538|    |-//// Helper functions ////
|    |5538|+// // Helper functions ////
|5539|5539| 
|5540|5540| UnitAI.prototype.CanAttack = function(target)
|5541|5541| {
|    | [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
|5739|5739| 	return cmpPack && cmpPack.IsPacking();
|5740|5740| };
|5741|5741| 
|5742|    |-//// Formation specific functions ////
|    |5742|+// // Formation specific functions ////
|5743|5743| 
|5744|5744| UnitAI.prototype.IsAttackingAsFormation = function()
|5745|5745| {
|    | [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
|5744|5744| UnitAI.prototype.IsAttackingAsFormation = function()
|5745|5745| {
|5746|5746| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5747|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5748|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5747|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5748|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5749|5749| };
|5750|5750| 
|5751|5751| //// 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
|5748|5748| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5749|5749| };
|5750|5750| 
|5751|    |-//// Animal specific functions ////
|    |5751|+// // Animal specific functions ////
|5752|5752| 
|5753|5753| UnitAI.prototype.MoveRandomly = function(distance)
|5754|5754| {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|1976| »   »   »   »   "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
|2066| »   »   »   »   "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
|2235| »   »   »   »   »   »   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
|2290| »   »   »   »   "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
|2408| »   »   »   »   "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
|2473| »   »   »   »   "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
|2513| »   »   »   »   "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
|2717| »   »   »   »   "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
|2901| »   »   »   »   "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
|3632| »   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
|4446| »   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
|4461| »   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
|4507| »   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
|4530| »   »   ····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
|4986| »   var·lastPos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4217| »   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
|4295| »   »   »   &&·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
|4463| »   »   &&·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
|4464| »   »   &&·(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
|4986| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

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

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

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

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