Page MenuHomeWildfire Games

Move unit stances to a separate file
Needs ReviewPublic

Authored by Stan on Feb 3 2019, 9:38 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Hardcoding objects in components sounds wasteful especially when it could be changed by mods.

Test Plan

Ought to be unproblematic

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 6883
Build 11291: Vulcan BuildJenkins

Unit TestsFailed

TimeTest
0 msJenkins > cxxtest_debug.xml::Unknown Unit Message ("")
Failed to read test report file /mnt/data/jenkins-phabricator/workspace/differential/cxxtest_debug.xml org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog. at org.dom4j.io.SAXReader.read(SAXReader.java:482)
0 msJenkins > TestAllocators::Unknown Unit Message ("")
0 msJenkins > TestAtlasObjectXML::Unknown Unit Message ("")
0 msJenkins > TestAtlasObjectXML::Unknown Unit Message ("")
0 msJenkins > TestAtlasObjectXML::Unknown Unit Message ("")
View Full Test Results (1 Failed · 317 Passed)

Event Timeline

Stan created this revision.Feb 3 2019, 9:38 PM
Vulcan added a subscriber: Vulcan.Feb 3 2019, 9:40 PM

Build failure - The Moirai have given mortals hearts that can endure.

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
| 166| 166| 		// Move a tile outside the building
| 167| 167| 		let range = 4;
| 168| 168| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 169|    |-		{
|    | 169|+		
| 170| 170| 			// We've started walking to the given point
| 171| 171| 			this.SetNextState("INDIVIDUAL.WALKING");
| 172|    |-		}
|    | 172|+		
| 173| 173| 		else
| 174| 174| 		{
| 175| 175| 			// 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
| 171| 171| 			this.SetNextState("INDIVIDUAL.WALKING");
| 172| 172| 		}
| 173| 173| 		else
| 174|    |-		{
|    | 174|+		
| 175| 175| 			// We are already at the target, or can't move at all
| 176| 176| 			this.FinishOrder();
| 177|    |-		}
|    | 177|+		
| 178| 178| 	},
| 179| 179| 
| 180| 180| 	// 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
| 273| 273| 
| 274| 274| 		var ok = this.MoveToTarget(this.order.data.target);
| 275| 275| 		if (ok)
| 276|    |-		{
|    | 276|+		
| 277| 277| 			// We've started walking to the given point
| 278| 278| 			if (this.IsAnimal())
| 279| 279| 				this.SetNextState("ANIMAL.WALKING");
| 280| 280| 			else
| 281| 281| 				this.SetNextState("INDIVIDUAL.WALKING");
| 282|    |-		}
|    | 282|+		
| 283| 283| 		else
| 284| 284| 		{
| 285| 285| 			// 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
| 301| 301| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 302| 302| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 303| 303| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 304|    |-		{
|    | 304|+		
| 305| 305| 			// we were already on the shoreline, and have not moved since
| 306| 306| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 307| 307| 				needToMove = false;
| 308|    |-		}
|    | 308|+		
| 309| 309| 
| 310| 310| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 311| 311| 		// 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
| 299| 299| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 300| 300| 		var needToMove = true;
| 301| 301| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 302|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 303|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 302|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 303|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 304| 304| 		{
| 305| 305| 			// we were already on the shoreline, and have not moved since
| 306| 306| 			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
| 310| 310| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 311| 311| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 312| 312| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 313|    |-		{
|    | 313|+		
| 314| 314| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 315|    |-		}
|    | 315|+		
| 316| 316| 		else
| 317| 317| 		{
| 318| 318| 			// 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
| 339| 339| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 340| 340| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 341| 341| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 342|    |-		{
|    | 342|+		
| 343| 343| 			// We've started fleeing from the given target
| 344| 344| 			if (this.IsAnimal())
| 345| 345| 				this.SetNextState("ANIMAL.FLEEING");
| 346| 346| 			else
| 347| 347| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 348|    |-		}
|    | 348|+		
| 349| 349| 		else
| 350| 350| 		{
| 351| 351| 			// 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
| 386| 386| 			}
| 387| 387| 
| 388| 388| 			if (this.order.data.attackType == this.oldAttackType)
| 389|    |-			{
|    | 389|+			
| 390| 390| 				if (this.IsAnimal())
| 391| 391| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 392| 392| 				else
| 393| 393| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 394|    |-			}
|    | 394|+			
| 395| 395| 			else
| 396| 396| 			{
| 397| 397| 				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
| 393| 393| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 394| 394| 			}
| 395| 395| 			else
| 396|    |-			{
|    | 396|+			
| 397| 397| 				if (this.IsAnimal())
| 398| 398| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 399| 399| 				else
| 400| 400| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 401|    |-			}
|    | 401|+			
| 402| 402| 			return;
| 403| 403| 		}
| 404| 404| 
|    | [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
| 518| 518| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 519| 519| 				}
| 520| 520| 				else
| 521|    |-				{
|    | 521|+				
| 522| 522| 					// We couldn't move there, or the target moved away
| 523| 523| 					this.FinishOrder();
| 524|    |-				}
|    | 524|+				
| 525| 525| 				return;
| 526| 526| 			}
| 527| 527| 
|    | [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
| 531| 531| 
| 532| 532| 		// Try to move within range
| 533| 533| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 534|    |-		{
|    | 534|+		
| 535| 535| 			// We've started walking to the given point
| 536| 536| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 537|    |-		}
|    | 537|+		
| 538| 538| 		else
| 539| 539| 		{
| 540| 540| 			// 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
| 608| 608| 	"Order.Repair": function(msg) {
| 609| 609| 		// Try to move within range
| 610| 610| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 611|    |-		{
|    | 611|+		
| 612| 612| 			// We've started walking to the given point
| 613| 613| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 614|    |-		}
|    | 614|+		
| 615| 615| 		else
| 616| 616| 		{
| 617| 617| 			// 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
| 644| 644| 		}
| 645| 645| 
| 646| 646| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 647|    |-		{
|    | 647|+		
| 648| 648| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 649|    |-		}
|    | 649|+		
| 650| 650| 		else
| 651| 651| 		{
| 652| 652| 			// 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
| 772| 772| 			if (!this.CheckTargetAttackRange(target, target))
| 773| 773| 			{
| 774| 774| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 775|    |-				{
|    | 775|+				
| 776| 776| 					if (this.MoveToTargetAttackRange(target, target))
| 777| 777| 					{
| 778| 778| 						this.SetNextState("COMBAT.APPROACHING");
| 779| 779| 						return;
| 780| 780| 					}
| 781|    |-				}
|    | 781|+				
| 782| 782| 				this.FinishOrder();
| 783| 783| 				return;
| 784| 784| 			}
|    | [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
| 797| 797| 			}
| 798| 798| 			// Check if we are already in range, otherwise walk there
| 799| 799| 			if (!this.CheckGarrisonRange(msg.data.target))
| 800|    |-			{
|    | 800|+			
| 801| 801| 				if (!this.CheckTargetVisible(msg.data.target))
| 802| 802| 				{
| 803| 803| 					this.FinishOrder();
| 812| 812| 						return;
| 813| 813| 					}
| 814| 814| 				}
| 815|    |-			}
|    | 815|+			
| 816| 816| 
| 817| 817| 			this.SetNextState("GARRISON.GARRISONING");
| 818| 818| 		},
|    | [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
| 804| 804| 					return;
| 805| 805| 				}
| 806| 806| 				else
| 807|    |-				{
|    | 807|+				
| 808| 808| 					// Out of range; move there in formation
| 809| 809| 					if (this.MoveToGarrisonRange(msg.data.target))
| 810| 810| 					{
| 811| 811| 						this.SetNextState("GARRISON.APPROACHING");
| 812| 812| 						return;
| 813| 813| 					}
| 814|    |-				}
|    | 814|+				
| 815| 815| 			}
| 816| 816| 
| 817| 817| 			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
| 803| 803| 					this.FinishOrder();
| 804| 804| 					return;
| 805| 805| 				}
| 806|    |-				else
| 807|    |-				{
|    | 806|+				
| 808| 807| 					// Out of range; move there in formation
| 809| 808| 					if (this.MoveToGarrisonRange(msg.data.target))
| 810| 809| 					{
| 811| 810| 						this.SetNextState("GARRISON.APPROACHING");
| 812| 811| 						return;
| 813| 812| 					}
| 814|    |-				}
|    | 813|+				
| 815| 814| 			}
| 816| 815| 
| 817| 816| 			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
| 830| 830| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 831| 831| 					}
| 832| 832| 					else
| 833|    |-					{
|    | 833|+					
| 834| 834| 						// We couldn't move there, or the target moved away
| 835| 835| 						this.FinishOrder();
| 836|    |-					}
|    | 836|+					
| 837| 837| 					return;
| 838| 838| 				}
| 839| 839| 
|    | [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
|1051|1051| 			},
|1052|1052| 		},
|1053|1053| 
|1054|    |-		"GARRISON":{
|    |1054|+		"GARRISON": {
|1055|1055| 			"enter": function() {
|1056|1056| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1057|1057| 				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
|1235|1235| 			// If the controller handled an order but some members rejected it,
|1236|1236| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1237|1237| 			if (this.orderQueue.length)
|1238|    |-			{
|    |1238|+			
|1239|1239| 				// We're leaving the formation, so stop our FormationWalk order
|1240|1240| 				if (this.FinishOrder())
|1241|1241| 					return;
|1242|    |-			}
|    |1242|+			
|1243|1243| 
|1244|1244| 			// No orders left, we're an individual now
|1245|1245| 			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
|1263|1263| 			// Move a tile outside the building
|1264|1264| 			let range = 4;
|1265|1265| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1266|    |-			{
|    |1266|+			
|1267|1267| 				// We've started walking to the given point
|1268|1268| 				this.SetNextState("WALKINGTOPOINT");
|1269|    |-			}
|    |1269|+			
|1270|1270| 			else
|1271|1271| 			{
|1272|1272| 				// 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
|1268|1268| 				this.SetNextState("WALKINGTOPOINT");
|1269|1269| 			}
|1270|1270| 			else
|1271|    |-			{
|    |1271|+			
|1272|1272| 				// We are already at the target, or can't move at all
|1273|1273| 				this.FinishOrder();
|1274|    |-			}
|    |1274|+			
|1275|1275| 		},
|1276|1276| 
|1277|1277| 
|    | [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
|1469|1469| 
|1470|1470| 			"LosRangeUpdate": function(msg) {
|1471|1471| 				if (this.GetStance().targetVisibleEnemies)
|1472|    |-				{
|    |1472|+				
|1473|1473| 					// Start attacking one of the newly-seen enemy (if any)
|1474|1474| 					this.AttackEntitiesByPreference(msg.data.added);
|1475|    |-				}
|    |1475|+				
|1476|1476| 			},
|1477|1477| 
|1478|1478| 			"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
|1655|1655| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1656|1656| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1657|1657| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1658|    |-						{
|    |1658|+						
|1659|1659| 							if (this.CanHeal(this.isGuardOf))
|1660|1660| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1661|1661| 							else if (this.CanRepair(this.isGuardOf))
|1662|1662| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1663|    |-						}
|    |1663|+						
|1664|1664| 					}
|1665|1665| 				},
|1666|1666| 
|    | [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
|1743|1743| 				"MoveCompleted": function() {
|1744|1744| 
|1745|1745| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1746|    |-					{
|    |1746|+					
|1747|1747| 						// If the unit needs to unpack, do so
|1748|1748| 						if (this.CanUnpack())
|1749|1749| 						{
|1752|1752| 						}
|1753|1753| 						else
|1754|1754| 							this.SetNextState("ATTACKING");
|1755|    |-					}
|    |1755|+					
|1756|1756| 					else
|1757|1757| 					{
|1758|1758| 						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
|1750|1750| 							this.PushOrderFront("Unpack", { "force": true });
|1751|1751| 							return;
|1752|1752| 						}
|1753|    |-						else
|1754|    |-							this.SetNextState("ATTACKING");
|    |1753|+						this.SetNextState("ATTACKING");
|1755|1754| 					}
|1756|1755| 					else
|1757|1756| 					{
|    | [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
|1754|1754| 							this.SetNextState("ATTACKING");
|1755|1755| 					}
|1756|1756| 					else
|1757|    |-					{
|    |1757|+					
|1758|1758| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1759|1759| 						{
|1760|1760| 							this.SetNextState("APPROACHING");
|1764|1764| 							// Give up
|1765|1765| 							this.FinishOrder();
|1766|1766| 						}
|1767|    |-					}
|    |1767|+					
|1768|1768| 				},
|1769|1769| 			},
|1770|1770| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1756|1756| 					else
|1757|1757| 					{
|1758|1758| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1759|    |-						{
|    |1759|+						
|1760|1760| 							this.SetNextState("APPROACHING");
|1761|    |-						}
|    |1761|+						
|1762|1762| 						else
|1763|1763| 						{
|1764|1764| 							// 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
|1760|1760| 							this.SetNextState("APPROACHING");
|1761|1761| 						}
|1762|1762| 						else
|1763|    |-						{
|    |1763|+						
|1764|1764| 							// Give up
|1765|1765| 							this.FinishOrder();
|1766|    |-						}
|    |1766|+						
|1767|1767| 					}
|1768|1768| 				},
|1769|1769| 			},
|    | [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
|1781|1781| 					}
|1782|1782| 					// Check the target is still alive and attackable
|1783|1783| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1784|    |-					{
|    |1784|+					
|1785|1785| 						// Can't reach it - try to chase after it
|1786|1786| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1787|1787| 						{
|1796|1796| 								return;
|1797|1797| 							}
|1798|1798| 						}
|1799|    |-					}
|    |1799|+					
|1800|1800| 
|1801|1801| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1802|1802| 					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
|1827|1827| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1828|1828| 
|1829|1829| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1830|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1830|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1831|1831| 
|1832|1832| 					this.FaceTowardsTarget(this.order.data.target);
|1833|1833| 
|    | [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
|1956|1956| 
|1957|1957| 				"Attacked": function(msg) {
|1958|1958| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1959|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1960|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1959|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1960|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1961|1961| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1962|1962| 				},
|1963|1963| 			},
|    | [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
|2040|2040| 						// Also don't switch to a different type of huntable animal
|2041|2041| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2042|2042| 							return (
|2043|    |-								ent != oldTarget
|2044|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2043|+								ent != oldTarget &&
|    |2044|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2045|2045| 								 || (type.specific == oldType.specific
|2046|2046| 								 && (type.specific != "meat" || oldTemplate == template)))
|2047|2047| 							);
|    | [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
|2041|2041| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2042|2042| 							return (
|2043|2043| 								ent != oldTarget
|2044|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2045|    |-								 || (type.specific == oldType.specific
|    |2044|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2045|+								 (type.specific == oldType.specific
|2046|2046| 								 && (type.specific != "meat" || oldTemplate == template)))
|2047|2047| 							);
|2048|2048| 						}, 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
|2042|2042| 							return (
|2043|2043| 								ent != oldTarget
|2044|2044| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2045|    |-								 || (type.specific == oldType.specific
|2046|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2045|+								 || (type.specific == oldType.specific &&
|    |2046|+								 (type.specific != "meat" || oldTemplate == template)))
|2047|2047| 							);
|2048|2048| 						}, oldTarget);
|2049|2049| 						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
|2051|2051| 							this.PerformGather(nearby, false, false);
|2052|2052| 							return true;
|2053|2053| 						}
|2054|    |-						else
|2055|    |-						{
|    |2054|+						
|2056|2055| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2057|2056| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2058|2057| 							// to order it to GatherNear the resource position.
|2073|2072| 									return true;
|2074|2073| 								}
|2075|2074| 							}
|2076|    |-						}
|    |2075|+						
|2077|2076| 						return true;
|2078|2077| 					}
|2079|2078| 					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
|2063|2063| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2064|2064| 								return true;
|2065|2065| 							}
|2066|    |-							else
|2067|    |-							{
|    |2066|+							
|2068|2067| 								// we're kind of stuck here. Return resource.
|2069|2068| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2070|2069| 								if (nearby)
|2072|2071| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2073|2072| 									return true;
|2074|2073| 								}
|2075|    |-							}
|    |2074|+							
|2076|2075| 						}
|2077|2076| 						return true;
|2078|2077| 					}
|    | [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
|2105|2105| 						// Also don't switch to a different type of huntable animal
|2106|2106| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2107|2107| 							return (
|2108|    |-								ent != oldTarget
|2109|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2108|+								ent != oldTarget &&
|    |2109|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2110|2110| 								|| (type.specific == oldType.specific
|2111|2111| 								&& (type.specific != "meat" || oldTemplate == template)))
|2112|2112| 							);
|    | [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
|2106|2106| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2107|2107| 							return (
|2108|2108| 								ent != oldTarget
|2109|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2110|    |-								|| (type.specific == oldType.specific
|    |2109|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2110|+								(type.specific == oldType.specific
|2111|2111| 								&& (type.specific != "meat" || oldTemplate == template)))
|2112|2112| 							);
|2113|2113| 						});
|    | [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
|2107|2107| 							return (
|2108|2108| 								ent != oldTarget
|2109|2109| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2110|    |-								|| (type.specific == oldType.specific
|2111|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2110|+								|| (type.specific == oldType.specific &&
|    |2111|+								(type.specific != "meat" || oldTemplate == template)))
|2112|2112| 							);
|2113|2113| 						});
|2114|2114| 						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
|2152|2152| 					// Also don't switch to a different type of huntable animal
|2153|2153| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2154|2154| 						return (
|2155|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2156|    |-							|| (type.specific == resourceType.specific
|    |2155|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2156|+							(type.specific == resourceType.specific
|2157|2157| 							&& (type.specific != "meat" || resourceTemplate == template))
|2158|2158| 						);
|2159|2159| 					});
|    | [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
|2153|2153| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2154|2154| 						return (
|2155|2155| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2156|    |-							|| (type.specific == resourceType.specific
|2157|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2156|+							|| (type.specific == resourceType.specific &&
|    |2157|+							(type.specific != "meat" || resourceTemplate == template))
|2158|2158| 						);
|2159|2159| 					});
|2160|2160| 
|    | [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
|2269|2269| 
|2270|2270| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2271|2271| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2272|    |-					{
|    |2272|+					
|2273|2273| 						// Check we can still reach and gather from the target
|2274|2274| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2275|2275| 						{
|2335|2335| 								return;
|2336|2336| 							}
|2337|2337| 						}
|2338|    |-					}
|    |2338|+					
|2339|2339| 
|2340|2340| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2341|2341| 
|    | [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
|2361|2361| 					// Also don't switch to a different type of huntable animal
|2362|2362| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2363|2363| 						return (
|2364|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2365|    |-							|| (type.specific == resourceType.specific
|    |2364|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2365|+							(type.specific == resourceType.specific
|2366|2366| 							&& (type.specific != "meat" || resourceTemplate == template))
|2367|2367| 						);
|2368|2368| 					});
|    | [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
|2362|2362| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2363|2363| 						return (
|2364|2364| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2365|    |-							|| (type.specific == resourceType.specific
|2366|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2365|+							|| (type.specific == resourceType.specific &&
|    |2366|+							(type.specific != "meat" || resourceTemplate == template))
|2367|2367| 						);
|2368|2368| 					});
|2369|2369| 					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
|2449|2449| 					this.StartTimer(prepare, this.healTimers.repeat);
|2450|2450| 
|2451|2451| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2452|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2452|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2453|2453| 
|2454|2454| 					this.FaceTowardsTarget(this.order.data.target);
|2455|2455| 				},
|    | [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
|2664|2664| 					{
|2665|2665| 						// The building was already finished/fully repaired before we arrived;
|2666|2666| 						// let the ConstructionFinished handler handle this.
|2667|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2667|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2668|2668| 						return true;
|2669|2669| 					}
|2670|2670| 
|    | [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
|2664|2664| 					{
|2665|2665| 						// The building was already finished/fully repaired before we arrived;
|2666|2666| 						// let the ConstructionFinished handler handle this.
|2667|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2667|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2668|2668| 						return true;
|2669|2669| 					}
|2670|2670| 
|    | [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
|2704|2704| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2705|2705| 						this.SetNextState("APPROACHING");
|2706|2706| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2707|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2707|+						this.FinishOrder(); // can't approach and isn't in reach
|2708|2708| 				},
|2709|2709| 			},
|2710|2710| 
|    | [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
|2791|2791| 
|2792|2792| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2793|2793| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2794|    |-				{
|    |2794|+				
|2795|2795| 					// We're already walking to the given point, so add this as a order.
|2796|2796| 					this.WalkToTarget(msg.data.newentity, true);
|2797|    |-				}
|    |2797|+				
|2798|2798| 			},
|2799|2799| 		},
|2800|2800| 
|    | [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
|2844|2844| 
|2845|2845| 					// Check that we can garrison here
|2846|2846| 					if (this.CanGarrison(target))
|2847|    |-					{
|    |2847|+					
|2848|2848| 						// Check that we're in range of the garrison target
|2849|2849| 						if (this.CheckGarrisonRange(target))
|2850|2850| 						{
|2920|2920| 								return false;
|2921|2921| 							}
|2922|2922| 						}
|2923|    |-					}
|    |2923|+					
|2924|2924| 					// Garrisoning failed for some reason, so finish the order
|2925|2925| 					this.FinishOrder();
|2926|2926| 					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
|3027|3027| 		"Attacked": function(msg) {
|3028|3028| 			if (this.template.NaturalBehaviour == "skittish" ||
|3029|3029| 			    this.template.NaturalBehaviour == "passive")
|3030|    |-			{
|    |3030|+			
|3031|3031| 				this.Flee(msg.data.attacker, false);
|3032|    |-			}
|    |3032|+			
|3033|3033| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3034|3034| 			{
|3035|3035| 				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
|3036|3036| 					this.Attack(msg.data.attacker, false);
|3037|3037| 			}
|3038|3038| 			else if (this.template.NaturalBehaviour == "domestic")
|3039|    |-			{
|    |3039|+			
|3040|3040| 				// Never flee, stop what we were doing
|3041|3041| 				this.SetNextState("IDLE");
|3042|    |-			}
|    |3042|+			
|3043|3043| 		},
|3044|3044| 
|3045|3045| 		"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
|3046|3046| 			// Move a tile outside the building
|3047|3047| 			var range = 4;
|3048|3048| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3049|    |-			{
|    |3049|+			
|3050|3050| 				// We've started walking to the given point
|3051|3051| 				this.SetNextState("WALKING");
|3052|    |-			}
|    |3052|+			
|3053|3053| 			else
|3054|3054| 			{
|3055|3055| 				// 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
|3051|3051| 				this.SetNextState("WALKING");
|3052|3052| 			}
|3053|3053| 			else
|3054|    |-			{
|    |3054|+			
|3055|3055| 				// We are already at the target, or can't move at all
|3056|3056| 				this.FinishOrder();
|3057|    |-			}
|    |3057|+			
|3058|3058| 		},
|3059|3059| 
|3060|3060| 		"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
|3093|3093| 				}
|3094|3094| 				// Start attacking one of the newly-seen enemy (if any)
|3095|3095| 				else if (this.IsDangerousAnimal())
|3096|    |-				{
|    |3096|+				
|3097|3097| 					this.AttackVisibleEntity(msg.data.added);
|3098|    |-				}
|    |3098|+				
|3099|3099| 
|3100|3100| 				// TODO: if two units enter our range together, we'll attack the
|3101|3101| 				// 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
|3136|3136| 				}
|3137|3137| 				// Start attacking one of the newly-seen enemy (if any)
|3138|3138| 				else if (this.template.NaturalBehaviour == "violent")
|3139|    |-				{
|    |3139|+				
|3140|3140| 					this.AttackVisibleEntity(msg.data.added);
|3141|    |-				}
|    |3141|+				
|3142|3142| 			},
|3143|3143| 
|3144|3144| 			"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
|3153|3153| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3154|3154| 
|3155|3155| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3156|    |-							// only used for domestic animals
|    |3156|+		// only used for domestic animals
|3157|3157| 	},
|3158|3158| };
|3159|3159| 
|    | [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
|3210|3210| 
|3211|3211| UnitAI.prototype.IsAnimal = function()
|3212|3212| {
|3213|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3213|+	return (!!this.template.NaturalBehaviour);
|3214|3214| };
|3215|3215| 
|3216|3216| 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
|3248|3248| UnitAI.prototype.GetGarrisonHolder = function()
|3249|3249| {
|3250|3250| 	if (this.IsGarrisoned())
|3251|    |-	{
|    |3251|+	
|3252|3252| 		for (let order of this.orderQueue)
|3253|3253| 			if (order.type == "Garrison")
|3254|3254| 				return order.data.target;
|3255|    |-	}
|    |3255|+	
|3256|3256| 	return INVALID_ENTITY;
|3257|3257| };
|3258|3258| 
|    | [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
|3326|3326| 		{
|3327|3327| 			let index = this.GetCurrentState().indexOf(".");
|3328|3328| 			if (index != -1)
|3329|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3329|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3330|3330| 			this.Stop(false);
|3331|3331| 		}
|3332|3332| 
|    | [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
|3382|3382| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3383|3383| 			continue;
|3384|3384| 		if (i == 0)
|3385|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3385|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3386|3386| 		else
|3387|3387| 			this.orderQueue.splice(i, 1);
|3388|3388| 		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
|3382|3382| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3383|3383| 			continue;
|3384|3384| 		if (i == 0)
|3385|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3385|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3386|3386| 		else
|3387|3387| 			this.orderQueue.splice(i, 1);
|3388|3388| 		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
|3466|3466| };
|3467|3467| 
|3468|3468| 
|3469|    |-//// FSM linkage functions ////
|    |3469|+// // FSM linkage functions ////
|3470|3470| 
|3471|3471| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3472|3472| 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
|3638|3638| 				continue;
|3639|3639| 			if (this.orderQueue[i].type == type)
|3640|3640| 				continue;
|3641|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3641|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3642|3642| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3643|3643| 			return;
|3644|3644| 		}
|    | [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
|3638|3638| 				continue;
|3639|3639| 			if (this.orderQueue[i].type == type)
|3640|3640| 				continue;
|3641|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3641|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3642|3642| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3643|3643| 			return;
|3644|3644| 		}
|    | [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
|3652|3652| {
|3653|3653| 	// Remember the previous work orders to be able to go back to them later if required
|3654|3654| 	if (data && data.force)
|3655|    |-	{
|    |3655|+	
|3656|3656| 		if (this.IsFormationController())
|3657|3657| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3658|3658| 		else
|3659|3659| 			this.UpdateWorkOrders(type);
|3660|    |-	}
|    |3660|+	
|3661|3661| 
|3662|3662| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3663|3663| 
|    | [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
|3729|3729| 	{
|3730|3730| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3731|3731| 		if (cmpUnitAI)
|3732|    |-		{
|    |3732|+		
|3733|3733| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3734|3734| 			{
|3735|3735| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3738|3738| 					return;
|3739|3739| 				}
|3740|3740| 			}
|3741|    |-		}
|    |3741|+		
|3742|3742| 	}
|3743|3743| 
|3744|3744| 	// 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
|3731|3731| 		if (cmpUnitAI)
|3732|3732| 		{
|3733|3733| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3734|    |-			{
|    |3734|+			
|3735|3735| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3736|3736| 				{
|3737|3737| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3738|3738| 					return;
|3739|3739| 				}
|3740|    |-			}
|    |3740|+			
|3741|3741| 		}
|3742|3742| 	}
|3743|3743| 
|    | [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
|3743|3743| 
|3744|3744| 	// If nothing found, take the unit orders
|3745|3745| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3746|    |-	{
|    |3746|+	
|3747|3747| 		if (isWorkType(this.orderQueue[i].type))
|3748|3748| 		{
|3749|3749| 			this.workOrders = this.orderQueue.slice(i);
|3750|3750| 			return;
|3751|3751| 		}
|3752|    |-	}
|    |3752|+	
|3753|3753| };
|3754|3754| 
|3755|3755| 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
|3809|3809| 	if (data.timerRepeat === undefined)
|3810|3810| 		this.timer = undefined;
|3811|3811| 
|3812|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3812|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3813|3813| };
|3814|3814| 
|3815|3815| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3809|3809| 	if (data.timerRepeat === undefined)
|3810|3810| 		this.timer = undefined;
|3811|3811| 
|3812|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3812|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3813|3813| };
|3814|3814| 
|3815|3815| /**
|    | [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
|3844|3844| 	this.timer = undefined;
|3845|3845| };
|3846|3846| 
|3847|    |-//// Message handlers /////
|    |3847|+// // Message handlers /////
|3848|3848| 
|3849|3849| UnitAI.prototype.OnMotionChanged = function(msg)
|3850|3850| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3849|3849| UnitAI.prototype.OnMotionChanged = function(msg)
|3850|3850| {
|3851|3851| 	if (msg.starting && !msg.error)
|3852|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3852|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3853|3853| 	else if (!msg.starting || msg.error)
|3854|3854| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3855|3855| };
|    | [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
|3849|3849| UnitAI.prototype.OnMotionChanged = function(msg)
|3850|3850| {
|3851|3851| 	if (msg.starting && !msg.error)
|3852|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3852|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3853|3853| 	else if (!msg.starting || msg.error)
|3854|3854| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3855|3855| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3851|3851| 	if (msg.starting && !msg.error)
|3852|3852| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3853|3853| 	else if (!msg.starting || msg.error)
|3854|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3854|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3855|3855| };
|3856|3856| 
|3857|3857| 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
|3851|3851| 	if (msg.starting && !msg.error)
|3852|3852| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3853|3853| 	else if (!msg.starting || msg.error)
|3854|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3854|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3855|3855| };
|3856|3856| 
|3857|3857| 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
|3859|3859| 	// TODO: This is a bit inefficient since every unit listens to every
|3860|3860| 	// construction message - ideally we could scope it to only the one we're building
|3861|3861| 
|3862|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3862|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3863|3863| };
|3864|3864| 
|3865|3865| 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
|3859|3859| 	// TODO: This is a bit inefficient since every unit listens to every
|3860|3860| 	// construction message - ideally we could scope it to only the one we're building
|3861|3861| 
|3862|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3862|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3863|3863| };
|3864|3864| 
|3865|3865| 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
|3884|3884| 
|3885|3885| UnitAI.prototype.OnAttacked = function(msg)
|3886|3886| {
|3887|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3887|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3888|3888| };
|3889|3889| 
|3890|3890| 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
|3884|3884| 
|3885|3885| UnitAI.prototype.OnAttacked = function(msg)
|3886|3886| {
|3887|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3887|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3888|3888| };
|3889|3889| 
|3890|3890| 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
|3889|3889| 
|3890|3890| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3891|3891| {
|3892|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3892|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3893|3893| };
|3894|3894| 
|3895|3895| 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
|3889|3889| 
|3890|3890| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3891|3891| {
|3892|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3892|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3893|3893| };
|3894|3894| 
|3895|3895| 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
|3894|3894| 
|3895|3895| UnitAI.prototype.OnHealthChanged = function(msg)
|3896|3896| {
|3897|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3897|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3898|3898| };
|3899|3899| 
|3900|3900| 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
|3894|3894| 
|3895|3895| UnitAI.prototype.OnHealthChanged = function(msg)
|3896|3896| {
|3897|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3897|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3898|3898| };
|3899|3899| 
|3900|3900| 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
|3900|3900| UnitAI.prototype.OnRangeUpdate = function(msg)
|3901|3901| {
|3902|3902| 	if (msg.tag == this.losRangeQuery)
|3903|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3903|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3904|3904| 	else if (msg.tag == this.losHealRangeQuery)
|3905|3905| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3906|3906| };
|    | [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
|3900|3900| UnitAI.prototype.OnRangeUpdate = function(msg)
|3901|3901| {
|3902|3902| 	if (msg.tag == this.losRangeQuery)
|3903|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3903|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3904|3904| 	else if (msg.tag == this.losHealRangeQuery)
|3905|3905| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3906|3906| };
|    | [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
|3902|3902| 	if (msg.tag == this.losRangeQuery)
|3903|3903| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3904|3904| 	else if (msg.tag == this.losHealRangeQuery)
|3905|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3905|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3906|3906| };
|3907|3907| 
|3908|3908| 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
|3902|3902| 	if (msg.tag == this.losRangeQuery)
|3903|3903| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3904|3904| 	else if (msg.tag == this.losHealRangeQuery)
|3905|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3905|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3906|3906| };
|3907|3907| 
|3908|3908| 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
|3907|3907| 
|3908|3908| UnitAI.prototype.OnPackFinished = function(msg)
|3909|3909| {
|3910|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3910|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3911|3911| };
|3912|3912| 
|3913|3913| //// 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
|3907|3907| 
|3908|3908| UnitAI.prototype.OnPackFinished = function(msg)
|3909|3909| {
|3910|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3910|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3911|3911| };
|3912|3912| 
|3913|3913| //// 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
|3910|3910| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3911|3911| };
|3912|3912| 
|3913|    |-//// Helper functions to be called by the FSM ////
|    |3913|+// // Helper functions to be called by the FSM ////
|3914|3914| 
|3915|3915| UnitAI.prototype.GetWalkSpeed = function()
|3916|3916| {
|    | [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
|4014|4014| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4015|4015| 		return undefined;
|4016|4016| 
|4017|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4017|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4018|4018| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4019|4019| 		return undefined;
|4020|4020| 
|    | [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
|4099|4099| 			PlaySound(name, member);
|4100|4100| 	}
|4101|4101| 	else
|4102|    |-	{
|    |4102|+	
|4103|4103| 		// Otherwise use our own sounds
|4104|4104| 		PlaySound(name, this.entity);
|4105|    |-	}
|    |4105|+	
|4106|4106| };
|4107|4107| 
|4108|4108| /*
|    | [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
|4268|4268| 	else
|4269|4269| 		// return false? Or hope you come close enough?
|4270|4270| 		var parabolicMaxRange = 0;
|4271|    |-		//return false;
|    |4271|+		// return false;
|4272|4272| 
|4273|4273| 	// the parabole changes while walking, take something in the middle
|4274|4274| 	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
|4333|4333| 	if (this.IsFormationMember())
|4334|4334| 	{
|4335|4335| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4336|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4337|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4336|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4337|+			cmpFormationUnitAI.order.data.target == target)
|4338|4338| 			return true;
|4339|4339| 	}
|4340|4340| 
|    | [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
|4501|4501| UnitAI.prototype.AttackEntityInZone = function(ents)
|4502|4502| {
|4503|4503| 	var target = ents.find(target =>
|4504|    |-		this.CanAttack(target)
|4505|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4504|+		this.CanAttack(target) &&
|    |4505|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4506|4506| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4507|4507| 	);
|4508|4508| 	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
|4502|4502| {
|4503|4503| 	var target = ents.find(target =>
|4504|4504| 		this.CanAttack(target)
|4505|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4506|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4505|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4506|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4507|4507| 	);
|4508|4508| 	if (!target)
|4509|4509| 		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
|4566|4566| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4567|4567| 	if (this.isGuardOf)
|4568|4568| 	{
|4569|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4569|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4570|4570| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4571|4571| 		if (cmpUnitAI && cmpAttack &&
|4572|4572| 		    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
|4570|4570| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4571|4571| 		if (cmpUnitAI && cmpAttack &&
|4572|4572| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4573|    |-				return false;
|    |4573|+			return false;
|4574|4574| 	}
|4575|4575| 
|4576|4576| 	// 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
|4575|4575| 
|4576|4576| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4577|4577| 	if (this.GetStance().respondHoldGround)
|4578|    |-	{
|    |4578|+	
|4579|4579| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4580|4580| 			return true;
|4581|    |-	}
|    |4581|+	
|4582|4582| 
|4583|4583| 	// Stop if it's left our vision range, unless we're especially persistent
|4584|4584| 	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
|4582|4582| 
|4583|4583| 	// Stop if it's left our vision range, unless we're especially persistent
|4584|4584| 	if (!this.GetStance().respondChaseBeyondVision)
|4585|    |-	{
|    |4585|+	
|4586|4586| 		if (!this.CheckTargetIsInVisionRange(target))
|4587|4587| 			return true;
|4588|    |-	}
|    |4588|+	
|4589|4589| 
|4590|4590| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4591|4591| 	// 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
|4608|4608| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4609|4609| 	if (this.isGuardOf)
|4610|4610| 	{
|4611|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4611|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4612|4612| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4613|4613| 		if (cmpUnitAI && cmpAttack &&
|4614|4614| 		    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
|4621|4621| 	return false;
|4622|4622| };
|4623|4623| 
|4624|    |-//// External interface functions ////
|    |4624|+// // External interface functions ////
|4625|4625| 
|4626|4626| UnitAI.prototype.SetFormationController = function(ent)
|4627|4627| {
|    | [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
|4631|4631| 	// of our own formation (or ourself if not in formation)
|4632|4632| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4633|4633| 	if (cmpObstruction)
|4634|    |-	{
|    |4634|+	
|4635|4635| 		if (ent == INVALID_ENTITY)
|4636|4636| 			cmpObstruction.SetControlGroup(this.entity);
|4637|4637| 		else
|4638|4638| 			cmpObstruction.SetControlGroup(ent);
|4639|    |-	}
|    |4639|+	
|4640|4640| 
|4641|4641| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4642|4642| 	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
|4774|4774| 	// if we already had an old guard order, do nothing if the target is the same
|4775|4775| 	// and the order is running, otherwise remove the previous order
|4776|4776| 	if (this.isGuardOf)
|4777|    |-	{
|    |4777|+	
|4778|4778| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4779|4779| 			return;
|4780|4780| 		else
|4781|4781| 			this.RemoveGuard();
|4782|    |-	}
|    |4782|+	
|4783|4783| 
|4784|4784| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4785|4785| };
|    | [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
|4777|4777| 	{
|4778|4778| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4779|4779| 			return;
|4780|    |-		else
|4781|    |-			this.RemoveGuard();
|    |4780|+		this.RemoveGuard();
|4782|4781| 	}
|4783|4782| 
|4784|4783| 	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
|4948|4948| 			this.WalkToTarget(target, queued);
|4949|4949| 		return;
|4950|4950| 	}
|4951|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4951|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4952|4952| };
|4953|4953| 
|4954|4954| /**
|    | [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
|5097|5097| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5098|5098| 	{
|5099|5099| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5100|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5100|+		if (cmpTrader.HasBothMarkets() &&
|5101|5101| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5102|5102| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5103|5103| 		{
|    | [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
|5378|5378| 				{
|5379|5379| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5380|5380| 					var targetClasses = this.order.data.targetClasses;
|5381|    |-					if (targetClasses.attack && cmpIdentity
|5382|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5381|+					if (targetClasses.attack && cmpIdentity &&
|    |5382|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5383|5383| 						continue;
|5384|5384| 					if (targetClasses.avoid && cmpIdentity
|5385|5385| 						&& 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
|5381|5381| 					if (targetClasses.attack && cmpIdentity
|5382|5382| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5383|5383| 						continue;
|5384|    |-					if (targetClasses.avoid && cmpIdentity
|5385|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5384|+					if (targetClasses.avoid && cmpIdentity &&
|    |5385|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5386|5386| 						continue;
|5387|5387| 					// Only used by the AIs to prevent some choices of targets
|5388|5388| 					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
|5404|5404| 		{
|5405|5405| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5406|5406| 			var targetClasses = this.order.data.targetClasses;
|5407|    |-			if (cmpIdentity && targetClasses.attack
|5408|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5407|+			if (cmpIdentity && targetClasses.attack &&
|    |5408|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5409|5409| 				continue;
|5410|5410| 			if (cmpIdentity && targetClasses.avoid
|5411|5411| 				&& 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
|5407|5407| 			if (cmpIdentity && targetClasses.attack
|5408|5408| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5409|5409| 				continue;
|5410|    |-			if (cmpIdentity && targetClasses.avoid
|5411|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5410|+			if (cmpIdentity && targetClasses.avoid &&
|    |5411|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5412|5412| 				continue;
|5413|5413| 			// Only used by the AIs to prevent some choices of targets
|5414|5414| 			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
|5540|5540| 
|5541|5541| UnitAI.prototype.SetHeldPosition = function(x, z)
|5542|5542| {
|5543|    |-	this.heldPosition = {"x": x, "z": z};
|    |5543|+	this.heldPosition = { "x": x, "z": z};
|5544|5544| };
|5545|5545| 
|5546|5546| 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
|5540|5540| 
|5541|5541| UnitAI.prototype.SetHeldPosition = function(x, z)
|5542|5542| {
|5543|    |-	this.heldPosition = {"x": x, "z": z};
|    |5543|+	this.heldPosition = {"x": x, "z": z };
|5544|5544| };
|5545|5545| 
|5546|5546| 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
|5567|5567| 	return false;
|5568|5568| };
|5569|5569| 
|5570|    |-//// Helper functions ////
|    |5570|+// // Helper functions ////
|5571|5571| 
|5572|5572| UnitAI.prototype.CanAttack = function(target)
|5573|5573| {
|    | [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
|5771|5771| 	return cmpPack && cmpPack.IsPacking();
|5772|5772| };
|5773|5773| 
|5774|    |-//// Formation specific functions ////
|    |5774|+// // Formation specific functions ////
|5775|5775| 
|5776|5776| UnitAI.prototype.IsAttackingAsFormation = function()
|5777|5777| {
|    | [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
|5776|5776| UnitAI.prototype.IsAttackingAsFormation = function()
|5777|5777| {
|5778|5778| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5779|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5780|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5779|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5780|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5781|5781| };
|5782|5782| 
|5783|5783| //// 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
|5780|5780| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5781|5781| };
|5782|5782| 
|5783|    |-//// Animal specific functions ////
|    |5783|+// // Animal specific functions ////
|5784|5784| 
|5785|5785| UnitAI.prototype.MoveRandomly = function(distance)
|5786|5786| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2351| »   »   »   »   »   »   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
|3714| »   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
|4488| »   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
|4503| »   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
|4549| »   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
|4572| »   »   ····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
|5028| »   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
| 303| »   »   ····&&·(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
|1819| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|1960| »   »   »   »   »   »   &&·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
|2044| »   »   »   »   »   »   »   »   ·&&·((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
|2045| »   »   »   »   »   »   »   »   ·||·(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
|2046| »   »   »   »   »   »   »   »   ·&&·(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
|2069| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4281| »   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
|4337| »   »   »   &&·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
|4505| »   »   &&·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
|4506| »   »   &&·(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
|5028| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5497| »   »   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/1032/

Stan updated this revision to Diff 7446.Feb 4 2019, 6:03 PM
Stan added a reviewer: Restricted Owners Package.
Vulcan added a comment.Feb 4 2019, 6:05 PM

Build failure - The Moirai have given mortals hearts that can endure.

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
| 166| 166| 		// Move a tile outside the building
| 167| 167| 		let range = 4;
| 168| 168| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 169|    |-		{
|    | 169|+		
| 170| 170| 			// We've started walking to the given point
| 171| 171| 			this.SetNextState("INDIVIDUAL.WALKING");
| 172|    |-		}
|    | 172|+		
| 173| 173| 		else
| 174| 174| 		{
| 175| 175| 			// 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
| 171| 171| 			this.SetNextState("INDIVIDUAL.WALKING");
| 172| 172| 		}
| 173| 173| 		else
| 174|    |-		{
|    | 174|+		
| 175| 175| 			// We are already at the target, or can't move at all
| 176| 176| 			this.FinishOrder();
| 177|    |-		}
|    | 177|+		
| 178| 178| 	},
| 179| 179| 
| 180| 180| 	// 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
| 273| 273| 
| 274| 274| 		var ok = this.MoveToTarget(this.order.data.target);
| 275| 275| 		if (ok)
| 276|    |-		{
|    | 276|+		
| 277| 277| 			// We've started walking to the given point
| 278| 278| 			if (this.IsAnimal())
| 279| 279| 				this.SetNextState("ANIMAL.WALKING");
| 280| 280| 			else
| 281| 281| 				this.SetNextState("INDIVIDUAL.WALKING");
| 282|    |-		}
|    | 282|+		
| 283| 283| 		else
| 284| 284| 		{
| 285| 285| 			// 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
| 301| 301| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 302| 302| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 303| 303| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 304|    |-		{
|    | 304|+		
| 305| 305| 			// we were already on the shoreline, and have not moved since
| 306| 306| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 307| 307| 				needToMove = false;
| 308|    |-		}
|    | 308|+		
| 309| 309| 
| 310| 310| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 311| 311| 		// 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
| 299| 299| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 300| 300| 		var needToMove = true;
| 301| 301| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 302|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 303|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 302|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 303|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 304| 304| 		{
| 305| 305| 			// we were already on the shoreline, and have not moved since
| 306| 306| 			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
| 310| 310| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 311| 311| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 312| 312| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 313|    |-		{
|    | 313|+		
| 314| 314| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 315|    |-		}
|    | 315|+		
| 316| 316| 		else
| 317| 317| 		{
| 318| 318| 			// 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
| 339| 339| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 340| 340| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 341| 341| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 342|    |-		{
|    | 342|+		
| 343| 343| 			// We've started fleeing from the given target
| 344| 344| 			if (this.IsAnimal())
| 345| 345| 				this.SetNextState("ANIMAL.FLEEING");
| 346| 346| 			else
| 347| 347| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 348|    |-		}
|    | 348|+		
| 349| 349| 		else
| 350| 350| 		{
| 351| 351| 			// 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
| 386| 386| 			}
| 387| 387| 
| 388| 388| 			if (this.order.data.attackType == this.oldAttackType)
| 389|    |-			{
|    | 389|+			
| 390| 390| 				if (this.IsAnimal())
| 391| 391| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 392| 392| 				else
| 393| 393| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 394|    |-			}
|    | 394|+			
| 395| 395| 			else
| 396| 396| 			{
| 397| 397| 				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
| 393| 393| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 394| 394| 			}
| 395| 395| 			else
| 396|    |-			{
|    | 396|+			
| 397| 397| 				if (this.IsAnimal())
| 398| 398| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 399| 399| 				else
| 400| 400| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 401|    |-			}
|    | 401|+			
| 402| 402| 			return;
| 403| 403| 		}
| 404| 404| 
|    | [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
| 518| 518| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 519| 519| 				}
| 520| 520| 				else
| 521|    |-				{
|    | 521|+				
| 522| 522| 					// We couldn't move there, or the target moved away
| 523| 523| 					this.FinishOrder();
| 524|    |-				}
|    | 524|+				
| 525| 525| 				return;
| 526| 526| 			}
| 527| 527| 
|    | [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
| 531| 531| 
| 532| 532| 		// Try to move within range
| 533| 533| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 534|    |-		{
|    | 534|+		
| 535| 535| 			// We've started walking to the given point
| 536| 536| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 537|    |-		}
|    | 537|+		
| 538| 538| 		else
| 539| 539| 		{
| 540| 540| 			// 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
| 608| 608| 	"Order.Repair": function(msg) {
| 609| 609| 		// Try to move within range
| 610| 610| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 611|    |-		{
|    | 611|+		
| 612| 612| 			// We've started walking to the given point
| 613| 613| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 614|    |-		}
|    | 614|+		
| 615| 615| 		else
| 616| 616| 		{
| 617| 617| 			// 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
| 644| 644| 		}
| 645| 645| 
| 646| 646| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 647|    |-		{
|    | 647|+		
| 648| 648| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 649|    |-		}
|    | 649|+		
| 650| 650| 		else
| 651| 651| 		{
| 652| 652| 			// 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
| 772| 772| 			if (!this.CheckTargetAttackRange(target, target))
| 773| 773| 			{
| 774| 774| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 775|    |-				{
|    | 775|+				
| 776| 776| 					if (this.MoveToTargetAttackRange(target, target))
| 777| 777| 					{
| 778| 778| 						this.SetNextState("COMBAT.APPROACHING");
| 779| 779| 						return;
| 780| 780| 					}
| 781|    |-				}
|    | 781|+				
| 782| 782| 				this.FinishOrder();
| 783| 783| 				return;
| 784| 784| 			}
|    | [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
| 797| 797| 			}
| 798| 798| 			// Check if we are already in range, otherwise walk there
| 799| 799| 			if (!this.CheckGarrisonRange(msg.data.target))
| 800|    |-			{
|    | 800|+			
| 801| 801| 				if (!this.CheckTargetVisible(msg.data.target))
| 802| 802| 				{
| 803| 803| 					this.FinishOrder();
| 812| 812| 						return;
| 813| 813| 					}
| 814| 814| 				}
| 815|    |-			}
|    | 815|+			
| 816| 816| 
| 817| 817| 			this.SetNextState("GARRISON.GARRISONING");
| 818| 818| 		},
|    | [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
| 804| 804| 					return;
| 805| 805| 				}
| 806| 806| 				else
| 807|    |-				{
|    | 807|+				
| 808| 808| 					// Out of range; move there in formation
| 809| 809| 					if (this.MoveToGarrisonRange(msg.data.target))
| 810| 810| 					{
| 811| 811| 						this.SetNextState("GARRISON.APPROACHING");
| 812| 812| 						return;
| 813| 813| 					}
| 814|    |-				}
|    | 814|+				
| 815| 815| 			}
| 816| 816| 
| 817| 817| 			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
| 803| 803| 					this.FinishOrder();
| 804| 804| 					return;
| 805| 805| 				}
| 806|    |-				else
| 807|    |-				{
|    | 806|+				
| 808| 807| 					// Out of range; move there in formation
| 809| 808| 					if (this.MoveToGarrisonRange(msg.data.target))
| 810| 809| 					{
| 811| 810| 						this.SetNextState("GARRISON.APPROACHING");
| 812| 811| 						return;
| 813| 812| 					}
| 814|    |-				}
|    | 813|+				
| 815| 814| 			}
| 816| 815| 
| 817| 816| 			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
| 830| 830| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 831| 831| 					}
| 832| 832| 					else
| 833|    |-					{
|    | 833|+					
| 834| 834| 						// We couldn't move there, or the target moved away
| 835| 835| 						this.FinishOrder();
| 836|    |-					}
|    | 836|+					
| 837| 837| 					return;
| 838| 838| 				}
| 839| 839| 
|    | [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
|1051|1051| 			},
|1052|1052| 		},
|1053|1053| 
|1054|    |-		"GARRISON":{
|    |1054|+		"GARRISON": {
|1055|1055| 			"enter": function() {
|1056|1056| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1057|1057| 				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
|1235|1235| 			// If the controller handled an order but some members rejected it,
|1236|1236| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1237|1237| 			if (this.orderQueue.length)
|1238|    |-			{
|    |1238|+			
|1239|1239| 				// We're leaving the formation, so stop our FormationWalk order
|1240|1240| 				if (this.FinishOrder())
|1241|1241| 					return;
|1242|    |-			}
|    |1242|+			
|1243|1243| 
|1244|1244| 			// No orders left, we're an individual now
|1245|1245| 			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
|1263|1263| 			// Move a tile outside the building
|1264|1264| 			let range = 4;
|1265|1265| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1266|    |-			{
|    |1266|+			
|1267|1267| 				// We've started walking to the given point
|1268|1268| 				this.SetNextState("WALKINGTOPOINT");
|1269|    |-			}
|    |1269|+			
|1270|1270| 			else
|1271|1271| 			{
|1272|1272| 				// 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
|1268|1268| 				this.SetNextState("WALKINGTOPOINT");
|1269|1269| 			}
|1270|1270| 			else
|1271|    |-			{
|    |1271|+			
|1272|1272| 				// We are already at the target, or can't move at all
|1273|1273| 				this.FinishOrder();
|1274|    |-			}
|    |1274|+			
|1275|1275| 		},
|1276|1276| 
|1277|1277| 
|    | [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
|1469|1469| 
|1470|1470| 			"LosRangeUpdate": function(msg) {
|1471|1471| 				if (this.GetStance().targetVisibleEnemies)
|1472|    |-				{
|    |1472|+				
|1473|1473| 					// Start attacking one of the newly-seen enemy (if any)
|1474|1474| 					this.AttackEntitiesByPreference(msg.data.added);
|1475|    |-				}
|    |1475|+				
|1476|1476| 			},
|1477|1477| 
|1478|1478| 			"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
|1655|1655| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1656|1656| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1657|1657| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1658|    |-						{
|    |1658|+						
|1659|1659| 							if (this.CanHeal(this.isGuardOf))
|1660|1660| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1661|1661| 							else if (this.CanRepair(this.isGuardOf))
|1662|1662| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1663|    |-						}
|    |1663|+						
|1664|1664| 					}
|1665|1665| 				},
|1666|1666| 
|    | [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
|1743|1743| 				"MoveCompleted": function() {
|1744|1744| 
|1745|1745| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1746|    |-					{
|    |1746|+					
|1747|1747| 						// If the unit needs to unpack, do so
|1748|1748| 						if (this.CanUnpack())
|1749|1749| 						{
|1752|1752| 						}
|1753|1753| 						else
|1754|1754| 							this.SetNextState("ATTACKING");
|1755|    |-					}
|    |1755|+					
|1756|1756| 					else
|1757|1757| 					{
|1758|1758| 						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
|1750|1750| 							this.PushOrderFront("Unpack", { "force": true });
|1751|1751| 							return;
|1752|1752| 						}
|1753|    |-						else
|1754|    |-							this.SetNextState("ATTACKING");
|    |1753|+						this.SetNextState("ATTACKING");
|1755|1754| 					}
|1756|1755| 					else
|1757|1756| 					{
|    | [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
|1754|1754| 							this.SetNextState("ATTACKING");
|1755|1755| 					}
|1756|1756| 					else
|1757|    |-					{
|    |1757|+					
|1758|1758| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1759|1759| 						{
|1760|1760| 							this.SetNextState("APPROACHING");
|1764|1764| 							// Give up
|1765|1765| 							this.FinishOrder();
|1766|1766| 						}
|1767|    |-					}
|    |1767|+					
|1768|1768| 				},
|1769|1769| 			},
|1770|1770| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1756|1756| 					else
|1757|1757| 					{
|1758|1758| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1759|    |-						{
|    |1759|+						
|1760|1760| 							this.SetNextState("APPROACHING");
|1761|    |-						}
|    |1761|+						
|1762|1762| 						else
|1763|1763| 						{
|1764|1764| 							// 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
|1760|1760| 							this.SetNextState("APPROACHING");
|1761|1761| 						}
|1762|1762| 						else
|1763|    |-						{
|    |1763|+						
|1764|1764| 							// Give up
|1765|1765| 							this.FinishOrder();
|1766|    |-						}
|    |1766|+						
|1767|1767| 					}
|1768|1768| 				},
|1769|1769| 			},
|    | [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
|1781|1781| 					}
|1782|1782| 					// Check the target is still alive and attackable
|1783|1783| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1784|    |-					{
|    |1784|+					
|1785|1785| 						// Can't reach it - try to chase after it
|1786|1786| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1787|1787| 						{
|1796|1796| 								return;
|1797|1797| 							}
|1798|1798| 						}
|1799|    |-					}
|    |1799|+					
|1800|1800| 
|1801|1801| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1802|1802| 					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
|1827|1827| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1828|1828| 
|1829|1829| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1830|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1830|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1831|1831| 
|1832|1832| 					this.FaceTowardsTarget(this.order.data.target);
|1833|1833| 
|    | [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
|1956|1956| 
|1957|1957| 				"Attacked": function(msg) {
|1958|1958| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1959|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1960|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1959|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1960|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1961|1961| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1962|1962| 				},
|1963|1963| 			},
|    | [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
|2040|2040| 						// Also don't switch to a different type of huntable animal
|2041|2041| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2042|2042| 							return (
|2043|    |-								ent != oldTarget
|2044|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2043|+								ent != oldTarget &&
|    |2044|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2045|2045| 								 || (type.specific == oldType.specific
|2046|2046| 								 && (type.specific != "meat" || oldTemplate == template)))
|2047|2047| 							);
|    | [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
|2041|2041| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2042|2042| 							return (
|2043|2043| 								ent != oldTarget
|2044|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2045|    |-								 || (type.specific == oldType.specific
|    |2044|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2045|+								 (type.specific == oldType.specific
|2046|2046| 								 && (type.specific != "meat" || oldTemplate == template)))
|2047|2047| 							);
|2048|2048| 						}, 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
|2042|2042| 							return (
|2043|2043| 								ent != oldTarget
|2044|2044| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2045|    |-								 || (type.specific == oldType.specific
|2046|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2045|+								 || (type.specific == oldType.specific &&
|    |2046|+								 (type.specific != "meat" || oldTemplate == template)))
|2047|2047| 							);
|2048|2048| 						}, oldTarget);
|2049|2049| 						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
|2051|2051| 							this.PerformGather(nearby, false, false);
|2052|2052| 							return true;
|2053|2053| 						}
|2054|    |-						else
|2055|    |-						{
|    |2054|+						
|2056|2055| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2057|2056| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2058|2057| 							// to order it to GatherNear the resource position.
|2073|2072| 									return true;
|2074|2073| 								}
|2075|2074| 							}
|2076|    |-						}
|    |2075|+						
|2077|2076| 						return true;
|2078|2077| 					}
|2079|2078| 					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
|2063|2063| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2064|2064| 								return true;
|2065|2065| 							}
|2066|    |-							else
|2067|    |-							{
|    |2066|+							
|2068|2067| 								// we're kind of stuck here. Return resource.
|2069|2068| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2070|2069| 								if (nearby)
|2072|2071| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2073|2072| 									return true;
|2074|2073| 								}
|2075|    |-							}
|    |2074|+							
|2076|2075| 						}
|2077|2076| 						return true;
|2078|2077| 					}
|    | [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
|2105|2105| 						// Also don't switch to a different type of huntable animal
|2106|2106| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2107|2107| 							return (
|2108|    |-								ent != oldTarget
|2109|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2108|+								ent != oldTarget &&
|    |2109|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2110|2110| 								|| (type.specific == oldType.specific
|2111|2111| 								&& (type.specific != "meat" || oldTemplate == template)))
|2112|2112| 							);
|    | [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
|2106|2106| 						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2107|2107| 							return (
|2108|2108| 								ent != oldTarget
|2109|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2110|    |-								|| (type.specific == oldType.specific
|    |2109|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2110|+								(type.specific == oldType.specific
|2111|2111| 								&& (type.specific != "meat" || oldTemplate == template)))
|2112|2112| 							);
|2113|2113| 						});
|    | [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
|2107|2107| 							return (
|2108|2108| 								ent != oldTarget
|2109|2109| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2110|    |-								|| (type.specific == oldType.specific
|2111|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2110|+								|| (type.specific == oldType.specific &&
|    |2111|+								(type.specific != "meat" || oldTemplate == template)))
|2112|2112| 							);
|2113|2113| 						});
|2114|2114| 						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
|2152|2152| 					// Also don't switch to a different type of huntable animal
|2153|2153| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2154|2154| 						return (
|2155|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2156|    |-							|| (type.specific == resourceType.specific
|    |2155|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2156|+							(type.specific == resourceType.specific
|2157|2157| 							&& (type.specific != "meat" || resourceTemplate == template))
|2158|2158| 						);
|2159|2159| 					});
|    | [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
|2153|2153| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2154|2154| 						return (
|2155|2155| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2156|    |-							|| (type.specific == resourceType.specific
|2157|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2156|+							|| (type.specific == resourceType.specific &&
|    |2157|+							(type.specific != "meat" || resourceTemplate == template))
|2158|2158| 						);
|2159|2159| 					});
|2160|2160| 
|    | [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
|2269|2269| 
|2270|2270| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2271|2271| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2272|    |-					{
|    |2272|+					
|2273|2273| 						// Check we can still reach and gather from the target
|2274|2274| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2275|2275| 						{
|2335|2335| 								return;
|2336|2336| 							}
|2337|2337| 						}
|2338|    |-					}
|    |2338|+					
|2339|2339| 
|2340|2340| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2341|2341| 
|    | [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
|2361|2361| 					// Also don't switch to a different type of huntable animal
|2362|2362| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2363|2363| 						return (
|2364|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2365|    |-							|| (type.specific == resourceType.specific
|    |2364|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2365|+							(type.specific == resourceType.specific
|2366|2366| 							&& (type.specific != "meat" || resourceTemplate == template))
|2367|2367| 						);
|2368|2368| 					});
|    | [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
|2362|2362| 					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2363|2363| 						return (
|2364|2364| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2365|    |-							|| (type.specific == resourceType.specific
|2366|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2365|+							|| (type.specific == resourceType.specific &&
|    |2366|+							(type.specific != "meat" || resourceTemplate == template))
|2367|2367| 						);
|2368|2368| 					});
|2369|2369| 					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
|2449|2449| 					this.StartTimer(prepare, this.healTimers.repeat);
|2450|2450| 
|2451|2451| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2452|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2452|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2453|2453| 
|2454|2454| 					this.FaceTowardsTarget(this.order.data.target);
|2455|2455| 				},
|    | [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
|2664|2664| 					{
|2665|2665| 						// The building was already finished/fully repaired before we arrived;
|2666|2666| 						// let the ConstructionFinished handler handle this.
|2667|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2667|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2668|2668| 						return true;
|2669|2669| 					}
|2670|2670| 
|    | [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
|2664|2664| 					{
|2665|2665| 						// The building was already finished/fully repaired before we arrived;
|2666|2666| 						// let the ConstructionFinished handler handle this.
|2667|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2667|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2668|2668| 						return true;
|2669|2669| 					}
|2670|2670| 
|    | [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
|2704|2704| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2705|2705| 						this.SetNextState("APPROACHING");
|2706|2706| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2707|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2707|+						this.FinishOrder(); // can't approach and isn't in reach
|2708|2708| 				},
|2709|2709| 			},
|2710|2710| 
|    | [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
|2791|2791| 
|2792|2792| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2793|2793| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2794|    |-				{
|    |2794|+				
|2795|2795| 					// We're already walking to the given point, so add this as a order.
|2796|2796| 					this.WalkToTarget(msg.data.newentity, true);
|2797|    |-				}
|    |2797|+				
|2798|2798| 			},
|2799|2799| 		},
|2800|2800| 
|    | [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
|2844|2844| 
|2845|2845| 					// Check that we can garrison here
|2846|2846| 					if (this.CanGarrison(target))
|2847|    |-					{
|    |2847|+					
|2848|2848| 						// Check that we're in range of the garrison target
|2849|2849| 						if (this.CheckGarrisonRange(target))
|2850|2850| 						{
|2920|2920| 								return false;
|2921|2921| 							}
|2922|2922| 						}
|2923|    |-					}
|    |2923|+					
|2924|2924| 					// Garrisoning failed for some reason, so finish the order
|2925|2925| 					this.FinishOrder();
|2926|2926| 					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
|3027|3027| 		"Attacked": function(msg) {
|3028|3028| 			if (this.template.NaturalBehaviour == "skittish" ||
|3029|3029| 			    this.template.NaturalBehaviour == "passive")
|3030|    |-			{
|    |3030|+			
|3031|3031| 				this.Flee(msg.data.attacker, false);
|3032|    |-			}
|    |3032|+			
|3033|3033| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3034|3034| 			{
|3035|3035| 				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
|3036|3036| 					this.Attack(msg.data.attacker, false);
|3037|3037| 			}
|3038|3038| 			else if (this.template.NaturalBehaviour == "domestic")
|3039|    |-			{
|    |3039|+			
|3040|3040| 				// Never flee, stop what we were doing
|3041|3041| 				this.SetNextState("IDLE");
|3042|    |-			}
|    |3042|+			
|3043|3043| 		},
|3044|3044| 
|3045|3045| 		"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
|3046|3046| 			// Move a tile outside the building
|3047|3047| 			var range = 4;
|3048|3048| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3049|    |-			{
|    |3049|+			
|3050|3050| 				// We've started walking to the given point
|3051|3051| 				this.SetNextState("WALKING");
|3052|    |-			}
|    |3052|+			
|3053|3053| 			else
|3054|3054| 			{
|3055|3055| 				// 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
|3051|3051| 				this.SetNextState("WALKING");
|3052|3052| 			}
|3053|3053| 			else
|3054|    |-			{
|    |3054|+			
|3055|3055| 				// We are already at the target, or can't move at all
|3056|3056| 				this.FinishOrder();
|3057|    |-			}
|    |3057|+			
|3058|3058| 		},
|3059|3059| 
|3060|3060| 		"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
|3093|3093| 				}
|3094|3094| 				// Start attacking one of the newly-seen enemy (if any)
|3095|3095| 				else if (this.IsDangerousAnimal())
|3096|    |-				{
|    |3096|+				
|3097|3097| 					this.AttackVisibleEntity(msg.data.added);
|3098|    |-				}
|    |3098|+				
|3099|3099| 
|3100|3100| 				// TODO: if two units enter our range together, we'll attack the
|3101|3101| 				// 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
|3136|3136| 				}
|3137|3137| 				// Start attacking one of the newly-seen enemy (if any)
|3138|3138| 				else if (this.template.NaturalBehaviour == "violent")
|3139|    |-				{
|    |3139|+				
|3140|3140| 					this.AttackVisibleEntity(msg.data.added);
|3141|    |-				}
|    |3141|+				
|3142|3142| 			},
|3143|3143| 
|3144|3144| 			"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
|3153|3153| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3154|3154| 
|3155|3155| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3156|    |-							// only used for domestic animals
|    |3156|+		// only used for domestic animals
|3157|3157| 	},
|3158|3158| };
|3159|3159| 
|    | [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
|3210|3210| 
|3211|3211| UnitAI.prototype.IsAnimal = function()
|3212|3212| {
|3213|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3213|+	return (!!this.template.NaturalBehaviour);
|3214|3214| };
|3215|3215| 
|3216|3216| 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
|3248|3248| UnitAI.prototype.GetGarrisonHolder = function()
|3249|3249| {
|3250|3250| 	if (this.IsGarrisoned())
|3251|    |-	{
|    |3251|+	
|3252|3252| 		for (let order of this.orderQueue)
|3253|3253| 			if (order.type == "Garrison")
|3254|3254| 				return order.data.target;
|3255|    |-	}
|    |3255|+	
|3256|3256| 	return INVALID_ENTITY;
|3257|3257| };
|3258|3258| 
|    | [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
|3326|3326| 		{
|3327|3327| 			let index = this.GetCurrentState().indexOf(".");
|3328|3328| 			if (index != -1)
|3329|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3329|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3330|3330| 			this.Stop(false);
|3331|3331| 		}
|3332|3332| 
|    | [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
|3382|3382| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3383|3383| 			continue;
|3384|3384| 		if (i == 0)
|3385|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3385|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3386|3386| 		else
|3387|3387| 			this.orderQueue.splice(i, 1);
|3388|3388| 		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
|3382|3382| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3383|3383| 			continue;
|3384|3384| 		if (i == 0)
|3385|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3385|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3386|3386| 		else
|3387|3387| 			this.orderQueue.splice(i, 1);
|3388|3388| 		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
|3466|3466| };
|3467|3467| 
|3468|3468| 
|3469|    |-//// FSM linkage functions ////
|    |3469|+// // FSM linkage functions ////
|3470|3470| 
|3471|3471| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3472|3472| 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
|3638|3638| 				continue;
|3639|3639| 			if (this.orderQueue[i].type == type)
|3640|3640| 				continue;
|3641|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3641|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3642|3642| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3643|3643| 			return;
|3644|3644| 		}
|    | [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
|3638|3638| 				continue;
|3639|3639| 			if (this.orderQueue[i].type == type)
|3640|3640| 				continue;
|3641|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3641|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3642|3642| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3643|3643| 			return;
|3644|3644| 		}
|    | [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
|3652|3652| {
|3653|3653| 	// Remember the previous work orders to be able to go back to them later if required
|3654|3654| 	if (data && data.force)
|3655|    |-	{
|    |3655|+	
|3656|3656| 		if (this.IsFormationController())
|3657|3657| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3658|3658| 		else
|3659|3659| 			this.UpdateWorkOrders(type);
|3660|    |-	}
|    |3660|+	
|3661|3661| 
|3662|3662| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3663|3663| 
|    | [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
|3729|3729| 	{
|3730|3730| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3731|3731| 		if (cmpUnitAI)
|3732|    |-		{
|    |3732|+		
|3733|3733| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3734|3734| 			{
|3735|3735| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3738|3738| 					return;
|3739|3739| 				}
|3740|3740| 			}
|3741|    |-		}
|    |3741|+		
|3742|3742| 	}
|3743|3743| 
|3744|3744| 	// 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
|3731|3731| 		if (cmpUnitAI)
|3732|3732| 		{
|3733|3733| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3734|    |-			{
|    |3734|+			
|3735|3735| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3736|3736| 				{
|3737|3737| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3738|3738| 					return;
|3739|3739| 				}
|3740|    |-			}
|    |3740|+			
|3741|3741| 		}
|3742|3742| 	}
|3743|3743| 
|    | [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
|3743|3743| 
|3744|3744| 	// If nothing found, take the unit orders
|3745|3745| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3746|    |-	{
|    |3746|+	
|3747|3747| 		if (isWorkType(this.orderQueue[i].type))
|3748|3748| 		{
|3749|3749| 			this.workOrders = this.orderQueue.slice(i);
|3750|3750| 			return;
|3751|3751| 		}
|3752|    |-	}
|    |3752|+	
|3753|3753| };
|3754|3754| 
|3755|3755| 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
|3809|3809| 	if (data.timerRepeat === undefined)
|3810|3810| 		this.timer = undefined;
|3811|3811| 
|3812|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3812|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3813|3813| };
|3814|3814| 
|3815|3815| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3809|3809| 	if (data.timerRepeat === undefined)
|3810|3810| 		this.timer = undefined;
|3811|3811| 
|3812|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3812|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3813|3813| };
|3814|3814| 
|3815|3815| /**
|    | [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
|3844|3844| 	this.timer = undefined;
|3845|3845| };
|3846|3846| 
|3847|    |-//// Message handlers /////
|    |3847|+// // Message handlers /////
|3848|3848| 
|3849|3849| UnitAI.prototype.OnMotionChanged = function(msg)
|3850|3850| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3849|3849| UnitAI.prototype.OnMotionChanged = function(msg)
|3850|3850| {
|3851|3851| 	if (msg.starting && !msg.error)
|3852|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3852|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3853|3853| 	else if (!msg.starting || msg.error)
|3854|3854| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3855|3855| };
|    | [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
|3849|3849| UnitAI.prototype.OnMotionChanged = function(msg)
|3850|3850| {
|3851|3851| 	if (msg.starting && !msg.error)
|3852|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3852|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3853|3853| 	else if (!msg.starting || msg.error)
|3854|3854| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3855|3855| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3851|3851| 	if (msg.starting && !msg.error)
|3852|3852| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3853|3853| 	else if (!msg.starting || msg.error)
|3854|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3854|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3855|3855| };
|3856|3856| 
|3857|3857| 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
|3851|3851| 	if (msg.starting && !msg.error)
|3852|3852| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3853|3853| 	else if (!msg.starting || msg.error)
|3854|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3854|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3855|3855| };
|3856|3856| 
|3857|3857| 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
|3859|3859| 	// TODO: This is a bit inefficient since every unit listens to every
|3860|3860| 	// construction message - ideally we could scope it to only the one we're building
|3861|3861| 
|3862|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3862|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3863|3863| };
|3864|3864| 
|3865|3865| 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
|3859|3859| 	// TODO: This is a bit inefficient since every unit listens to every
|3860|3860| 	// construction message - ideally we could scope it to only the one we're building
|3861|3861| 
|3862|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3862|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3863|3863| };
|3864|3864| 
|3865|3865| 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
|3884|3884| 
|3885|3885| UnitAI.prototype.OnAttacked = function(msg)
|3886|3886| {
|3887|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3887|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3888|3888| };
|3889|3889| 
|3890|3890| 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
|3884|3884| 
|3885|3885| UnitAI.prototype.OnAttacked = function(msg)
|3886|3886| {
|3887|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3887|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3888|3888| };
|3889|3889| 
|3890|3890| 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
|3889|3889| 
|3890|3890| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3891|3891| {
|3892|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3892|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3893|3893| };
|3894|3894| 
|3895|3895| 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
|3889|3889| 
|3890|3890| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3891|3891| {
|3892|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3892|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3893|3893| };
|3894|3894| 
|3895|3895| 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
|3894|3894| 
|3895|3895| UnitAI.prototype.OnHealthChanged = function(msg)
|3896|3896| {
|3897|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3897|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3898|3898| };
|3899|3899| 
|3900|3900| 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
|3894|3894| 
|3895|3895| UnitAI.prototype.OnHealthChanged = function(msg)
|3896|3896| {
|3897|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3897|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3898|3898| };
|3899|3899| 
|3900|3900| 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
|3900|3900| UnitAI.prototype.OnRangeUpdate = function(msg)
|3901|3901| {
|3902|3902| 	if (msg.tag == this.losRangeQuery)
|3903|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3903|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3904|3904| 	else if (msg.tag == this.losHealRangeQuery)
|3905|3905| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3906|3906| };
|    | [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
|3900|3900| UnitAI.prototype.OnRangeUpdate = function(msg)
|3901|3901| {
|3902|3902| 	if (msg.tag == this.losRangeQuery)
|3903|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3903|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3904|3904| 	else if (msg.tag == this.losHealRangeQuery)
|3905|3905| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3906|3906| };
|    | [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
|3902|3902| 	if (msg.tag == this.losRangeQuery)
|3903|3903| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3904|3904| 	else if (msg.tag == this.losHealRangeQuery)
|3905|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3905|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3906|3906| };
|3907|3907| 
|3908|3908| 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
|3902|3902| 	if (msg.tag == this.losRangeQuery)
|3903|3903| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3904|3904| 	else if (msg.tag == this.losHealRangeQuery)
|3905|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3905|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3906|3906| };
|3907|3907| 
|3908|3908| 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
|3907|3907| 
|3908|3908| UnitAI.prototype.OnPackFinished = function(msg)
|3909|3909| {
|3910|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3910|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3911|3911| };
|3912|3912| 
|3913|3913| //// 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
|3907|3907| 
|3908|3908| UnitAI.prototype.OnPackFinished = function(msg)
|3909|3909| {
|3910|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3910|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3911|3911| };
|3912|3912| 
|3913|3913| //// 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
|3910|3910| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3911|3911| };
|3912|3912| 
|3913|    |-//// Helper functions to be called by the FSM ////
|    |3913|+// // Helper functions to be called by the FSM ////
|3914|3914| 
|3915|3915| UnitAI.prototype.GetWalkSpeed = function()
|3916|3916| {
|    | [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
|4014|4014| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4015|4015| 		return undefined;
|4016|4016| 
|4017|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4017|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4018|4018| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4019|4019| 		return undefined;
|4020|4020| 
|    | [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
|4099|4099| 			PlaySound(name, member);
|4100|4100| 	}
|4101|4101| 	else
|4102|    |-	{
|    |4102|+	
|4103|4103| 		// Otherwise use our own sounds
|4104|4104| 		PlaySound(name, this.entity);
|4105|    |-	}
|    |4105|+	
|4106|4106| };
|4107|4107| 
|4108|4108| /*
|    | [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
|4268|4268| 	else
|4269|4269| 		// return false? Or hope you come close enough?
|4270|4270| 		var parabolicMaxRange = 0;
|4271|    |-		//return false;
|    |4271|+		// return false;
|4272|4272| 
|4273|4273| 	// the parabole changes while walking, take something in the middle
|4274|4274| 	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
|4333|4333| 	if (this.IsFormationMember())
|4334|4334| 	{
|4335|4335| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4336|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4337|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4336|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4337|+			cmpFormationUnitAI.order.data.target == target)
|4338|4338| 			return true;
|4339|4339| 	}
|4340|4340| 
|    | [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
|4501|4501| UnitAI.prototype.AttackEntityInZone = function(ents)
|4502|4502| {
|4503|4503| 	var target = ents.find(target =>
|4504|    |-		this.CanAttack(target)
|4505|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4504|+		this.CanAttack(target) &&
|    |4505|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4506|4506| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4507|4507| 	);
|4508|4508| 	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
|4502|4502| {
|4503|4503| 	var target = ents.find(target =>
|4504|4504| 		this.CanAttack(target)
|4505|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4506|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4505|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4506|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4507|4507| 	);
|4508|4508| 	if (!target)
|4509|4509| 		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
|4566|4566| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4567|4567| 	if (this.isGuardOf)
|4568|4568| 	{
|4569|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4569|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4570|4570| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4571|4571| 		if (cmpUnitAI && cmpAttack &&
|4572|4572| 		    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
|4570|4570| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4571|4571| 		if (cmpUnitAI && cmpAttack &&
|4572|4572| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4573|    |-				return false;
|    |4573|+			return false;
|4574|4574| 	}
|4575|4575| 
|4576|4576| 	// 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
|4575|4575| 
|4576|4576| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4577|4577| 	if (this.GetStance().respondHoldGround)
|4578|    |-	{
|    |4578|+	
|4579|4579| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4580|4580| 			return true;
|4581|    |-	}
|    |4581|+	
|4582|4582| 
|4583|4583| 	// Stop if it's left our vision range, unless we're especially persistent
|4584|4584| 	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
|4582|4582| 
|4583|4583| 	// Stop if it's left our vision range, unless we're especially persistent
|4584|4584| 	if (!this.GetStance().respondChaseBeyondVision)
|4585|    |-	{
|    |4585|+	
|4586|4586| 		if (!this.CheckTargetIsInVisionRange(target))
|4587|4587| 			return true;
|4588|    |-	}
|    |4588|+	
|4589|4589| 
|4590|4590| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4591|4591| 	// 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
|4608|4608| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4609|4609| 	if (this.isGuardOf)
|4610|4610| 	{
|4611|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4611|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4612|4612| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4613|4613| 		if (cmpUnitAI && cmpAttack &&
|4614|4614| 		    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
|4621|4621| 	return false;
|4622|4622| };
|4623|4623| 
|4624|    |-//// External interface functions ////
|    |4624|+// // External interface functions ////
|4625|4625| 
|4626|4626| UnitAI.prototype.SetFormationController = function(ent)
|4627|4627| {
|    | [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
|4631|4631| 	// of our own formation (or ourself if not in formation)
|4632|4632| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4633|4633| 	if (cmpObstruction)
|4634|    |-	{
|    |4634|+	
|4635|4635| 		if (ent == INVALID_ENTITY)
|4636|4636| 			cmpObstruction.SetControlGroup(this.entity);
|4637|4637| 		else
|4638|4638| 			cmpObstruction.SetControlGroup(ent);
|4639|    |-	}
|    |4639|+	
|4640|4640| 
|4641|4641| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4642|4642| 	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
|4774|4774| 	// if we already had an old guard order, do nothing if the target is the same
|4775|4775| 	// and the order is running, otherwise remove the previous order
|4776|4776| 	if (this.isGuardOf)
|4777|    |-	{
|    |4777|+	
|4778|4778| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4779|4779| 			return;
|4780|4780| 		else
|4781|4781| 			this.RemoveGuard();
|4782|    |-	}
|    |4782|+	
|4783|4783| 
|4784|4784| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4785|4785| };
|    | [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
|4777|4777| 	{
|4778|4778| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4779|4779| 			return;
|4780|    |-		else
|4781|    |-			this.RemoveGuard();
|    |4780|+		this.RemoveGuard();
|4782|4781| 	}
|4783|4782| 
|4784|4783| 	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
|4948|4948| 			this.WalkToTarget(target, queued);
|4949|4949| 		return;
|4950|4950| 	}
|4951|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |4951|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|4952|4952| };
|4953|4953| 
|4954|4954| /**
|    | [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
|5097|5097| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5098|5098| 	{
|5099|5099| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5100|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5100|+		if (cmpTrader.HasBothMarkets() &&
|5101|5101| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5102|5102| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5103|5103| 		{
|    | [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
|5378|5378| 				{
|5379|5379| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5380|5380| 					var targetClasses = this.order.data.targetClasses;
|5381|    |-					if (targetClasses.attack && cmpIdentity
|5382|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5381|+					if (targetClasses.attack && cmpIdentity &&
|    |5382|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5383|5383| 						continue;
|5384|5384| 					if (targetClasses.avoid && cmpIdentity
|5385|5385| 						&& 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
|5381|5381| 					if (targetClasses.attack && cmpIdentity
|5382|5382| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5383|5383| 						continue;
|5384|    |-					if (targetClasses.avoid && cmpIdentity
|5385|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5384|+					if (targetClasses.avoid && cmpIdentity &&
|    |5385|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5386|5386| 						continue;
|5387|5387| 					// Only used by the AIs to prevent some choices of targets
|5388|5388| 					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
|5404|5404| 		{
|5405|5405| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5406|5406| 			var targetClasses = this.order.data.targetClasses;
|5407|    |-			if (cmpIdentity && targetClasses.attack
|5408|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5407|+			if (cmpIdentity && targetClasses.attack &&
|    |5408|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5409|5409| 				continue;
|5410|5410| 			if (cmpIdentity && targetClasses.avoid
|5411|5411| 				&& 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
|5407|5407| 			if (cmpIdentity && targetClasses.attack
|5408|5408| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5409|5409| 				continue;
|5410|    |-			if (cmpIdentity && targetClasses.avoid
|5411|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5410|+			if (cmpIdentity && targetClasses.avoid &&
|    |5411|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5412|5412| 				continue;
|5413|5413| 			// Only used by the AIs to prevent some choices of targets
|5414|5414| 			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
|5540|5540| 
|5541|5541| UnitAI.prototype.SetHeldPosition = function(x, z)
|5542|5542| {
|5543|    |-	this.heldPosition = {"x": x, "z": z};
|    |5543|+	this.heldPosition = { "x": x, "z": z};
|5544|5544| };
|5545|5545| 
|5546|5546| 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
|5540|5540| 
|5541|5541| UnitAI.prototype.SetHeldPosition = function(x, z)
|5542|5542| {
|5543|    |-	this.heldPosition = {"x": x, "z": z};
|    |5543|+	this.heldPosition = {"x": x, "z": z };
|5544|5544| };
|5545|5545| 
|5546|5546| 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
|5567|5567| 	return false;
|5568|5568| };
|5569|5569| 
|5570|    |-//// Helper functions ////
|    |5570|+// // Helper functions ////
|5571|5571| 
|5572|5572| UnitAI.prototype.CanAttack = function(target)
|5573|5573| {
|    | [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
|5771|5771| 	return cmpPack && cmpPack.IsPacking();
|5772|5772| };
|5773|5773| 
|5774|    |-//// Formation specific functions ////
|    |5774|+// // Formation specific functions ////
|5775|5775| 
|5776|5776| UnitAI.prototype.IsAttackingAsFormation = function()
|5777|5777| {
|    | [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
|5776|5776| UnitAI.prototype.IsAttackingAsFormation = function()
|5777|5777| {
|5778|5778| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5779|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5780|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5779|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5780|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5781|5781| };
|5782|5782| 
|5783|5783| //// 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
|5780|5780| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5781|5781| };
|5782|5782| 
|5783|    |-//// Animal specific functions ////
|    |5783|+// // Animal specific functions ////
|5784|5784| 
|5785|5785| UnitAI.prototype.MoveRandomly = function(distance)
|5786|5786| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2351| »   »   »   »   »   »   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
|3714| »   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
|4488| »   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
|4503| »   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
|4549| »   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
|4572| »   »   ····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
|5028| »   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
| 303| »   »   ····&&·(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
|1819| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|1960| »   »   »   »   »   »   &&·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
|2044| »   »   »   »   »   »   »   »   ·&&·((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
|2045| »   »   »   »   »   »   »   »   ·||·(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
|2046| »   »   »   »   »   »   »   »   ·&&·(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
|2069| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4281| »   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
|4337| »   »   »   &&·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
|4505| »   »   &&·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
|4506| »   »   &&·(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
|5028| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5497| »   »   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/1035/

elexis added a subscriber: elexis.Feb 4 2019, 10:13 PM

No, mods don't have to overwrite the file to change it, but they can change it in a UnitAI_mymod.js that just sets foo.bar.stance = { ... } in load. See D1756.

As mentioned in Nescios diff somewhere, why would this be moved for one object of one file but not for all objects of all files. There are about 6000 lines in UnitAI, but only 60 lines would be touched.

It's also not wasteful at all, because the JS file is loaded only once and there is only one instance of this object.

What is nice is that this is encoded as JSON instead of JS and it's kind of nice to have JSON files around independent of the code.
A downside would be that the comments are now far away from the values and JSON doesn't support comments.

g_Stances is a global and they shouldn't exist, perhaps we can make that a prototype option that is not an owned property and thus not serialized. One would have to doublecheck.

About JSON files carrying simulation values, they are odd, usually we store everything in the templates if it's not a tech or aura.
None of the other components have helper JSON files.
So perhaps it would even be possible using template inheritance from template_unit to specify this set of data in the UnitAI XML template.

Then one could also make new stances for other units (although not sure about vanilla use cases).
Is that possible?

(The stance data should eventually contain the png image file too probably.)

Stan added a comment.Feb 4 2019, 10:21 PM

About serialisation one could just override the serialise function and only serialise specific attributes. It's done like that in other components.

Well I'd be happy to do it for any other file if that's helpful.

I'd like to clean unit Ai someday.

About JSON to XML do we have a engine function to load XML ? I wish we could have the schemas in separate files.

elexis added a comment.Feb 5 2019, 9:52 AM

It'd already be in this.template. Didn't think it through, but if possible, might be nice.