Page MenuHomeWildfire Games

Don't go idle when failing to hunt an invisible animal, rather try to find a new hunt target.
ClosedPublic

Authored by wraitii on Jul 14 2019, 9:47 AM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22565: GatherNearPositiion when the target remains invisible on our second try…
Summary

As introduced by rP13132: when animals are hunting, they might need to attack the target.
If the target is invisible, they first walk to the last known position. If the target is then still invisible, they finish their order.

This behaviour however makes them go idle instead of going through the behaviour of finding a new target.

Running a replay (see attached, rP22466) where a Nabatean Camel Archer hunted a deer (2406, the one going to the right), it ended up idle after losing the animal in LOS.
There are then two issues:

  • first, the LastPos of the gather order isn't up-to-date (since we updated the one in COMBAT.APPROACHING instead), so the unit goes back to the herd position instead of trying to go to the actual last known position.
  • once there, it goes through the above described pattern and ends up idle, when there are perfectly good deer around.

This fixes the second issue by falling back to a GatherNearPosition order.

Test Plan

Try hunting a unit that then goes out of LOS. It can be reproduce occasionally with a Nabatean Camel Archer because their range is close to their LOS.

Or just run the attached replay with rP22466

Diff Detail

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

Event Timeline

wraitii created this revision.Jul 14 2019, 9:47 AM

Seems like the replay didn't go through, here it is.

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.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/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.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/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 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 743| 743| 			}
| 744| 744| 			// Check if we are already in range, otherwise walk there
| 745| 745| 			if (!this.CheckGarrisonRange(msg.data.target))
| 746|    |-			{
|    | 746|+			
| 747| 747| 				if (!this.CheckTargetVisible(msg.data.target))
| 748| 748| 				{
| 749| 749| 					this.FinishOrder();
| 754| 754| 					this.SetNextState("GARRISON.APPROACHING");
| 755| 755| 					return;
| 756| 756| 				}
| 757|    |-			}
|    | 757|+			
| 758| 758| 
| 759| 759| 			this.SetNextState("GARRISON.GARRISONING");
| 760| 760| 		},
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 749| 749| 					this.FinishOrder();
| 750| 750| 					return;
| 751| 751| 				}
| 752|    |-				else
| 753|    |-				{
|    | 752|+				
| 754| 753| 					this.SetNextState("GARRISON.APPROACHING");
| 755| 754| 					return;
| 756|    |-				}
|    | 755|+				
| 757| 756| 			}
| 758| 757| 
| 759| 758| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1011|1011| 			},
|1012|1012| 		},
|1013|1013| 
|1014|    |-		"GARRISON":{
|    |1014|+		"GARRISON": {
|1015|1015| 			"enter": function() {
|1016|1016| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1017|1017| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1224|1224| 			// If the controller handled an order but some members rejected it,
|1225|1225| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1226|1226| 			if (this.orderQueue.length)
|1227|    |-			{
|    |1227|+			
|1228|1228| 				// We're leaving the formation, so stop our FormationWalk order
|1229|1229| 				if (this.FinishOrder())
|1230|1230| 					return;
|1231|    |-			}
|    |1231|+			
|1232|1232| 
|1233|1233| 			// No orders left, we're an individual now
|1234|1234| 			this.SetNextState("INDIVIDUAL.IDLE");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1249|1249| 			// Move a tile outside the building
|1250|1250| 			let range = 4;
|1251|1251| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1252|    |-			{
|    |1252|+			
|1253|1253| 				// We are already at the target, or can't move at all
|1254|1254| 				this.FinishOrder();
|1255|    |-			}
|    |1255|+			
|1256|1256| 			else
|1257|1257| 			{
|1258|1258| 				this.order.data.min = range;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1478|1478| 
|1479|1479| 			"LosRangeUpdate": function(msg) {
|1480|1480| 				if (this.GetStance().targetVisibleEnemies)
|1481|    |-				{
|    |1481|+				
|1482|1482| 					// Start attacking one of the newly-seen enemy (if any)
|1483|1483| 					this.AttackEntitiesByPreference(msg.data.added);
|1484|    |-				}
|    |1484|+				
|1485|1485| 			},
|1486|1486| 
|1487|1487| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1506|1506| 				}
|1507|1507| 			},
|1508|1508| 
|1509|    |-			"leave": function () {
|    |1509|+			"leave": function() {
|1510|1510| 				this.StopMoving();
|1511|1511| 			},
|1512|1512| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1681|1681| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1682|1682| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1683|1683| 						if (cmpHealth && cmpHealth.IsInjured())
|1684|    |-						{
|    |1684|+						
|1685|1685| 							if (this.CanHeal(this.isGuardOf))
|1686|1686| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1687|1687| 							else if (this.CanRepair(this.isGuardOf))
|1688|1688| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1689|    |-						}
|    |1689|+						
|1690|1690| 					}
|1691|1691| 				},
|1692|1692| 
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1963|1963| 
|1964|1964| 				"Attacked": function(msg) {
|1965|1965| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1966|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1967|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1966|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1967|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1968|1968| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1969|1969| 				},
|1970|1970| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2015|2015| 
|2016|2016| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|2017|2017| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|2018|    |-					{
|    |2018|+					
|2019|2019| 						// Run after a fleeing target
|2020|2020| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2021|    |-					}
|    |2021|+					
|2022|2022| 					this.StartTimer(1000, 1000);
|2023|2023| 				},
|2024|2024| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2366|2366| 
|2367|2367| 				"Timer": function(msg) {
|2368|2368| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2369|    |-					{
|    |2369|+					
|2370|2370| 						// Return to our original position unless we have a better order.
|2371|2371| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2372|2372| 							this.WalkToHeldPosition();
|2373|    |-					}
|    |2373|+					
|2374|2374| 				},
|2375|2375| 
|2376|2376| 				"MovementUpdate": function() {
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2400|2400| 					this.StartTimer(prepare, this.healTimers.repeat);
|2401|2401| 
|2402|2402| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2403|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2403|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2404|2404| 
|2405|2405| 					this.FaceTowardsTarget(this.order.data.target);
|2406|2406| 				},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2608|2608| 					{
|2609|2609| 						// The building was already finished/fully repaired before we arrived;
|2610|2610| 						// let the ConstructionFinished handler handle this.
|2611|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2611|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2612|2612| 						return true;
|2613|2613| 					}
|2614|2614| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2608|2608| 					{
|2609|2609| 						// The building was already finished/fully repaired before we arrived;
|2610|2610| 						// let the ConstructionFinished handler handle this.
|2611|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2611|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2612|2612| 						return true;
|2613|2613| 					}
|2614|2614| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2993|2993| 		"Attacked": function(msg) {
|2994|2994| 			if (this.template.NaturalBehaviour == "skittish" ||
|2995|2995| 			    this.template.NaturalBehaviour == "passive")
|2996|    |-			{
|    |2996|+			
|2997|2997| 				this.Flee(msg.data.attacker, false);
|2998|    |-			}
|    |2998|+			
|2999|2999| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3000|3000| 			{
|3001|3001| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3002|3002| 					this.Attack(msg.data.attacker, false);
|3003|3003| 			}
|3004|3004| 			else if (this.template.NaturalBehaviour == "domestic")
|3005|    |-			{
|    |3005|+			
|3006|3006| 				// Never flee, stop what we were doing
|3007|3007| 				this.SetNextState("IDLE");
|3008|    |-			}
|    |3008|+			
|3009|3009| 		},
|3010|3010| 
|3011|3011| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3056|3056| 				}
|3057|3057| 				// Start attacking one of the newly-seen enemy (if any)
|3058|3058| 				else if (this.IsDangerousAnimal())
|3059|    |-				{
|    |3059|+				
|3060|3060| 					this.AttackVisibleEntity(msg.data.added);
|3061|    |-				}
|    |3061|+				
|3062|3062| 
|3063|3063| 				// TODO: if two units enter our range together, we'll attack the
|3064|3064| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				}
|3101|3101| 				// Start attacking one of the newly-seen enemy (if any)
|3102|3102| 				else if (this.template.NaturalBehaviour == "violent")
|3103|    |-				{
|    |3103|+				
|3104|3104| 					this.AttackVisibleEntity(msg.data.added);
|3105|    |-				}
|    |3105|+				
|3106|3106| 			},
|3107|3107| 
|3108|3108| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3115|3115| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3116|3116| 
|3117|3117| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3118|    |-							// only used for domestic animals
|    |3118|+		// only used for domestic animals
|3119|3119| 	},
|3120|3120| };
|3121|3121| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3172|3172| 
|3173|3173| UnitAI.prototype.IsAnimal = function()
|3174|3174| {
|3175|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3175|+	return (!!this.template.NaturalBehaviour);
|3176|3176| };
|3177|3177| 
|3178|3178| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3210|3210| UnitAI.prototype.GetGarrisonHolder = function()
|3211|3211| {
|3212|3212| 	if (this.IsGarrisoned())
|3213|    |-	{
|    |3213|+	
|3214|3214| 		for (let order of this.orderQueue)
|3215|3215| 			if (order.type == "Garrison")
|3216|3216| 				return order.data.target;
|3217|    |-	}
|    |3217|+	
|3218|3218| 	return INVALID_ENTITY;
|3219|3219| };
|3220|3220| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3288|3288| 		{
|3289|3289| 			let index = this.GetCurrentState().indexOf(".");
|3290|3290| 			if (index != -1)
|3291|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3291|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3292|3292| 			this.Stop(false);
|3293|3293| 		}
|3294|3294| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3344|3344| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3345|3345| 			continue;
|3346|3346| 		if (i == 0)
|3347|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3347|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3348|3348| 		else
|3349|3349| 			this.orderQueue.splice(i, 1);
|3350|3350| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3344|3344| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3345|3345| 			continue;
|3346|3346| 		if (i == 0)
|3347|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3347|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3348|3348| 		else
|3349|3349| 			this.orderQueue.splice(i, 1);
|3350|3350| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3428|3428| };
|3429|3429| 
|3430|3430| 
|3431|    |-//// FSM linkage functions ////
|    |3431|+// // FSM linkage functions ////
|3432|3432| 
|3433|3433| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3434|3434| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3600|3600| 				continue;
|3601|3601| 			if (this.orderQueue[i].type == type)
|3602|3602| 				continue;
|3603|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3603|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3604|3604| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3605|3605| 			return;
|3606|3606| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3600|3600| 				continue;
|3601|3601| 			if (this.orderQueue[i].type == type)
|3602|3602| 				continue;
|3603|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3603|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3604|3604| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3605|3605| 			return;
|3606|3606| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3614|3614| {
|3615|3615| 	// Remember the previous work orders to be able to go back to them later if required
|3616|3616| 	if (data && data.force)
|3617|    |-	{
|    |3617|+	
|3618|3618| 		if (this.IsFormationController())
|3619|3619| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3620|3620| 		else
|3621|3621| 			this.UpdateWorkOrders(type);
|3622|    |-	}
|    |3622|+	
|3623|3623| 
|3624|3624| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3625|3625| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3691|3691| 	{
|3692|3692| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3693|3693| 		if (cmpUnitAI)
|3694|    |-		{
|    |3694|+		
|3695|3695| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3696|3696| 			{
|3697|3697| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3700|3700| 					return;
|3701|3701| 				}
|3702|3702| 			}
|3703|    |-		}
|    |3703|+		
|3704|3704| 	}
|3705|3705| 
|3706|3706| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3693|3693| 		if (cmpUnitAI)
|3694|3694| 		{
|3695|3695| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3696|    |-			{
|    |3696|+			
|3697|3697| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3698|3698| 				{
|3699|3699| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3700|3700| 					return;
|3701|3701| 				}
|3702|    |-			}
|    |3702|+			
|3703|3703| 		}
|3704|3704| 	}
|3705|3705| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3705|3705| 
|3706|3706| 	// If nothing found, take the unit orders
|3707|3707| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3708|    |-	{
|    |3708|+	
|3709|3709| 		if (isWorkType(this.orderQueue[i].type))
|3710|3710| 		{
|3711|3711| 			this.workOrders = this.orderQueue.slice(i);
|3712|3712| 			return;
|3713|3713| 		}
|3714|    |-	}
|    |3714|+	
|3715|3715| };
|3716|3716| 
|3717|3717| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3771|3771| 	if (data.timerRepeat === undefined)
|3772|3772| 		this.timer = undefined;
|3773|3773| 
|3774|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3774|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3775|3775| };
|3776|3776| 
|3777|3777| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3771|3771| 	if (data.timerRepeat === undefined)
|3772|3772| 		this.timer = undefined;
|3773|3773| 
|3774|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3774|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3775|3775| };
|3776|3776| 
|3777|3777| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3806|3806| 	this.timer = undefined;
|3807|3807| };
|3808|3808| 
|3809|    |-//// Message handlers /////
|    |3809|+// // Message handlers /////
|3810|3810| 
|3811|3811| UnitAI.prototype.OnMotionChanged = function(msg)
|3812|3812| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3818|3818| 	// TODO: This is a bit inefficient since every unit listens to every
|3819|3819| 	// construction message - ideally we could scope it to only the one we're building
|3820|3820| 
|3821|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3821|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3822|3822| };
|3823|3823| 
|3824|3824| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3818|3818| 	// TODO: This is a bit inefficient since every unit listens to every
|3819|3819| 	// construction message - ideally we could scope it to only the one we're building
|3820|3820| 
|3821|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3821|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3822|3822| };
|3823|3823| 
|3824|3824| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3843|3843| 
|3844|3844| UnitAI.prototype.OnAttacked = function(msg)
|3845|3845| {
|3846|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3846|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3847|3847| };
|3848|3848| 
|3849|3849| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3843|3843| 
|3844|3844| UnitAI.prototype.OnAttacked = function(msg)
|3845|3845| {
|3846|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3846|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3847|3847| };
|3848|3848| 
|3849|3849| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3848|3848| 
|3849|3849| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3850|3850| {
|3851|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3851|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3852|3852| };
|3853|3853| 
|3854|3854| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3848|3848| 
|3849|3849| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3850|3850| {
|3851|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3851|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3852|3852| };
|3853|3853| 
|3854|3854| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3853|3853| 
|3854|3854| UnitAI.prototype.OnHealthChanged = function(msg)
|3855|3855| {
|3856|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3856|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3857|3857| };
|3858|3858| 
|3859|3859| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3853|3853| 
|3854|3854| UnitAI.prototype.OnHealthChanged = function(msg)
|3855|3855| {
|3856|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3856|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3857|3857| };
|3858|3858| 
|3859|3859| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3859|3859| UnitAI.prototype.OnRangeUpdate = function(msg)
|3860|3860| {
|3861|3861| 	if (msg.tag == this.losRangeQuery)
|3862|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3862|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3863|3863| 	else if (msg.tag == this.losHealRangeQuery)
|3864|3864| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3865|3865| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3859|3859| UnitAI.prototype.OnRangeUpdate = function(msg)
|3860|3860| {
|3861|3861| 	if (msg.tag == this.losRangeQuery)
|3862|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3862|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3863|3863| 	else if (msg.tag == this.losHealRangeQuery)
|3864|3864| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3865|3865| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3861|3861| 	if (msg.tag == this.losRangeQuery)
|3862|3862| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3863|3863| 	else if (msg.tag == this.losHealRangeQuery)
|3864|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3864|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3865|3865| };
|3866|3866| 
|3867|3867| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3861|3861| 	if (msg.tag == this.losRangeQuery)
|3862|3862| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3863|3863| 	else if (msg.tag == this.losHealRangeQuery)
|3864|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3864|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3865|3865| };
|3866|3866| 
|3867|3867| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| 
|3867|3867| UnitAI.prototype.OnPackFinished = function(msg)
|3868|3868| {
|3869|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3869|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3870|3870| };
|3871|3871| 
|3872|3872| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| 
|3867|3867| UnitAI.prototype.OnPackFinished = function(msg)
|3868|3868| {
|3869|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3869|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3870|3870| };
|3871|3871| 
|3872|3872| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3869|3869| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3870|3870| };
|3871|3871| 
|3872|    |-//// Helper functions to be called by the FSM ////
|    |3872|+// // Helper functions to be called by the FSM ////
|3873|3873| 
|3874|3874| UnitAI.prototype.GetWalkSpeed = function()
|3875|3875| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4056|4056| 			PlaySound(name, member);
|4057|4057| 	}
|4058|4058| 	else
|4059|    |-	{
|    |4059|+	
|4060|4060| 		// Otherwise use our own sounds
|4061|4061| 		PlaySound(name, this.entity);
|4062|    |-	}
|    |4062|+	
|4063|4063| };
|4064|4064| 
|4065|4065| /*
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4502|4502| UnitAI.prototype.AttackEntityInZone = function(ents)
|4503|4503| {
|4504|4504| 	var target = ents.find(target =>
|4505|    |-		this.CanAttack(target)
|4506|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4505|+		this.CanAttack(target) &&
|    |4506|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4507|4507| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4508|4508| 	);
|4509|4509| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4503|4503| {
|4504|4504| 	var target = ents.find(target =>
|4505|4505| 		this.CanAttack(target)
|4506|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4507|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4506|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4507|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4508|4508| 	);
|4509|4509| 	if (!target)
|4510|4510| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4567|4567| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4568|4568| 	if (this.isGuardOf)
|4569|4569| 	{
|4570|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4570|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4571|4571| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4572|4572| 		if (cmpUnitAI && cmpAttack &&
|4573|4573| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4571|4571| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4572|4572| 		if (cmpUnitAI && cmpAttack &&
|4573|4573| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4574|    |-				return false;
|    |4574|+			return false;
|4575|4575| 	}
|4576|4576| 
|4577|4577| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4576|4576| 
|4577|4577| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4578|4578| 	if (this.GetStance().respondHoldGround)
|4579|    |-	{
|    |4579|+	
|4580|4580| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4581|4581| 			return true;
|4582|    |-	}
|    |4582|+	
|4583|4583| 
|4584|4584| 	// Stop if it's left our vision range, unless we're especially persistent
|4585|4585| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4583|4583| 
|4584|4584| 	// Stop if it's left our vision range, unless we're especially persistent
|4585|4585| 	if (!this.GetStance().respondChaseBeyondVision)
|4586|    |-	{
|    |4586|+	
|4587|4587| 		if (!this.CheckTargetIsInVisionRange(target))
|4588|4588| 			return true;
|4589|    |-	}
|    |4589|+	
|4590|4590| 
|4591|4591| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4592|4592| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4609|4609| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4610|4610| 	if (this.isGuardOf)
|4611|4611| 	{
|4612|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4612|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4613|4613| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4614|4614| 		if (cmpUnitAI && cmpAttack &&
|4615|4615| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4622|4622| 	return false;
|4623|4623| };
|4624|4624| 
|4625|    |-//// External interface functions ////
|    |4625|+// // External interface functions ////
|4626|4626| 
|4627|4627| UnitAI.prototype.SetFormationController = function(ent)
|4628|4628| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4632|4632| 	// of our own formation (or ourself if not in formation)
|4633|4633| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4634|4634| 	if (cmpObstruction)
|4635|    |-	{
|    |4635|+	
|4636|4636| 		if (ent == INVALID_ENTITY)
|4637|4637| 			cmpObstruction.SetControlGroup(this.entity);
|4638|4638| 		else
|4639|4639| 			cmpObstruction.SetControlGroup(ent);
|4640|    |-	}
|    |4640|+	
|4641|4641| 
|4642|4642| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4643|4643| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4775|4775| 	// if we already had an old guard order, do nothing if the target is the same
|4776|4776| 	// and the order is running, otherwise remove the previous order
|4777|4777| 	if (this.isGuardOf)
|4778|    |-	{
|    |4778|+	
|4779|4779| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4780|4780| 			return;
|4781|4781| 		else
|4782|4782| 			this.RemoveGuard();
|4783|    |-	}
|    |4783|+	
|4784|4784| 
|4785|4785| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4786|4786| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4778|4778| 	{
|4779|4779| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4780|4780| 			return;
|4781|    |-		else
|4782|    |-			this.RemoveGuard();
|    |4781|+		this.RemoveGuard();
|4783|4782| 	}
|4784|4783| 
|4785|4784| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5110|5110| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5111|5111| 	{
|5112|5112| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5113|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5113|+		if (cmpTrader.HasBothMarkets() &&
|5114|5114| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5115|5115| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5116|5116| 		{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5391|5391| 				{
|5392|5392| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5393|5393| 					var targetClasses = this.order.data.targetClasses;
|5394|    |-					if (targetClasses.attack && cmpIdentity
|5395|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5394|+					if (targetClasses.attack && cmpIdentity &&
|    |5395|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5396|5396| 						continue;
|5397|5397| 					if (targetClasses.avoid && cmpIdentity
|5398|5398| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5394|5394| 					if (targetClasses.attack && cmpIdentity
|5395|5395| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5396|5396| 						continue;
|5397|    |-					if (targetClasses.avoid && cmpIdentity
|5398|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5397|+					if (targetClasses.avoid && cmpIdentity &&
|    |5398|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5399|5399| 						continue;
|5400|5400| 					// Only used by the AIs to prevent some choices of targets
|5401|5401| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5417|5417| 		{
|5418|5418| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5419|5419| 			var targetClasses = this.order.data.targetClasses;
|5420|    |-			if (cmpIdentity && targetClasses.attack
|5421|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5420|+			if (cmpIdentity && targetClasses.attack &&
|    |5421|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5422|5422| 				continue;
|5423|5423| 			if (cmpIdentity && targetClasses.avoid
|5424|5424| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5420|5420| 			if (cmpIdentity && targetClasses.attack
|5421|5421| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5422|5422| 				continue;
|5423|    |-			if (cmpIdentity && targetClasses.avoid
|5424|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5423|+			if (cmpIdentity && targetClasses.avoid &&
|    |5424|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5425|5425| 				continue;
|5426|5426| 			// Only used by the AIs to prevent some choices of targets
|5427|5427| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5577|5577| 
|5578|5578| UnitAI.prototype.SetHeldPosition = function(x, z)
|5579|5579| {
|5580|    |-	this.heldPosition = {"x": x, "z": z};
|    |5580|+	this.heldPosition = { "x": x, "z": z};
|5581|5581| };
|5582|5582| 
|5583|5583| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5577|5577| 
|5578|5578| UnitAI.prototype.SetHeldPosition = function(x, z)
|5579|5579| {
|5580|    |-	this.heldPosition = {"x": x, "z": z};
|    |5580|+	this.heldPosition = {"x": x, "z": z };
|5581|5581| };
|5582|5582| 
|5583|5583| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5604|5604| 	return false;
|5605|5605| };
|5606|5606| 
|5607|    |-//// Helper functions ////
|    |5607|+// // Helper functions ////
|5608|5608| 
|5609|5609| UnitAI.prototype.CanAttack = function(target)
|5610|5610| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5808|5808| 	return cmpPack && cmpPack.IsPacking();
|5809|5809| };
|5810|5810| 
|5811|    |-//// Formation specific functions ////
|    |5811|+// // Formation specific functions ////
|5812|5812| 
|5813|5813| UnitAI.prototype.IsAttackingAsFormation = function()
|5814|5814| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5813|5813| UnitAI.prototype.IsAttackingAsFormation = function()
|5814|5814| {
|5815|5815| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5816|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5817|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5816|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5817|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5818|5818| };
|5819|5819| 
|5820|5820| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5817|5817| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5818|5818| };
|5819|5819| 
|5820|    |-//// Animal specific functions ////
|    |5820|+// // Animal specific functions ////
|5821|5821| 
|5822|5822| UnitAI.prototype.MoveRandomly = function(distance)
|5823|5823| {

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
| 904| »   »   »   "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
| 926| »   »   »   "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
| 973| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|1071| »   »   »   "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
|1103| »   »   »   »   "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
|1263| »   »   "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
|1322| »   »   »   "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
|1501| »   »   »   "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
|1520| »   »   »   "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
|1549| »   »   »   "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
|1701| »   »   »   "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
|1751| »   »   »   »   "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
|1826| »   »   »   »   "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
|1990| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2771| »   »   »   »   "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
|2951| »   »   »   »   "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
|3676| »   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
|4489| »   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
|4504| »   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
|4550| »   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
|4573| »   »   ····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
|1967| »   »   »   »   »   »   &&·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
|2503| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5817| »   »   &&·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/docker-differential/69/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Sun, Jul 28, 11:48 AM
This revision was automatically updated to reflect the committed changes.