Page MenuHomeWildfire Games

Fix move speed not correctly reset when chasing a unit
ClosedPublic

Authored by wraitii on May 6 2019, 7:08 PM.

Details

Reviewers
Angen
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22275: Fix move speed not correctly reset when chasing a unit
Summary

As seen by Angen here, rP22197 has an issue where we don't reset the move speed after chasing a unit. This is fixed.

Test Plan

Check that the behaviour is fixed.

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.May 6 2019, 7:08 PM
Angen accepted this revision.May 6 2019, 7:35 PM
Angen added a subscriber: Angen.

This is fixing reported issue of missing reset to default speed. I have not found another missed resets of speed created by rP22197.

This revision is now accepted and ready to land.May 6 2019, 7:35 PM
Vulcan added a comment.May 6 2019, 7:43 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 228| 228| 		// Move a tile outside the building
| 229| 229| 		let range = 4;
| 230| 230| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 231|    |-		{
|    | 231|+		
| 232| 232| 			// We've started walking to the given point
| 233| 233| 			this.SetNextState("INDIVIDUAL.WALKING");
| 234|    |-		}
|    | 234|+		
| 235| 235| 		else
| 236| 236| 		{
| 237| 237| 			// We are already at the target, or can't move at all
|    | [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
| 233| 233| 			this.SetNextState("INDIVIDUAL.WALKING");
| 234| 234| 		}
| 235| 235| 		else
| 236|    |-		{
|    | 236|+		
| 237| 237| 			// We are already at the target, or can't move at all
| 238| 238| 			this.FinishOrder();
| 239|    |-		}
|    | 239|+		
| 240| 240| 	},
| 241| 241| 
| 242| 242| 	// Individual orders:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 335| 335| 
| 336| 336| 		var ok = this.MoveToTarget(this.order.data.target);
| 337| 337| 		if (ok)
| 338|    |-		{
|    | 338|+		
| 339| 339| 			// We've started walking to the given point
| 340| 340| 			if (this.IsAnimal())
| 341| 341| 				this.SetNextState("ANIMAL.WALKING");
| 342| 342| 			else
| 343| 343| 				this.SetNextState("INDIVIDUAL.WALKING");
| 344|    |-		}
|    | 344|+		
| 345| 345| 		else
| 346| 346| 		{
| 347| 347| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 363| 363| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 364| 364| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 365| 365| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 366|    |-		{
|    | 366|+		
| 367| 367| 			// we were already on the shoreline, and have not moved since
| 368| 368| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 369| 369| 				needToMove = false;
| 370|    |-		}
|    | 370|+		
| 371| 371| 
| 372| 372| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 373| 373| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
|    | [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
| 361| 361| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 362| 362| 		var needToMove = true;
| 363| 363| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 364|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 365|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 364|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 365|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 366| 366| 		{
| 367| 367| 			// we were already on the shoreline, and have not moved since
| 368| 368| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 372| 372| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 373| 373| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 374| 374| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 375|    |-		{
|    | 375|+		
| 376| 376| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 377|    |-		}
|    | 377|+		
| 378| 378| 		else
| 379| 379| 		{
| 380| 380| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 401| 401| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 402| 402| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 403| 403| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 404|    |-		{
|    | 404|+		
| 405| 405| 			// We've started fleeing from the given target
| 406| 406| 			if (this.IsAnimal())
| 407| 407| 				this.SetNextState("ANIMAL.FLEEING");
| 408| 408| 			else
| 409| 409| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 410|    |-		}
|    | 410|+		
| 411| 411| 		else
| 412| 412| 		{
| 413| 413| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 448| 448| 			}
| 449| 449| 
| 450| 450| 			if (this.order.data.attackType == this.oldAttackType)
| 451|    |-			{
|    | 451|+			
| 452| 452| 				if (this.IsAnimal())
| 453| 453| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 454| 454| 				else
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456|    |-			}
|    | 456|+			
| 457| 457| 			else
| 458| 458| 			{
| 459| 459| 				if (this.IsAnimal())
|    | [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
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456| 456| 			}
| 457| 457| 			else
| 458|    |-			{
|    | 458|+			
| 459| 459| 				if (this.IsAnimal())
| 460| 460| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 461| 461| 				else
| 462| 462| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 463|    |-			}
|    | 463|+			
| 464| 464| 			return;
| 465| 465| 		}
| 466| 466| 
|    | [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
| 580| 580| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 581| 581| 				}
| 582| 582| 				else
| 583|    |-				{
|    | 583|+				
| 584| 584| 					// We couldn't move there, or the target moved away
| 585| 585| 					this.FinishOrder();
| 586|    |-				}
|    | 586|+				
| 587| 587| 				return;
| 588| 588| 			}
| 589| 589| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 593| 593| 
| 594| 594| 		// Try to move within range
| 595| 595| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 596|    |-		{
|    | 596|+		
| 597| 597| 			// We've started walking to the given point
| 598| 598| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 599|    |-		}
|    | 599|+		
| 600| 600| 		else
| 601| 601| 		{
| 602| 602| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 670| 670| 	"Order.Repair": function(msg) {
| 671| 671| 		// Try to move within range
| 672| 672| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 673|    |-		{
|    | 673|+		
| 674| 674| 			// We've started walking to the given point
| 675| 675| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 676|    |-		}
|    | 676|+		
| 677| 677| 		else
| 678| 678| 		{
| 679| 679| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 706| 706| 		}
| 707| 707| 
| 708| 708| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 709|    |-		{
|    | 709|+		
| 710| 710| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 711|    |-		}
|    | 711|+		
| 712| 712| 		else
| 713| 713| 		{
| 714| 714| 			// We do a range check before actually garrisoning
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 834| 834| 			if (!this.CheckTargetAttackRange(target, target))
| 835| 835| 			{
| 836| 836| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 837|    |-				{
|    | 837|+				
| 838| 838| 					if (this.MoveToTargetAttackRange(target, target))
| 839| 839| 					{
| 840| 840| 						this.SetNextState("COMBAT.APPROACHING");
| 841| 841| 						return;
| 842| 842| 					}
| 843|    |-				}
|    | 843|+				
| 844| 844| 				this.FinishOrder();
| 845| 845| 				return;
| 846| 846| 			}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 859| 859| 			}
| 860| 860| 			// Check if we are already in range, otherwise walk there
| 861| 861| 			if (!this.CheckGarrisonRange(msg.data.target))
| 862|    |-			{
|    | 862|+			
| 863| 863| 				if (!this.CheckTargetVisible(msg.data.target))
| 864| 864| 				{
| 865| 865| 					this.FinishOrder();
| 874| 874| 						return;
| 875| 875| 					}
| 876| 876| 				}
| 877|    |-			}
|    | 877|+			
| 878| 878| 
| 879| 879| 			this.SetNextState("GARRISON.GARRISONING");
| 880| 880| 		},
|    | [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
| 866| 866| 					return;
| 867| 867| 				}
| 868| 868| 				else
| 869|    |-				{
|    | 869|+				
| 870| 870| 					// Out of range; move there in formation
| 871| 871| 					if (this.MoveToGarrisonRange(msg.data.target))
| 872| 872| 					{
| 873| 873| 						this.SetNextState("GARRISON.APPROACHING");
| 874| 874| 						return;
| 875| 875| 					}
| 876|    |-				}
|    | 876|+				
| 877| 877| 			}
| 878| 878| 
| 879| 879| 			this.SetNextState("GARRISON.GARRISONING");
|    | [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
| 865| 865| 					this.FinishOrder();
| 866| 866| 					return;
| 867| 867| 				}
| 868|    |-				else
| 869|    |-				{
|    | 868|+				
| 870| 869| 					// Out of range; move there in formation
| 871| 870| 					if (this.MoveToGarrisonRange(msg.data.target))
| 872| 871| 					{
| 873| 872| 						this.SetNextState("GARRISON.APPROACHING");
| 874| 873| 						return;
| 875| 874| 					}
| 876|    |-				}
|    | 875|+				
| 877| 876| 			}
| 878| 877| 
| 879| 878| 			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
| 892| 892| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 893| 893| 					}
| 894| 894| 					else
| 895|    |-					{
|    | 895|+					
| 896| 896| 						// We couldn't move there, or the target moved away
| 897| 897| 						this.FinishOrder();
| 898|    |-					}
|    | 898|+					
| 899| 899| 					return;
| 900| 900| 				}
| 901| 901| 
|    | [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
|1113|1113| 			},
|1114|1114| 		},
|1115|1115| 
|1116|    |-		"GARRISON":{
|    |1116|+		"GARRISON": {
|1117|1117| 			"enter": function() {
|1118|1118| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1119|1119| 				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
|1297|1297| 			// If the controller handled an order but some members rejected it,
|1298|1298| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1299|1299| 			if (this.orderQueue.length)
|1300|    |-			{
|    |1300|+			
|1301|1301| 				// We're leaving the formation, so stop our FormationWalk order
|1302|1302| 				if (this.FinishOrder())
|1303|1303| 					return;
|1304|    |-			}
|    |1304|+			
|1305|1305| 
|1306|1306| 			// No orders left, we're an individual now
|1307|1307| 			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
|1325|1325| 			// Move a tile outside the building
|1326|1326| 			let range = 4;
|1327|1327| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1328|    |-			{
|    |1328|+			
|1329|1329| 				// We've started walking to the given point
|1330|1330| 				this.SetNextState("WALKINGTOPOINT");
|1331|    |-			}
|    |1331|+			
|1332|1332| 			else
|1333|1333| 			{
|1334|1334| 				// We are already at the target, or can't move at all
|    | [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
|1330|1330| 				this.SetNextState("WALKINGTOPOINT");
|1331|1331| 			}
|1332|1332| 			else
|1333|    |-			{
|    |1333|+			
|1334|1334| 				// We are already at the target, or can't move at all
|1335|1335| 				this.FinishOrder();
|1336|    |-			}
|    |1336|+			
|1337|1337| 		},
|1338|1338| 
|1339|1339| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1531|1531| 
|1532|1532| 			"LosRangeUpdate": function(msg) {
|1533|1533| 				if (this.GetStance().targetVisibleEnemies)
|1534|    |-				{
|    |1534|+				
|1535|1535| 					// Start attacking one of the newly-seen enemy (if any)
|1536|1536| 					this.AttackEntitiesByPreference(msg.data.added);
|1537|    |-				}
|    |1537|+				
|1538|1538| 			},
|1539|1539| 
|1540|1540| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1717|1717| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1718|1718| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1719|1719| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1720|    |-						{
|    |1720|+						
|1721|1721| 							if (this.CanHeal(this.isGuardOf))
|1722|1722| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1723|1723| 							else if (this.CanRepair(this.isGuardOf))
|1724|1724| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1725|    |-						}
|    |1725|+						
|1726|1726| 					}
|1727|1727| 				},
|1728|1728| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1802|1802| 				"MoveCompleted": function() {
|1803|1803| 
|1804|1804| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1805|    |-					{
|    |1805|+					
|1806|1806| 						// If the unit needs to unpack, do so
|1807|1807| 						if (this.CanUnpack())
|1808|1808| 						{
|1811|1811| 						}
|1812|1812| 						else
|1813|1813| 							this.SetNextState("ATTACKING");
|1814|    |-					}
|    |1814|+					
|1815|1815| 					else
|1816|1816| 					{
|1817|1817| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1809|1809| 							this.PushOrderFront("Unpack", { "force": true });
|1810|1810| 							return;
|1811|1811| 						}
|1812|    |-						else
|1813|    |-							this.SetNextState("ATTACKING");
|    |1812|+						this.SetNextState("ATTACKING");
|1814|1813| 					}
|1815|1814| 					else
|1816|1815| 					{
|    | [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
|1813|1813| 							this.SetNextState("ATTACKING");
|1814|1814| 					}
|1815|1815| 					else
|1816|    |-					{
|    |1816|+					
|1817|1817| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1818|1818| 						{
|1819|1819| 							this.SetNextState("APPROACHING");
|1823|1823| 							// Give up
|1824|1824| 							this.FinishOrder();
|1825|1825| 						}
|1826|    |-					}
|    |1826|+					
|1827|1827| 				},
|1828|1828| 			},
|1829|1829| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1815|1815| 					else
|1816|1816| 					{
|1817|1817| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1818|    |-						{
|    |1818|+						
|1819|1819| 							this.SetNextState("APPROACHING");
|1820|    |-						}
|    |1820|+						
|1821|1821| 						else
|1822|1822| 						{
|1823|1823| 							// Give up
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1819|1819| 							this.SetNextState("APPROACHING");
|1820|1820| 						}
|1821|1821| 						else
|1822|    |-						{
|    |1822|+						
|1823|1823| 							// Give up
|1824|1824| 							this.FinishOrder();
|1825|    |-						}
|    |1825|+						
|1826|1826| 					}
|1827|1827| 				},
|1828|1828| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/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| 					}
|1841|1841| 					// Check the target is still alive and attackable
|1842|1842| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1843|    |-					{
|    |1843|+					
|1844|1844| 						// Can't reach it - try to chase after it
|1845|1845| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1846|1846| 						{
|1855|1855| 								return;
|1856|1856| 							}
|1857|1857| 						}
|1858|    |-					}
|    |1858|+					
|1859|1859| 
|1860|1860| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1861|1861| 					this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType);
|    | [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
|1886|1886| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1887|1887| 
|1888|1888| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1889|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1889|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1890|1890| 
|1891|1891| 					this.FaceTowardsTarget(this.order.data.target);
|1892|1892| 
|    | [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
|2015|2015| 
|2016|2016| 				"Attacked": function(msg) {
|2017|2017| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2018|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2019|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2018|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2019|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2020|2020| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2021|2021| 				},
|2022|2022| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2029|2029| 					this.SelectAnimation("move");
|2030|2030| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2031|2031| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2032|    |-					{
|    |2032|+					
|2033|2033| 						// Run after a fleeing target
|2034|2034| 						this.SetMoveSpeedRatio(this.GetRunMultiplier());
|2035|    |-					}
|    |2035|+					
|2036|2036| 					this.StartTimer(1000, 1000);
|2037|2037| 				},
|2038|2038| 
|    | [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
|2090|2090| 						// Also don't switch to a different type of huntable animal
|2091|2091| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2092|2092| 							return (
|2093|    |-								ent != oldTarget
|2094|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2093|+								ent != oldTarget &&
|    |2094|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2095|2095| 								 || (type.specific == oldType.specific
|2096|2096| 								 && (type.specific != "meat" || oldTemplate == template)))
|2097|2097| 							);
|    | [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
|2091|2091| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2092|2092| 							return (
|2093|2093| 								ent != oldTarget
|2094|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2095|    |-								 || (type.specific == oldType.specific
|    |2094|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2095|+								 (type.specific == oldType.specific
|2096|2096| 								 && (type.specific != "meat" || oldTemplate == template)))
|2097|2097| 							);
|2098|2098| 						}, oldTarget);
|    | [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
|2092|2092| 							return (
|2093|2093| 								ent != oldTarget
|2094|2094| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2095|    |-								 || (type.specific == oldType.specific
|2096|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2095|+								 || (type.specific == oldType.specific &&
|    |2096|+								 (type.specific != "meat" || oldTemplate == template)))
|2097|2097| 							);
|2098|2098| 						}, oldTarget);
|2099|2099| 						if (nearby)
|    | [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
|2101|2101| 							this.PerformGather(nearby, false, false);
|2102|2102| 							return true;
|2103|2103| 						}
|2104|    |-						else
|2105|    |-						{
|    |2104|+						
|2106|2105| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2107|2106| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2108|2107| 							// to order it to GatherNear the resource position.
|2123|2122| 									return true;
|2124|2123| 								}
|2125|2124| 							}
|2126|    |-						}
|    |2125|+						
|2127|2126| 						return true;
|2128|2127| 					}
|2129|2128| 					return false;
|    | [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
|2113|2113| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2114|2114| 								return true;
|2115|2115| 							}
|2116|    |-							else
|2117|    |-							{
|    |2116|+							
|2118|2117| 								// we're kind of stuck here. Return resource.
|2119|2118| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2120|2119| 								if (nearby)
|2122|2121| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2123|2122| 									return true;
|2124|2123| 								}
|2125|    |-							}
|    |2124|+							
|2126|2125| 						}
|2127|2126| 						return true;
|2128|2127| 					}
|    | [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
|2155|2155| 						// Also don't switch to a different type of huntable animal
|2156|2156| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2157|2157| 							return (
|2158|    |-								ent != oldTarget
|2159|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2158|+								ent != oldTarget &&
|    |2159|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2160|2160| 								|| (type.specific == oldType.specific
|2161|2161| 								&& (type.specific != "meat" || oldTemplate == template)))
|2162|2162| 							);
|    | [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
|2156|2156| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2157|2157| 							return (
|2158|2158| 								ent != oldTarget
|2159|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2160|    |-								|| (type.specific == oldType.specific
|    |2159|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2160|+								(type.specific == oldType.specific
|2161|2161| 								&& (type.specific != "meat" || oldTemplate == template)))
|2162|2162| 							);
|2163|2163| 						});
|    | [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
|2157|2157| 							return (
|2158|2158| 								ent != oldTarget
|2159|2159| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2160|    |-								|| (type.specific == oldType.specific
|2161|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2160|+								|| (type.specific == oldType.specific &&
|    |2161|+								(type.specific != "meat" || oldTemplate == template)))
|2162|2162| 							);
|2163|2163| 						});
|2164|2164| 						if (nearby)
|    | [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
|2202|2202| 					// Also don't switch to a different type of huntable animal
|2203|2203| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2204|2204| 						return (
|2205|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2206|    |-							|| (type.specific == resourceType.specific
|    |2205|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2206|+							(type.specific == resourceType.specific
|2207|2207| 							&& (type.specific != "meat" || resourceTemplate == template))
|2208|2208| 						);
|2209|2209| 					});
|    | [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
|2203|2203| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2204|2204| 						return (
|2205|2205| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2206|    |-							|| (type.specific == resourceType.specific
|2207|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2206|+							|| (type.specific == resourceType.specific &&
|    |2207|+							(type.specific != "meat" || resourceTemplate == template))
|2208|2208| 						);
|2209|2209| 					});
|2210|2210| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2319|2319| 
|2320|2320| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2321|2321| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2322|    |-					{
|    |2322|+					
|2323|2323| 						// Check we can still reach and gather from the target
|2324|2324| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2325|2325| 						{
|2385|2385| 								return;
|2386|2386| 							}
|2387|2387| 						}
|2388|    |-					}
|    |2388|+					
|2389|2389| 
|2390|2390| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2391|2391| 
|    | [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
|2411|2411| 					// Also don't switch to a different type of huntable animal
|2412|2412| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2413|2413| 						return (
|2414|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2415|    |-							|| (type.specific == resourceType.specific
|    |2414|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2415|+							(type.specific == resourceType.specific
|2416|2416| 							&& (type.specific != "meat" || resourceTemplate == template))
|2417|2417| 						);
|2418|2418| 					});
|    | [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
|2412|2412| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2413|2413| 						return (
|2414|2414| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2415|    |-							|| (type.specific == resourceType.specific
|2416|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2415|+							|| (type.specific == resourceType.specific &&
|    |2416|+							(type.specific != "meat" || resourceTemplate == template))
|2417|2417| 						);
|2418|2418| 					});
|2419|2419| 					if (nearby)
|    | [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
|2499|2499| 					this.StartTimer(prepare, this.healTimers.repeat);
|2500|2500| 
|2501|2501| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2502|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2502|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2503|2503| 
|2504|2504| 					this.FaceTowardsTarget(this.order.data.target);
|2505|2505| 				},
|    | [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
|2714|2714| 					{
|2715|2715| 						// The building was already finished/fully repaired before we arrived;
|2716|2716| 						// let the ConstructionFinished handler handle this.
|2717|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2717|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2718|2718| 						return true;
|2719|2719| 					}
|2720|2720| 
|    | [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
|2714|2714| 					{
|2715|2715| 						// The building was already finished/fully repaired before we arrived;
|2716|2716| 						// let the ConstructionFinished handler handle this.
|2717|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2717|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2718|2718| 						return true;
|2719|2719| 					}
|2720|2720| 
|    | [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
|2754|2754| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2755|2755| 						this.SetNextState("APPROACHING");
|2756|2756| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2757|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2757|+						this.FinishOrder(); // can't approach and isn't in reach
|2758|2758| 				},
|2759|2759| 			},
|2760|2760| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2841|2841| 
|2842|2842| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2843|2843| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2844|    |-				{
|    |2844|+				
|2845|2845| 					// We're already walking to the given point, so add this as a order.
|2846|2846| 					this.WalkToTarget(msg.data.newentity, true);
|2847|    |-				}
|    |2847|+				
|2848|2848| 			},
|2849|2849| 		},
|2850|2850| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2894|2894| 
|2895|2895| 					// Check that we can garrison here
|2896|2896| 					if (this.CanGarrison(target))
|2897|    |-					{
|    |2897|+					
|2898|2898| 						// Check that we're in range of the garrison target
|2899|2899| 						if (this.CheckGarrisonRange(target))
|2900|2900| 						{
|2970|2970| 								return false;
|2971|2971| 							}
|2972|2972| 						}
|2973|    |-					}
|    |2973|+					
|2974|2974| 					// Garrisoning failed for some reason, so finish the order
|2975|2975| 					this.FinishOrder();
|2976|2976| 					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
|3077|3077| 		"Attacked": function(msg) {
|3078|3078| 			if (this.template.NaturalBehaviour == "skittish" ||
|3079|3079| 			    this.template.NaturalBehaviour == "passive")
|3080|    |-			{
|    |3080|+			
|3081|3081| 				this.Flee(msg.data.attacker, false);
|3082|    |-			}
|    |3082|+			
|3083|3083| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3084|3084| 			{
|3085|3085| 				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
|3086|3086| 					this.Attack(msg.data.attacker, false);
|3087|3087| 			}
|3088|3088| 			else if (this.template.NaturalBehaviour == "domestic")
|3089|    |-			{
|    |3089|+			
|3090|3090| 				// Never flee, stop what we were doing
|3091|3091| 				this.SetNextState("IDLE");
|3092|    |-			}
|    |3092|+			
|3093|3093| 		},
|3094|3094| 
|3095|3095| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3096|3096| 			// Move a tile outside the building
|3097|3097| 			var range = 4;
|3098|3098| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3099|    |-			{
|    |3099|+			
|3100|3100| 				// We've started walking to the given point
|3101|3101| 				this.SetNextState("WALKING");
|3102|    |-			}
|    |3102|+			
|3103|3103| 			else
|3104|3104| 			{
|3105|3105| 				// We are already at the target, or can't move at all
|    | [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
|3101|3101| 				this.SetNextState("WALKING");
|3102|3102| 			}
|3103|3103| 			else
|3104|    |-			{
|    |3104|+			
|3105|3105| 				// We are already at the target, or can't move at all
|3106|3106| 				this.FinishOrder();
|3107|    |-			}
|    |3107|+			
|3108|3108| 		},
|3109|3109| 
|3110|3110| 		"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
|3143|3143| 				}
|3144|3144| 				// Start attacking one of the newly-seen enemy (if any)
|3145|3145| 				else if (this.IsDangerousAnimal())
|3146|    |-				{
|    |3146|+				
|3147|3147| 					this.AttackVisibleEntity(msg.data.added);
|3148|    |-				}
|    |3148|+				
|3149|3149| 
|3150|3150| 				// TODO: if two units enter our range together, we'll attack the
|3151|3151| 				// 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
|3186|3186| 				}
|3187|3187| 				// Start attacking one of the newly-seen enemy (if any)
|3188|3188| 				else if (this.template.NaturalBehaviour == "violent")
|3189|    |-				{
|    |3189|+				
|3190|3190| 					this.AttackVisibleEntity(msg.data.added);
|3191|    |-				}
|    |3191|+				
|3192|3192| 			},
|3193|3193| 
|3194|3194| 			"MoveCompleted": function() { },
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3203|3203| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3204|3204| 
|3205|3205| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3206|    |-							// only used for domestic animals
|    |3206|+		// only used for domestic animals
|3207|3207| 	},
|3208|3208| };
|3209|3209| 
|    | [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
|3260|3260| 
|3261|3261| UnitAI.prototype.IsAnimal = function()
|3262|3262| {
|3263|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3263|+	return (!!this.template.NaturalBehaviour);
|3264|3264| };
|3265|3265| 
|3266|3266| 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
|3298|3298| UnitAI.prototype.GetGarrisonHolder = function()
|3299|3299| {
|3300|3300| 	if (this.IsGarrisoned())
|3301|    |-	{
|    |3301|+	
|3302|3302| 		for (let order of this.orderQueue)
|3303|3303| 			if (order.type == "Garrison")
|3304|3304| 				return order.data.target;
|3305|    |-	}
|    |3305|+	
|3306|3306| 	return INVALID_ENTITY;
|3307|3307| };
|3308|3308| 
|    | [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
|3376|3376| 		{
|3377|3377| 			let index = this.GetCurrentState().indexOf(".");
|3378|3378| 			if (index != -1)
|3379|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3379|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3380|3380| 			this.Stop(false);
|3381|3381| 		}
|3382|3382| 
|    | [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
|3432|3432| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3433|3433| 			continue;
|3434|3434| 		if (i == 0)
|3435|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3435|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3436|3436| 		else
|3437|3437| 			this.orderQueue.splice(i, 1);
|3438|3438| 		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
|3432|3432| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3433|3433| 			continue;
|3434|3434| 		if (i == 0)
|3435|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3435|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3436|3436| 		else
|3437|3437| 			this.orderQueue.splice(i, 1);
|3438|3438| 		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
|3516|3516| };
|3517|3517| 
|3518|3518| 
|3519|    |-//// FSM linkage functions ////
|    |3519|+// // FSM linkage functions ////
|3520|3520| 
|3521|3521| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3522|3522| 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
|3688|3688| 				continue;
|3689|3689| 			if (this.orderQueue[i].type == type)
|3690|3690| 				continue;
|3691|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3691|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3692|3692| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3693|3693| 			return;
|3694|3694| 		}
|    | [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
|3688|3688| 				continue;
|3689|3689| 			if (this.orderQueue[i].type == type)
|3690|3690| 				continue;
|3691|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3691|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3692|3692| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3693|3693| 			return;
|3694|3694| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3702|3702| {
|3703|3703| 	// Remember the previous work orders to be able to go back to them later if required
|3704|3704| 	if (data && data.force)
|3705|    |-	{
|    |3705|+	
|3706|3706| 		if (this.IsFormationController())
|3707|3707| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3708|3708| 		else
|3709|3709| 			this.UpdateWorkOrders(type);
|3710|    |-	}
|    |3710|+	
|3711|3711| 
|3712|3712| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3713|3713| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3779|3779| 	{
|3780|3780| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3781|3781| 		if (cmpUnitAI)
|3782|    |-		{
|    |3782|+		
|3783|3783| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3784|3784| 			{
|3785|3785| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3788|3788| 					return;
|3789|3789| 				}
|3790|3790| 			}
|3791|    |-		}
|    |3791|+		
|3792|3792| 	}
|3793|3793| 
|3794|3794| 	// 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
|3781|3781| 		if (cmpUnitAI)
|3782|3782| 		{
|3783|3783| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3784|    |-			{
|    |3784|+			
|3785|3785| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3786|3786| 				{
|3787|3787| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3788|3788| 					return;
|3789|3789| 				}
|3790|    |-			}
|    |3790|+			
|3791|3791| 		}
|3792|3792| 	}
|3793|3793| 
|    | [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
|3793|3793| 
|3794|3794| 	// If nothing found, take the unit orders
|3795|3795| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3796|    |-	{
|    |3796|+	
|3797|3797| 		if (isWorkType(this.orderQueue[i].type))
|3798|3798| 		{
|3799|3799| 			this.workOrders = this.orderQueue.slice(i);
|3800|3800| 			return;
|3801|3801| 		}
|3802|    |-	}
|    |3802|+	
|3803|3803| };
|3804|3804| 
|3805|3805| 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
|3859|3859| 	if (data.timerRepeat === undefined)
|3860|3860| 		this.timer = undefined;
|3861|3861| 
|3862|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3862|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3863|3863| };
|3864|3864| 
|3865|3865| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3859|3859| 	if (data.timerRepeat === undefined)
|3860|3860| 		this.timer = undefined;
|3861|3861| 
|3862|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3862|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3863|3863| };
|3864|3864| 
|3865|3865| /**
|    | [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
|3894|3894| 	this.timer = undefined;
|3895|3895| };
|3896|3896| 
|3897|    |-//// Message handlers /////
|    |3897|+// // Message handlers /////
|3898|3898| 
|3899|3899| UnitAI.prototype.OnMotionChanged = function(msg)
|3900|3900| {
|    | [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
|3899|3899| UnitAI.prototype.OnMotionChanged = function(msg)
|3900|3900| {
|3901|3901| 	if (msg.starting && !msg.error)
|3902|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3902|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3903|3903| 	else if (!msg.starting || msg.error)
|3904|3904| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3905|3905| };
|    | [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
|3899|3899| UnitAI.prototype.OnMotionChanged = function(msg)
|3900|3900| {
|3901|3901| 	if (msg.starting && !msg.error)
|3902|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3902|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3903|3903| 	else if (!msg.starting || msg.error)
|3904|3904| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3905|3905| };
|    | [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
|3901|3901| 	if (msg.starting && !msg.error)
|3902|3902| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3903|3903| 	else if (!msg.starting || msg.error)
|3904|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3904|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3905|3905| };
|3906|3906| 
|3907|3907| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3901|3901| 	if (msg.starting && !msg.error)
|3902|3902| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3903|3903| 	else if (!msg.starting || msg.error)
|3904|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3904|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3905|3905| };
|3906|3906| 
|3907|3907| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3909|3909| 	// TODO: This is a bit inefficient since every unit listens to every
|3910|3910| 	// construction message - ideally we could scope it to only the one we're building
|3911|3911| 
|3912|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3912|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3913|3913| };
|3914|3914| 
|3915|3915| 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
|3909|3909| 	// TODO: This is a bit inefficient since every unit listens to every
|3910|3910| 	// construction message - ideally we could scope it to only the one we're building
|3911|3911| 
|3912|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3912|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3913|3913| };
|3914|3914| 
|3915|3915| 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
|3934|3934| 
|3935|3935| UnitAI.prototype.OnAttacked = function(msg)
|3936|3936| {
|3937|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3937|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3938|3938| };
|3939|3939| 
|3940|3940| 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
|3934|3934| 
|3935|3935| UnitAI.prototype.OnAttacked = function(msg)
|3936|3936| {
|3937|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3937|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3938|3938| };
|3939|3939| 
|3940|3940| 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
|3939|3939| 
|3940|3940| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3941|3941| {
|3942|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3942|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3943|3943| };
|3944|3944| 
|3945|3945| 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
|3939|3939| 
|3940|3940| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3941|3941| {
|3942|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3942|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3943|3943| };
|3944|3944| 
|3945|3945| 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
|3944|3944| 
|3945|3945| UnitAI.prototype.OnHealthChanged = function(msg)
|3946|3946| {
|3947|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3947|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3948|3948| };
|3949|3949| 
|3950|3950| 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
|3944|3944| 
|3945|3945| UnitAI.prototype.OnHealthChanged = function(msg)
|3946|3946| {
|3947|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3947|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3948|3948| };
|3949|3949| 
|3950|3950| 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
|3950|3950| UnitAI.prototype.OnRangeUpdate = function(msg)
|3951|3951| {
|3952|3952| 	if (msg.tag == this.losRangeQuery)
|3953|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3953|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3954|3954| 	else if (msg.tag == this.losHealRangeQuery)
|3955|3955| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3956|3956| };
|    | [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
|3950|3950| UnitAI.prototype.OnRangeUpdate = function(msg)
|3951|3951| {
|3952|3952| 	if (msg.tag == this.losRangeQuery)
|3953|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3953|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3954|3954| 	else if (msg.tag == this.losHealRangeQuery)
|3955|3955| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3956|3956| };
|    | [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
|3952|3952| 	if (msg.tag == this.losRangeQuery)
|3953|3953| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3954|3954| 	else if (msg.tag == this.losHealRangeQuery)
|3955|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3955|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3956|3956| };
|3957|3957| 
|3958|3958| 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
|3952|3952| 	if (msg.tag == this.losRangeQuery)
|3953|3953| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3954|3954| 	else if (msg.tag == this.losHealRangeQuery)
|3955|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3955|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3956|3956| };
|3957|3957| 
|3958|3958| 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
|3957|3957| 
|3958|3958| UnitAI.prototype.OnPackFinished = function(msg)
|3959|3959| {
|3960|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3960|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3961|3961| };
|3962|3962| 
|3963|3963| //// 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
|3957|3957| 
|3958|3958| UnitAI.prototype.OnPackFinished = function(msg)
|3959|3959| {
|3960|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3960|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3961|3961| };
|3962|3962| 
|3963|3963| //// 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
|3960|3960| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3961|3961| };
|3962|3962| 
|3963|    |-//// Helper functions to be called by the FSM ////
|    |3963|+// // Helper functions to be called by the FSM ////
|3964|3964| 
|3965|3965| UnitAI.prototype.GetWalkSpeed = function()
|3966|3966| {
|    | [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
|4062|4062| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4063|4063| 		return undefined;
|4064|4064| 
|4065|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4065|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4066|4066| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4067|4067| 		return undefined;
|4068|4068| 
|    | [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
|4147|4147| 			PlaySound(name, member);
|4148|4148| 	}
|4149|4149| 	else
|4150|    |-	{
|    |4150|+	
|4151|4151| 		// Otherwise use our own sounds
|4152|4152| 		PlaySound(name, this.entity);
|4153|    |-	}
|    |4153|+	
|4154|4154| };
|4155|4155| 
|4156|4156| /*
|    | [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
|4316|4316| 	else
|4317|4317| 		// return false? Or hope you come close enough?
|4318|4318| 		var parabolicMaxRange = 0;
|4319|    |-		//return false;
|    |4319|+		// return false;
|4320|4320| 
|4321|4321| 	// the parabole changes while walking, take something in the middle
|4322|4322| 	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
|4381|4381| 	if (this.IsFormationMember())
|4382|4382| 	{
|4383|4383| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4384|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4385|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4384|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4385|+			cmpFormationUnitAI.order.data.target == target)
|4386|4386| 			return true;
|4387|4387| 	}
|4388|4388| 
|    | [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
|4549|4549| UnitAI.prototype.AttackEntityInZone = function(ents)
|4550|4550| {
|4551|4551| 	var target = ents.find(target =>
|4552|    |-		this.CanAttack(target)
|4553|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4552|+		this.CanAttack(target) &&
|    |4553|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4554|4554| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4555|4555| 	);
|4556|4556| 	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
|4550|4550| {
|4551|4551| 	var target = ents.find(target =>
|4552|4552| 		this.CanAttack(target)
|4553|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4554|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4553|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4554|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4555|4555| 	);
|4556|4556| 	if (!target)
|4557|4557| 		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
|4614|4614| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4615|4615| 	if (this.isGuardOf)
|4616|4616| 	{
|4617|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4617|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4618|4618| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4619|4619| 		if (cmpUnitAI && cmpAttack &&
|4620|4620| 		    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
|4618|4618| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4619|4619| 		if (cmpUnitAI && cmpAttack &&
|4620|4620| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4621|    |-				return false;
|    |4621|+			return false;
|4622|4622| 	}
|4623|4623| 
|4624|4624| 	// 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
|4623|4623| 
|4624|4624| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4625|4625| 	if (this.GetStance().respondHoldGround)
|4626|    |-	{
|    |4626|+	
|4627|4627| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4628|4628| 			return true;
|4629|    |-	}
|    |4629|+	
|4630|4630| 
|4631|4631| 	// Stop if it's left our vision range, unless we're especially persistent
|4632|4632| 	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
|4630|4630| 
|4631|4631| 	// Stop if it's left our vision range, unless we're especially persistent
|4632|4632| 	if (!this.GetStance().respondChaseBeyondVision)
|4633|    |-	{
|    |4633|+	
|4634|4634| 		if (!this.CheckTargetIsInVisionRange(target))
|4635|4635| 			return true;
|4636|    |-	}
|    |4636|+	
|4637|4637| 
|4638|4638| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4639|4639| 	// 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
|4656|4656| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4657|4657| 	if (this.isGuardOf)
|4658|4658| 	{
|4659|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4659|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4660|4660| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4661|4661| 		if (cmpUnitAI && cmpAttack &&
|4662|4662| 		    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
|4669|4669| 	return false;
|4670|4670| };
|4671|4671| 
|4672|    |-//// External interface functions ////
|    |4672|+// // External interface functions ////
|4673|4673| 
|4674|4674| UnitAI.prototype.SetFormationController = function(ent)
|4675|4675| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4679|4679| 	// of our own formation (or ourself if not in formation)
|4680|4680| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4681|4681| 	if (cmpObstruction)
|4682|    |-	{
|    |4682|+	
|4683|4683| 		if (ent == INVALID_ENTITY)
|4684|4684| 			cmpObstruction.SetControlGroup(this.entity);
|4685|4685| 		else
|4686|4686| 			cmpObstruction.SetControlGroup(ent);
|4687|    |-	}
|    |4687|+	
|4688|4688| 
|4689|4689| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4690|4690| 	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
|4822|4822| 	// if we already had an old guard order, do nothing if the target is the same
|4823|4823| 	// and the order is running, otherwise remove the previous order
|4824|4824| 	if (this.isGuardOf)
|4825|    |-	{
|    |4825|+	
|4826|4826| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4827|4827| 			return;
|4828|4828| 		else
|4829|4829| 			this.RemoveGuard();
|4830|    |-	}
|    |4830|+	
|4831|4831| 
|4832|4832| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4833|4833| };
|    | [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
|4825|4825| 	{
|4826|4826| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4827|4827| 			return;
|4828|    |-		else
|4829|    |-			this.RemoveGuard();
|    |4828|+		this.RemoveGuard();
|4830|4829| 	}
|4831|4830| 
|4832|4831| 	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
|4996|4996| 			this.WalkToTarget(target, queued);
|4997|4997| 		return;
|4998|4998| 	}
|4999|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4999|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|5000|5000| };
|5001|5001| 
|5002|5002| /**
|    | [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
|5145|5145| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5146|5146| 	{
|5147|5147| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5148|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5148|+		if (cmpTrader.HasBothMarkets() &&
|5149|5149| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5150|5150| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5151|5151| 		{
|    | [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
|5426|5426| 				{
|5427|5427| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5428|5428| 					var targetClasses = this.order.data.targetClasses;
|5429|    |-					if (targetClasses.attack && cmpIdentity
|5430|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5429|+					if (targetClasses.attack && cmpIdentity &&
|    |5430|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5431|5431| 						continue;
|5432|5432| 					if (targetClasses.avoid && cmpIdentity
|5433|5433| 						&& 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
|5429|5429| 					if (targetClasses.attack && cmpIdentity
|5430|5430| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5431|5431| 						continue;
|5432|    |-					if (targetClasses.avoid && cmpIdentity
|5433|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5432|+					if (targetClasses.avoid && cmpIdentity &&
|    |5433|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5434|5434| 						continue;
|5435|5435| 					// Only used by the AIs to prevent some choices of targets
|5436|5436| 					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
|5452|5452| 		{
|5453|5453| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5454|5454| 			var targetClasses = this.order.data.targetClasses;
|5455|    |-			if (cmpIdentity && targetClasses.attack
|5456|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5455|+			if (cmpIdentity && targetClasses.attack &&
|    |5456|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5457|5457| 				continue;
|5458|5458| 			if (cmpIdentity && targetClasses.avoid
|5459|5459| 				&& 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
|5455|5455| 			if (cmpIdentity && targetClasses.attack
|5456|5456| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5457|5457| 				continue;
|5458|    |-			if (cmpIdentity && targetClasses.avoid
|5459|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5458|+			if (cmpIdentity && targetClasses.avoid &&
|    |5459|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5460|5460| 				continue;
|5461|5461| 			// Only used by the AIs to prevent some choices of targets
|5462|5462| 			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
|5598|5598| 
|5599|5599| UnitAI.prototype.SetHeldPosition = function(x, z)
|5600|5600| {
|5601|    |-	this.heldPosition = {"x": x, "z": z};
|    |5601|+	this.heldPosition = { "x": x, "z": z};
|5602|5602| };
|5603|5603| 
|5604|5604| 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
|5598|5598| 
|5599|5599| UnitAI.prototype.SetHeldPosition = function(x, z)
|5600|5600| {
|5601|    |-	this.heldPosition = {"x": x, "z": z};
|    |5601|+	this.heldPosition = {"x": x, "z": z };
|5602|5602| };
|5603|5603| 
|5604|5604| 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
|5625|5625| 	return false;
|5626|5626| };
|5627|5627| 
|5628|    |-//// Helper functions ////
|    |5628|+// // Helper functions ////
|5629|5629| 
|5630|5630| UnitAI.prototype.CanAttack = function(target)
|5631|5631| {
|    | [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
|5829|5829| 	return cmpPack && cmpPack.IsPacking();
|5830|5830| };
|5831|5831| 
|5832|    |-//// Formation specific functions ////
|    |5832|+// // Formation specific functions ////
|5833|5833| 
|5834|5834| UnitAI.prototype.IsAttackingAsFormation = function()
|5835|5835| {
|    | [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
|5834|5834| UnitAI.prototype.IsAttackingAsFormation = function()
|5835|5835| {
|5836|5836| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5837|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5838|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5837|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5838|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5839|5839| };
|5840|5840| 
|5841|5841| //// 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
|5838|5838| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5839|5839| };
|5840|5840| 
|5841|    |-//// Animal specific functions ////
|    |5841|+// // Animal specific functions ////
|5842|5842| 
|5843|5843| UnitAI.prototype.MoveRandomly = function(distance)
|5844|5844| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2401| »   »   »   »   »   »   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
|3764| »   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
|4536| »   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
|4551| »   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
|4597| »   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
|4620| »   »   ····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
|5076| »   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
| 365| »   »   ····&&·(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
|1878| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2019| »   »   »   »   »   »   &&·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
|2094| »   »   »   »   »   »   »   »   ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2095| »   »   »   »   »   »   »   »   ·||·(type.specific·==·oldType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2096| »   »   »   »   »   »   »   »   ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2119| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2159| »   »   »   »   »   »   »   »   &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2160| »   »   »   »   »   »   »   »   ||·(type.specific·==·oldType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2161| »   »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·oldTemplate·==·template)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4329| »   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
|4385| »   »   »   &&·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
|4553| »   »   &&·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
|4554| »   »   &&·(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
|5076| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5545| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [MAJOR] JSHintBear:
|    | Too many errors. (92% scanned).
Executing section cli...

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

This revision was automatically updated to reflect the committed changes.