Page MenuHomeWildfire Games

UnitMotion / AI - remove the special walk animation and let unitMotion take charge
ClosedPublic

Authored by wraitii on May 15 2019, 11:02 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22446: UnitMotion / AI - remove the special 'move' animation, make UnitMotion inform…
Summary

Following D1894, we have a convenient way to update our speed. We can use this to make unitMotion call VisualActor directly, instead of the reverse. This lets us clean up code in unitAI.

To let unitAI overwrite our idle/walk animations, we only replace the 'idle';'walk';'run' animations. Note that using animation variants, this means we support doing things while walking, to an extent.

Not subscribing to MT_Update in VisualActor is a performance improvement of several µs per turn based on past profiling of messages.

Test Plan

Check out the difference in code cleanliness

Diff Detail

Event Timeline

wraitii created this revision.May 15 2019, 11:02 PM

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

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

Stan added a subscriber: Stan.May 16 2019, 1:43 PM
Stan added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
3168

Why this one, don't you only remove move ?

wraitii added inline comments.May 16 2019, 7:27 PM
binaries/data/mods/public/simulation/components/UnitAI.js
3168

This should be "move", there's a bug.

wraitii updated this revision to Diff 8080.May 19 2019, 4:55 PM

Updated

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

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

Stan added inline comments.Jun 5 2019, 9:54 PM
source/simulation2/components/CCmpUnitMotion.cpp
556

Check for that ?

571

What about special formation walking animations ?

wraitii added inline comments.Jun 24 2019, 12:33 PM
source/simulation2/components/CCmpUnitMotion.cpp
571

These use a special override. See also https://code.wildfiregames.com/D1337.

wraitii added inline comments.Jun 24 2019, 2:34 PM
source/simulation2/components/CCmpUnitMotion.cpp
571

Mh, sorry, I thought you were referring to something in unitAI -_-

This does indeed break formation walking animations, it required D1337 to work as currently written but I think I'll just fix it for this diff. Maybe not.

wraitii updated this revision to Diff 8780.Jul 8 2019, 8:26 PM

Rebased for jenkins.

Vulcan added a comment.Jul 8 2019, 9:47 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353| 353| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354| 354| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355|    |-		{
|    | 355|+		
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 358| 358| 				needToMove = false;
| 359|    |-		}
|    | 359|+		
| 360| 360| 
| 361| 361| 		if (needToMove)
| 362| 362| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 350| 350| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 351| 351| 		var needToMove = true;
| 352| 352| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 353|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 354|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 353|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 354|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 355| 355| 		{
| 356| 356| 			// we were already on the shoreline, and have not moved since
| 357| 357| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 517| 517| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 518| 518| 				}
| 519| 519| 				else
| 520|    |-				{
|    | 520|+				
| 521| 521| 					// We couldn't move there, or the target moved away
| 522| 522| 					this.FinishOrder();
| 523|    |-				}
|    | 523|+				
| 524| 524| 				return;
| 525| 525| 			}
| 526| 526| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 736| 736| 			}
| 737| 737| 			// Check if we are already in range, otherwise walk there
| 738| 738| 			if (!this.CheckGarrisonRange(msg.data.target))
| 739|    |-			{
|    | 739|+			
| 740| 740| 				if (!this.CheckTargetVisible(msg.data.target))
| 741| 741| 				{
| 742| 742| 					this.FinishOrder();
| 747| 747| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 748| 					return;
| 749| 749| 				}
| 750|    |-			}
|    | 750|+			
| 751| 751| 
| 752| 752| 			this.SetNextState("GARRISON.GARRISONING");
| 753| 753| 		},
|    | [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
| 742| 742| 					this.FinishOrder();
| 743| 743| 					return;
| 744| 744| 				}
| 745|    |-				else
| 746|    |-				{
|    | 745|+				
| 747| 746| 					this.SetNextState("GARRISON.APPROACHING");
| 748| 747| 					return;
| 749|    |-				}
|    | 748|+				
| 750| 749| 			}
| 751| 750| 
| 752| 751| 			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
| 765| 765| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 766| 766| 					}
| 767| 767| 					else
| 768|    |-					{
|    | 768|+					
| 769| 769| 						// We couldn't move there, or the target moved away
| 770| 770| 						this.FinishOrder();
| 771|    |-					}
|    | 771|+					
| 772| 772| 					return;
| 773| 773| 				}
| 774| 774| 
|    | [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
| 998| 998| 			},
| 999| 999| 		},
|1000|1000| 
|1001|    |-		"GARRISON":{
|    |1001|+		"GARRISON": {
|1002|1002| 			"enter": function() {
|1003|1003| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1004|1004| 				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
|1211|1211| 			// If the controller handled an order but some members rejected it,
|1212|1212| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1213|1213| 			if (this.orderQueue.length)
|1214|    |-			{
|    |1214|+			
|1215|1215| 				// We're leaving the formation, so stop our FormationWalk order
|1216|1216| 				if (this.FinishOrder())
|1217|1217| 					return;
|1218|    |-			}
|    |1218|+			
|1219|1219| 
|1220|1220| 			// No orders left, we're an individual now
|1221|1221| 			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
|1239|1239| 			// Move a tile outside the building
|1240|1240| 			let range = 4;
|1241|1241| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1242|    |-			{
|    |1242|+			
|1243|1243| 				// We are already at the target, or can't move at all
|1244|1244| 				this.FinishOrder();
|1245|    |-			}
|    |1245|+			
|1246|1246| 			else
|1247|1247| 			{
|1248|1248| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1453|1453| 
|1454|1454| 			"LosRangeUpdate": function(msg) {
|1455|1455| 				if (this.GetStance().targetVisibleEnemies)
|1456|    |-				{
|    |1456|+				
|1457|1457| 					// Start attacking one of the newly-seen enemy (if any)
|1458|1458| 					this.AttackEntitiesByPreference(msg.data.added);
|1459|    |-				}
|    |1459|+				
|1460|1460| 			},
|1461|1461| 
|1462|1462| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1481|1481| 				}
|1482|1482| 			},
|1483|1483| 
|1484|    |-			"leave": function () {
|    |1484|+			"leave": function() {
|1485|1485| 				this.StopMoving();
|1486|1486| 			},
|1487|1487| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1656|1656| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1657|1657| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1658|1658| 						if (cmpHealth && cmpHealth.IsInjured())
|1659|    |-						{
|    |1659|+						
|1660|1660| 							if (this.CanHeal(this.isGuardOf))
|1661|1661| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1662|1662| 							else if (this.CanRepair(this.isGuardOf))
|1663|1663| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1664|    |-						}
|    |1664|+						
|1665|1665| 					}
|1666|1666| 				},
|1667|1667| 
|    | [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
|1938|1938| 
|1939|1939| 				"Attacked": function(msg) {
|1940|1940| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1941|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1942|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1941|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1942|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1943|1943| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1944|1944| 				},
|1945|1945| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1990|1990| 
|1991|1991| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1992|1992| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1993|    |-					{
|    |1993|+					
|1994|1994| 						// Run after a fleeing target
|1995|1995| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|1996|    |-					}
|    |1996|+					
|1997|1997| 					this.StartTimer(1000, 1000);
|1998|1998| 				},
|1999|1999| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2341|2341| 
|2342|2342| 				"Timer": function(msg) {
|2343|2343| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2344|    |-					{
|    |2344|+					
|2345|2345| 						// Return to our original position unless we have a better order.
|2346|2346| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2347|2347| 							this.WalkToHeldPosition();
|2348|    |-					}
|    |2348|+					
|2349|2349| 				},
|2350|2350| 
|2351|2351| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2375|2375| 					this.StartTimer(prepare, this.healTimers.repeat);
|2376|2376| 
|2377|2377| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2378|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2378|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2379|2379| 
|2380|2380| 					this.FaceTowardsTarget(this.order.data.target);
|2381|2381| 				},
|    | [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
|2583|2583| 					{
|2584|2584| 						// The building was already finished/fully repaired before we arrived;
|2585|2585| 						// let the ConstructionFinished handler handle this.
|2586|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2586|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2587|2587| 						return true;
|2588|2588| 					}
|2589|2589| 
|    | [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
|2583|2583| 					{
|2584|2584| 						// The building was already finished/fully repaired before we arrived;
|2585|2585| 						// let the ConstructionFinished handler handle this.
|2586|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2586|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2587|2587| 						return true;
|2588|2588| 					}
|2589|2589| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2968|2968| 		"Attacked": function(msg) {
|2969|2969| 			if (this.template.NaturalBehaviour == "skittish" ||
|2970|2970| 			    this.template.NaturalBehaviour == "passive")
|2971|    |-			{
|    |2971|+			
|2972|2972| 				this.Flee(msg.data.attacker, false);
|2973|    |-			}
|    |2973|+			
|2974|2974| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2975|2975| 			{
|2976|2976| 				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
|2977|2977| 					this.Attack(msg.data.attacker, false);
|2978|2978| 			}
|2979|2979| 			else if (this.template.NaturalBehaviour == "domestic")
|2980|    |-			{
|    |2980|+			
|2981|2981| 				// Never flee, stop what we were doing
|2982|2982| 				this.SetNextState("IDLE");
|2983|    |-			}
|    |2983|+			
|2984|2984| 		},
|2985|2985| 
|2986|2986| 		"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
|3031|3031| 				}
|3032|3032| 				// Start attacking one of the newly-seen enemy (if any)
|3033|3033| 				else if (this.IsDangerousAnimal())
|3034|    |-				{
|    |3034|+				
|3035|3035| 					this.AttackVisibleEntity(msg.data.added);
|3036|    |-				}
|    |3036|+				
|3037|3037| 
|3038|3038| 				// TODO: if two units enter our range together, we'll attack the
|3039|3039| 				// 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
|3075|3075| 				}
|3076|3076| 				// Start attacking one of the newly-seen enemy (if any)
|3077|3077| 				else if (this.template.NaturalBehaviour == "violent")
|3078|    |-				{
|    |3078|+				
|3079|3079| 					this.AttackVisibleEntity(msg.data.added);
|3080|    |-				}
|    |3080|+				
|3081|3081| 			},
|3082|3082| 
|3083|3083| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3090|3090| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3091|3091| 
|3092|3092| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3093|    |-							// only used for domestic animals
|    |3093|+		// only used for domestic animals
|3094|3094| 	},
|3095|3095| };
|3096|3096| 
|    | [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
|3147|3147| 
|3148|3148| UnitAI.prototype.IsAnimal = function()
|3149|3149| {
|3150|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3150|+	return (!!this.template.NaturalBehaviour);
|3151|3151| };
|3152|3152| 
|3153|3153| 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
|3185|3185| UnitAI.prototype.GetGarrisonHolder = function()
|3186|3186| {
|3187|3187| 	if (this.IsGarrisoned())
|3188|    |-	{
|    |3188|+	
|3189|3189| 		for (let order of this.orderQueue)
|3190|3190| 			if (order.type == "Garrison")
|3191|3191| 				return order.data.target;
|3192|    |-	}
|    |3192|+	
|3193|3193| 	return INVALID_ENTITY;
|3194|3194| };
|3195|3195| 
|    | [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
|3263|3263| 		{
|3264|3264| 			let index = this.GetCurrentState().indexOf(".");
|3265|3265| 			if (index != -1)
|3266|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3266|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3267|3267| 			this.Stop(false);
|3268|3268| 		}
|3269|3269| 
|    | [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
|3319|3319| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3320|3320| 			continue;
|3321|3321| 		if (i == 0)
|3322|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3322|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3323|3323| 		else
|3324|3324| 			this.orderQueue.splice(i, 1);
|3325|3325| 		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
|3319|3319| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3320|3320| 			continue;
|3321|3321| 		if (i == 0)
|3322|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3322|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3323|3323| 		else
|3324|3324| 			this.orderQueue.splice(i, 1);
|3325|3325| 		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
|3403|3403| };
|3404|3404| 
|3405|3405| 
|3406|    |-//// FSM linkage functions ////
|    |3406|+// // FSM linkage functions ////
|3407|3407| 
|3408|3408| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3409|3409| 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
|3575|3575| 				continue;
|3576|3576| 			if (this.orderQueue[i].type == type)
|3577|3577| 				continue;
|3578|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3578|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3579|3579| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3580|3580| 			return;
|3581|3581| 		}
|    | [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
|3575|3575| 				continue;
|3576|3576| 			if (this.orderQueue[i].type == type)
|3577|3577| 				continue;
|3578|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3578|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3579|3579| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3580|3580| 			return;
|3581|3581| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3589|3589| {
|3590|3590| 	// Remember the previous work orders to be able to go back to them later if required
|3591|3591| 	if (data && data.force)
|3592|    |-	{
|    |3592|+	
|3593|3593| 		if (this.IsFormationController())
|3594|3594| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3595|3595| 		else
|3596|3596| 			this.UpdateWorkOrders(type);
|3597|    |-	}
|    |3597|+	
|3598|3598| 
|3599|3599| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3600|3600| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3666|3666| 	{
|3667|3667| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3668|3668| 		if (cmpUnitAI)
|3669|    |-		{
|    |3669|+		
|3670|3670| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3671|3671| 			{
|3672|3672| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3675|3675| 					return;
|3676|3676| 				}
|3677|3677| 			}
|3678|    |-		}
|    |3678|+		
|3679|3679| 	}
|3680|3680| 
|3681|3681| 	// 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
|3668|3668| 		if (cmpUnitAI)
|3669|3669| 		{
|3670|3670| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3671|    |-			{
|    |3671|+			
|3672|3672| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3673|3673| 				{
|3674|3674| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3675|3675| 					return;
|3676|3676| 				}
|3677|    |-			}
|    |3677|+			
|3678|3678| 		}
|3679|3679| 	}
|3680|3680| 
|    | [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
|3680|3680| 
|3681|3681| 	// If nothing found, take the unit orders
|3682|3682| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3683|    |-	{
|    |3683|+	
|3684|3684| 		if (isWorkType(this.orderQueue[i].type))
|3685|3685| 		{
|3686|3686| 			this.workOrders = this.orderQueue.slice(i);
|3687|3687| 			return;
|3688|3688| 		}
|3689|    |-	}
|    |3689|+	
|3690|3690| };
|3691|3691| 
|3692|3692| 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
|3746|3746| 	if (data.timerRepeat === undefined)
|3747|3747| 		this.timer = undefined;
|3748|3748| 
|3749|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3749|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3750|3750| };
|3751|3751| 
|3752|3752| /**
|    | [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
|3746|3746| 	if (data.timerRepeat === undefined)
|3747|3747| 		this.timer = undefined;
|3748|3748| 
|3749|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3749|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3750|3750| };
|3751|3751| 
|3752|3752| /**
|    | [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
|3781|3781| 	this.timer = undefined;
|3782|3782| };
|3783|3783| 
|3784|    |-//// Message handlers /////
|    |3784|+// // Message handlers /////
|3785|3785| 
|3786|3786| UnitAI.prototype.OnMotionChanged = function(msg)
|3787|3787| {
|    | [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
|3793|3793| 	// TODO: This is a bit inefficient since every unit listens to every
|3794|3794| 	// construction message - ideally we could scope it to only the one we're building
|3795|3795| 
|3796|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3796|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3797|3797| };
|3798|3798| 
|3799|3799| 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
|3793|3793| 	// TODO: This is a bit inefficient since every unit listens to every
|3794|3794| 	// construction message - ideally we could scope it to only the one we're building
|3795|3795| 
|3796|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3796|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3797|3797| };
|3798|3798| 
|3799|3799| 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
|3818|3818| 
|3819|3819| UnitAI.prototype.OnAttacked = function(msg)
|3820|3820| {
|3821|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3821|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3822|3822| };
|3823|3823| 
|3824|3824| 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
|3818|3818| 
|3819|3819| UnitAI.prototype.OnAttacked = function(msg)
|3820|3820| {
|3821|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3821|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3822|3822| };
|3823|3823| 
|3824|3824| 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
|3823|3823| 
|3824|3824| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3825|3825| {
|3826|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3826|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3827|3827| };
|3828|3828| 
|3829|3829| 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
|3823|3823| 
|3824|3824| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3825|3825| {
|3826|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3826|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3827|3827| };
|3828|3828| 
|3829|3829| 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
|3828|3828| 
|3829|3829| UnitAI.prototype.OnHealthChanged = function(msg)
|3830|3830| {
|3831|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3831|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3832|3832| };
|3833|3833| 
|3834|3834| 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
|3828|3828| 
|3829|3829| UnitAI.prototype.OnHealthChanged = function(msg)
|3830|3830| {
|3831|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3831|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3832|3832| };
|3833|3833| 
|3834|3834| 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
|3834|3834| UnitAI.prototype.OnRangeUpdate = function(msg)
|3835|3835| {
|3836|3836| 	if (msg.tag == this.losRangeQuery)
|3837|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3837|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3838|3838| 	else if (msg.tag == this.losHealRangeQuery)
|3839|3839| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3840|3840| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3834|3834| UnitAI.prototype.OnRangeUpdate = function(msg)
|3835|3835| {
|3836|3836| 	if (msg.tag == this.losRangeQuery)
|3837|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3837|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3838|3838| 	else if (msg.tag == this.losHealRangeQuery)
|3839|3839| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3840|3840| };
|    | [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
|3836|3836| 	if (msg.tag == this.losRangeQuery)
|3837|3837| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3838|3838| 	else if (msg.tag == this.losHealRangeQuery)
|3839|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3839|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3840|3840| };
|3841|3841| 
|3842|3842| 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
|3836|3836| 	if (msg.tag == this.losRangeQuery)
|3837|3837| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3838|3838| 	else if (msg.tag == this.losHealRangeQuery)
|3839|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3839|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3840|3840| };
|3841|3841| 
|3842|3842| 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
|3841|3841| 
|3842|3842| UnitAI.prototype.OnPackFinished = function(msg)
|3843|3843| {
|3844|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3844|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3845|3845| };
|3846|3846| 
|3847|3847| //// 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
|3841|3841| 
|3842|3842| UnitAI.prototype.OnPackFinished = function(msg)
|3843|3843| {
|3844|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3844|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3845|3845| };
|3846|3846| 
|3847|3847| //// 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
|3844|3844| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3845|3845| };
|3846|3846| 
|3847|    |-//// Helper functions to be called by the FSM ////
|    |3847|+// // Helper functions to be called by the FSM ////
|3848|3848| 
|3849|3849| UnitAI.prototype.GetWalkSpeed = function()
|3850|3850| {
|    | [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
|4031|4031| 			PlaySound(name, member);
|4032|4032| 	}
|4033|4033| 	else
|4034|    |-	{
|    |4034|+	
|4035|4035| 		// Otherwise use our own sounds
|4036|4036| 		PlaySound(name, this.entity);
|4037|    |-	}
|    |4037|+	
|4038|4038| };
|4039|4039| 
|4040|4040| /*
|    | [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
|4477|4477| UnitAI.prototype.AttackEntityInZone = function(ents)
|4478|4478| {
|4479|4479| 	var target = ents.find(target =>
|4480|    |-		this.CanAttack(target)
|4481|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4480|+		this.CanAttack(target) &&
|    |4481|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4482|4482| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4483|4483| 	);
|4484|4484| 	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
|4478|4478| {
|4479|4479| 	var target = ents.find(target =>
|4480|4480| 		this.CanAttack(target)
|4481|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4482|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4481|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4482|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4483|4483| 	);
|4484|4484| 	if (!target)
|4485|4485| 		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
|4542|4542| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4543|4543| 	if (this.isGuardOf)
|4544|4544| 	{
|4545|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4545|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4546|4546| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4547|4547| 		if (cmpUnitAI && cmpAttack &&
|4548|4548| 		    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
|4546|4546| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4547|4547| 		if (cmpUnitAI && cmpAttack &&
|4548|4548| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4549|    |-				return false;
|    |4549|+			return false;
|4550|4550| 	}
|4551|4551| 
|4552|4552| 	// 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
|4551|4551| 
|4552|4552| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4553|4553| 	if (this.GetStance().respondHoldGround)
|4554|    |-	{
|    |4554|+	
|4555|4555| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4556|4556| 			return true;
|4557|    |-	}
|    |4557|+	
|4558|4558| 
|4559|4559| 	// Stop if it's left our vision range, unless we're especially persistent
|4560|4560| 	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
|4558|4558| 
|4559|4559| 	// Stop if it's left our vision range, unless we're especially persistent
|4560|4560| 	if (!this.GetStance().respondChaseBeyondVision)
|4561|    |-	{
|    |4561|+	
|4562|4562| 		if (!this.CheckTargetIsInVisionRange(target))
|4563|4563| 			return true;
|4564|    |-	}
|    |4564|+	
|4565|4565| 
|4566|4566| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4567|4567| 	// 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
|4584|4584| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4585|4585| 	if (this.isGuardOf)
|4586|4586| 	{
|4587|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4587|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4588|4588| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4589|4589| 		if (cmpUnitAI && cmpAttack &&
|4590|4590| 		    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
|4597|4597| 	return false;
|4598|4598| };
|4599|4599| 
|4600|    |-//// External interface functions ////
|    |4600|+// // External interface functions ////
|4601|4601| 
|4602|4602| UnitAI.prototype.SetFormationController = function(ent)
|4603|4603| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4607|4607| 	// of our own formation (or ourself if not in formation)
|4608|4608| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4609|4609| 	if (cmpObstruction)
|4610|    |-	{
|    |4610|+	
|4611|4611| 		if (ent == INVALID_ENTITY)
|4612|4612| 			cmpObstruction.SetControlGroup(this.entity);
|4613|4613| 		else
|4614|4614| 			cmpObstruction.SetControlGroup(ent);
|4615|    |-	}
|    |4615|+	
|4616|4616| 
|4617|4617| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4618|4618| 	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
|4750|4750| 	// if we already had an old guard order, do nothing if the target is the same
|4751|4751| 	// and the order is running, otherwise remove the previous order
|4752|4752| 	if (this.isGuardOf)
|4753|    |-	{
|    |4753|+	
|4754|4754| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4755|4755| 			return;
|4756|4756| 		else
|4757|4757| 			this.RemoveGuard();
|4758|    |-	}
|    |4758|+	
|4759|4759| 
|4760|4760| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4761|4761| };
|    | [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
|4753|4753| 	{
|4754|4754| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4755|4755| 			return;
|4756|    |-		else
|4757|    |-			this.RemoveGuard();
|    |4756|+		this.RemoveGuard();
|4758|4757| 	}
|4759|4758| 
|4760|4759| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5085|5085| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5086|5086| 	{
|5087|5087| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5088|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5088|+		if (cmpTrader.HasBothMarkets() &&
|5089|5089| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5090|5090| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5091|5091| 		{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5366|5366| 				{
|5367|5367| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5368|5368| 					var targetClasses = this.order.data.targetClasses;
|5369|    |-					if (targetClasses.attack && cmpIdentity
|5370|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5369|+					if (targetClasses.attack && cmpIdentity &&
|    |5370|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5371|5371| 						continue;
|5372|5372| 					if (targetClasses.avoid && cmpIdentity
|5373|5373| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5369|5369| 					if (targetClasses.attack && cmpIdentity
|5370|5370| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5371|5371| 						continue;
|5372|    |-					if (targetClasses.avoid && cmpIdentity
|5373|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5372|+					if (targetClasses.avoid && cmpIdentity &&
|    |5373|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5374|5374| 						continue;
|5375|5375| 					// Only used by the AIs to prevent some choices of targets
|5376|5376| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5392|5392| 		{
|5393|5393| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5394|5394| 			var targetClasses = this.order.data.targetClasses;
|5395|    |-			if (cmpIdentity && targetClasses.attack
|5396|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5395|+			if (cmpIdentity && targetClasses.attack &&
|    |5396|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5397|5397| 				continue;
|5398|5398| 			if (cmpIdentity && targetClasses.avoid
|5399|5399| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5395|5395| 			if (cmpIdentity && targetClasses.attack
|5396|5396| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5397|5397| 				continue;
|5398|    |-			if (cmpIdentity && targetClasses.avoid
|5399|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5398|+			if (cmpIdentity && targetClasses.avoid &&
|    |5399|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5400|5400| 				continue;
|5401|5401| 			// Only used by the AIs to prevent some choices of targets
|5402|5402| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5552|5552| 
|5553|5553| UnitAI.prototype.SetHeldPosition = function(x, z)
|5554|5554| {
|5555|    |-	this.heldPosition = {"x": x, "z": z};
|    |5555|+	this.heldPosition = { "x": x, "z": z};
|5556|5556| };
|5557|5557| 
|5558|5558| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5552|5552| 
|5553|5553| UnitAI.prototype.SetHeldPosition = function(x, z)
|5554|5554| {
|5555|    |-	this.heldPosition = {"x": x, "z": z};
|    |5555|+	this.heldPosition = {"x": x, "z": z };
|5556|5556| };
|5557|5557| 
|5558|5558| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5579|5579| 	return false;
|5580|5580| };
|5581|5581| 
|5582|    |-//// Helper functions ////
|    |5582|+// // Helper functions ////
|5583|5583| 
|5584|5584| UnitAI.prototype.CanAttack = function(target)
|5585|5585| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5783|5783| 	return cmpPack && cmpPack.IsPacking();
|5784|5784| };
|5785|5785| 
|5786|    |-//// Formation specific functions ////
|    |5786|+// // Formation specific functions ////
|5787|5787| 
|5788|5788| UnitAI.prototype.IsAttackingAsFormation = function()
|5789|5789| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5788|5788| UnitAI.prototype.IsAttackingAsFormation = function()
|5789|5789| {
|5790|5790| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5791|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5792|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5791|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5792|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5793|5793| };
|5794|5794| 
|5795|5795| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5792|5792| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5793|5793| };
|5794|5794| 
|5795|    |-//// Animal specific functions ////
|    |5795|+// // Animal specific functions ////
|5796|5796| 
|5797|5797| UnitAI.prototype.MoveRandomly = function(distance)
|5798|5798| {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3651| »   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
|4464| »   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
|4479| »   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
|4525| »   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
|4548| »   »   ····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
| 354| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4481| »   »   &&·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
|4482| »   »   &&·(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
|5370| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5373| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5386| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5396| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5399| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

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

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

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

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

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

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

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

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

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

This revision was not accepted when it landed; it landed in state Needs Review.Jul 9 2019, 9:56 PM
This revision was automatically updated to reflect the committed changes.