Page MenuHomeWildfire Games

Fix walk-to-target and other movements with max-range "0" for target entities
ClosedPublic

Authored by wraitii on Jul 16 2019, 9:35 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22496: Fix walk-to-target and other movements with max-range "0" for target entities
Trac Tickets
#5510
Summary

Entities may never get to a distance of "0" when trying to reach other entities, as that would mean they are right next to each other, or even overlapping, which is not really a desirable situation, and can fail.

Always give some leeway to distance when trying to move to a target with no specified max-range.

This fixes #5510's stuck units.

Test Plan

See minimal replay at #5510.

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 16 2019, 9:35 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 'else'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 516| 516| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 517| 517| 				}
| 518| 518| 				else
| 519|    |-				{
|    | 519|+				
| 520| 520| 					// We couldn't move there, or the target moved away
| 521| 521| 					this.FinishOrder();
| 522|    |-				}
|    | 522|+				
| 523| 523| 				return;
| 524| 524| 			}
| 525| 525| 
|    | [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
| 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'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/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'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/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'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/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.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/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| 			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
|1236|1236| 			// Move a tile outside the building
|1237|1237| 			let range = 4;
|1238|1238| 			if (this.CheckTargetRangeExplicit(msg.data.target, range, -1))
|1239|    |-			{
|    |1239|+			
|1240|1240| 				// We are already at the target, or can't move at all
|1241|1241| 				this.FinishOrder();
|1242|    |-			}
|    |1242|+			
|1243|1243| 			else
|1244|1244| 			{
|1245|1245| 				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
|1437|1437| 
|1438|1438| 			"LosRangeUpdate": function(msg) {
|1439|1439| 				if (this.GetStance().targetVisibleEnemies)
|1440|    |-				{
|    |1440|+				
|1441|1441| 					// Start attacking one of the newly-seen enemy (if any)
|1442|1442| 					this.AttackEntitiesByPreference(msg.data.added);
|1443|    |-				}
|    |1443|+				
|1444|1444| 			},
|1445|1445| 
|1446|1446| 			"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
|1485|1485| 				}
|1486|1486| 			},
|1487|1487| 
|1488|    |-			"leave": function () {
|    |1488|+			"leave": function() {
|1489|1489| 				this.StopMoving();
|1490|1490| 			},
|1491|1491| 
|    | [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
|1660|1660| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1661|1661| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1662|1662| 						if (cmpHealth && cmpHealth.IsInjured())
|1663|    |-						{
|    |1663|+						
|1664|1664| 							if (this.CanHeal(this.isGuardOf))
|1665|1665| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1666|1666| 							else if (this.CanRepair(this.isGuardOf))
|1667|1667| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1668|    |-						}
|    |1668|+						
|1669|1669| 					}
|1670|1670| 				},
|1671|1671| 
|    | [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
|1942|1942| 
|1943|1943| 				"Attacked": function(msg) {
|1944|1944| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1945|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1946|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1945|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1946|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1947|1947| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1948|1948| 				},
|1949|1949| 			},
|    | [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
|1994|1994| 
|1995|1995| 					var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI);
|1996|1996| 					if (cmpUnitAI && cmpUnitAI.IsFleeing())
|1997|    |-					{
|    |1997|+					
|1998|1998| 						// Run after a fleeing target
|1999|1999| 						this.SetSpeedMultiplier(this.GetRunMultiplier());
|2000|    |-					}
|    |2000|+					
|2001|2001| 					this.StartTimer(1000, 1000);
|2002|2002| 				},
|2003|2003| 
|    | [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
|2345|2345| 
|2346|2346| 				"Timer": function(msg) {
|2347|2347| 					if (this.ShouldAbandonChase(this.order.data.target, this.order.data.force, IID_Heal, null))
|2348|    |-					{
|    |2348|+					
|2349|2349| 						// Return to our original position unless we have a better order.
|2350|2350| 						if (!this.FinishOrder() && this.GetStance().respondHoldGround)
|2351|2351| 							this.WalkToHeldPosition();
|2352|    |-					}
|    |2352|+					
|2353|2353| 				},
|2354|2354| 
|2355|2355| 				"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
|2379|2379| 					this.StartTimer(prepare, this.healTimers.repeat);
|2380|2380| 
|2381|2381| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2382|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2382|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2383|2383| 
|2384|2384| 					this.FaceTowardsTarget(this.order.data.target);
|2385|2385| 				},
|    | [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
|2587|2587| 					{
|2588|2588| 						// The building was already finished/fully repaired before we arrived;
|2589|2589| 						// let the ConstructionFinished handler handle this.
|2590|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2590|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2591|2591| 						return true;
|2592|2592| 					}
|2593|2593| 
|    | [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
|2587|2587| 					{
|2588|2588| 						// The building was already finished/fully repaired before we arrived;
|2589|2589| 						// let the ConstructionFinished handler handle this.
|2590|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2590|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2591|2591| 						return true;
|2592|2592| 					}
|2593|2593| 
|    | [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
|2972|2972| 		"Attacked": function(msg) {
|2973|2973| 			if (this.template.NaturalBehaviour == "skittish" ||
|2974|2974| 			    this.template.NaturalBehaviour == "passive")
|2975|    |-			{
|    |2975|+			
|2976|2976| 				this.Flee(msg.data.attacker, false);
|2977|    |-			}
|    |2977|+			
|2978|2978| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|2979|2979| 			{
|2980|2980| 				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
|2981|2981| 					this.Attack(msg.data.attacker, false);
|2982|2982| 			}
|2983|2983| 			else if (this.template.NaturalBehaviour == "domestic")
|2984|    |-			{
|    |2984|+			
|2985|2985| 				// Never flee, stop what we were doing
|2986|2986| 				this.SetNextState("IDLE");
|2987|    |-			}
|    |2987|+			
|2988|2988| 		},
|2989|2989| 
|2990|2990| 		"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
|3035|3035| 				}
|3036|3036| 				// Start attacking one of the newly-seen enemy (if any)
|3037|3037| 				else if (this.IsDangerousAnimal())
|3038|    |-				{
|    |3038|+				
|3039|3039| 					this.AttackVisibleEntity(msg.data.added);
|3040|    |-				}
|    |3040|+				
|3041|3041| 
|3042|3042| 				// TODO: if two units enter our range together, we'll attack the
|3043|3043| 				// 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
|3079|3079| 				}
|3080|3080| 				// Start attacking one of the newly-seen enemy (if any)
|3081|3081| 				else if (this.template.NaturalBehaviour == "violent")
|3082|    |-				{
|    |3082|+				
|3083|3083| 					this.AttackVisibleEntity(msg.data.added);
|3084|    |-				}
|    |3084|+				
|3085|3085| 			},
|3086|3086| 
|3087|3087| 			"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
|3094|3094| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3095|3095| 
|3096|3096| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3097|    |-							// only used for domestic animals
|    |3097|+		// only used for domestic animals
|3098|3098| 	},
|3099|3099| };
|3100|3100| 
|    | [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
|3151|3151| 
|3152|3152| UnitAI.prototype.IsAnimal = function()
|3153|3153| {
|3154|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3154|+	return (!!this.template.NaturalBehaviour);
|3155|3155| };
|3156|3156| 
|3157|3157| 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
|3189|3189| UnitAI.prototype.GetGarrisonHolder = function()
|3190|3190| {
|3191|3191| 	if (this.IsGarrisoned())
|3192|    |-	{
|    |3192|+	
|3193|3193| 		for (let order of this.orderQueue)
|3194|3194| 			if (order.type == "Garrison")
|3195|3195| 				return order.data.target;
|3196|    |-	}
|    |3196|+	
|3197|3197| 	return INVALID_ENTITY;
|3198|3198| };
|3199|3199| 
|    | [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
|3267|3267| 		{
|3268|3268| 			let index = this.GetCurrentState().indexOf(".");
|3269|3269| 			if (index != -1)
|3270|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3270|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3271|3271| 			this.Stop(false);
|3272|3272| 		}
|3273|3273| 
|    | [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
|3323|3323| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3324|3324| 			continue;
|3325|3325| 		if (i == 0)
|3326|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3326|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3327|3327| 		else
|3328|3328| 			this.orderQueue.splice(i, 1);
|3329|3329| 		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
|3323|3323| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3324|3324| 			continue;
|3325|3325| 		if (i == 0)
|3326|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3326|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3327|3327| 		else
|3328|3328| 			this.orderQueue.splice(i, 1);
|3329|3329| 		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
|3407|3407| };
|3408|3408| 
|3409|3409| 
|3410|    |-//// FSM linkage functions ////
|    |3410|+// // FSM linkage functions ////
|3411|3411| 
|3412|3412| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3413|3413| 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
|3577|3577| 				continue;
|3578|3578| 			if (this.orderQueue[i].type == type)
|3579|3579| 				continue;
|3580|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3580|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3581|3581| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3582|3582| 			return;
|3583|3583| 		}
|    | [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
|3577|3577| 				continue;
|3578|3578| 			if (this.orderQueue[i].type == type)
|3579|3579| 				continue;
|3580|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3580|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3581|3581| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3582|3582| 			return;
|3583|3583| 		}
|    | [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
|3591|3591| {
|3592|3592| 	// Remember the previous work orders to be able to go back to them later if required
|3593|3593| 	if (data && data.force)
|3594|    |-	{
|    |3594|+	
|3595|3595| 		if (this.IsFormationController())
|3596|3596| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3597|3597| 		else
|3598|3598| 			this.UpdateWorkOrders(type);
|3599|    |-	}
|    |3599|+	
|3600|3600| 
|3601|3601| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3602|3602| 
|    | [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
|3668|3668| 	{
|3669|3669| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3670|3670| 		if (cmpUnitAI)
|3671|    |-		{
|    |3671|+		
|3672|3672| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3673|3673| 			{
|3674|3674| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3677|3677| 					return;
|3678|3678| 				}
|3679|3679| 			}
|3680|    |-		}
|    |3680|+		
|3681|3681| 	}
|3682|3682| 
|3683|3683| 	// 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
|3670|3670| 		if (cmpUnitAI)
|3671|3671| 		{
|3672|3672| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3673|    |-			{
|    |3673|+			
|3674|3674| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3675|3675| 				{
|3676|3676| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3677|3677| 					return;
|3678|3678| 				}
|3679|    |-			}
|    |3679|+			
|3680|3680| 		}
|3681|3681| 	}
|3682|3682| 
|    | [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
|3682|3682| 
|3683|3683| 	// If nothing found, take the unit orders
|3684|3684| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3685|    |-	{
|    |3685|+	
|3686|3686| 		if (isWorkType(this.orderQueue[i].type))
|3687|3687| 		{
|3688|3688| 			this.workOrders = this.orderQueue.slice(i);
|3689|3689| 			return;
|3690|3690| 		}
|3691|    |-	}
|    |3691|+	
|3692|3692| };
|3693|3693| 
|3694|3694| 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
|3748|3748| 	if (data.timerRepeat === undefined)
|3749|3749| 		this.timer = undefined;
|3750|3750| 
|3751|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3751|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3752|3752| };
|3753|3753| 
|3754|3754| /**
|    | [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
|3748|3748| 	if (data.timerRepeat === undefined)
|3749|3749| 		this.timer = undefined;
|3750|3750| 
|3751|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3751|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3752|3752| };
|3753|3753| 
|3754|3754| /**
|    | [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
|3783|3783| 	this.timer = undefined;
|3784|3784| };
|3785|3785| 
|3786|    |-//// Message handlers /////
|    |3786|+// // Message handlers /////
|3787|3787| 
|3788|3788| UnitAI.prototype.OnMotionChanged = function(msg)
|3789|3789| {
|    | [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
|3795|3795| 	// TODO: This is a bit inefficient since every unit listens to every
|3796|3796| 	// construction message - ideally we could scope it to only the one we're building
|3797|3797| 
|3798|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3798|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3799|3799| };
|3800|3800| 
|3801|3801| 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
|3795|3795| 	// TODO: This is a bit inefficient since every unit listens to every
|3796|3796| 	// construction message - ideally we could scope it to only the one we're building
|3797|3797| 
|3798|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3798|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3799|3799| };
|3800|3800| 
|3801|3801| 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
|3820|3820| 
|3821|3821| UnitAI.prototype.OnAttacked = function(msg)
|3822|3822| {
|3823|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3823|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3824|3824| };
|3825|3825| 
|3826|3826| 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
|3820|3820| 
|3821|3821| UnitAI.prototype.OnAttacked = function(msg)
|3822|3822| {
|3823|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3823|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3824|3824| };
|3825|3825| 
|3826|3826| 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
|3825|3825| 
|3826|3826| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3827|3827| {
|3828|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3828|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3829|3829| };
|3830|3830| 
|3831|3831| 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
|3825|3825| 
|3826|3826| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3827|3827| {
|3828|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3828|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3829|3829| };
|3830|3830| 
|3831|3831| 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
|3830|3830| 
|3831|3831| UnitAI.prototype.OnHealthChanged = function(msg)
|3832|3832| {
|3833|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3833|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3834|3834| };
|3835|3835| 
|3836|3836| 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
|3830|3830| 
|3831|3831| UnitAI.prototype.OnHealthChanged = function(msg)
|3832|3832| {
|3833|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3833|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3834|3834| };
|3835|3835| 
|3836|3836| 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
|3836|3836| UnitAI.prototype.OnRangeUpdate = function(msg)
|3837|3837| {
|3838|3838| 	if (msg.tag == this.losRangeQuery)
|3839|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3839|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3840|3840| 	else if (msg.tag == this.losHealRangeQuery)
|3841|3841| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3842|3842| };
|    | [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
|3836|3836| UnitAI.prototype.OnRangeUpdate = function(msg)
|3837|3837| {
|3838|3838| 	if (msg.tag == this.losRangeQuery)
|3839|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3839|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3840|3840| 	else if (msg.tag == this.losHealRangeQuery)
|3841|3841| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3842|3842| };
|    | [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
|3838|3838| 	if (msg.tag == this.losRangeQuery)
|3839|3839| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3840|3840| 	else if (msg.tag == this.losHealRangeQuery)
|3841|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3841|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3842|3842| };
|3843|3843| 
|3844|3844| 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
|3838|3838| 	if (msg.tag == this.losRangeQuery)
|3839|3839| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3840|3840| 	else if (msg.tag == this.losHealRangeQuery)
|3841|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3841|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3842|3842| };
|3843|3843| 
|3844|3844| 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
|3843|3843| 
|3844|3844| UnitAI.prototype.OnPackFinished = function(msg)
|3845|3845| {
|3846|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3846|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3847|3847| };
|3848|3848| 
|3849|3849| //// 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
|3843|3843| 
|3844|3844| UnitAI.prototype.OnPackFinished = function(msg)
|3845|3845| {
|3846|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3846|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3847|3847| };
|3848|3848| 
|3849|3849| //// 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
|3846|3846| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3847|3847| };
|3848|3848| 
|3849|    |-//// Helper functions to be called by the FSM ////
|    |3849|+// // Helper functions to be called by the FSM ////
|3850|3850| 
|3851|3851| UnitAI.prototype.GetWalkSpeed = function()
|3852|3852| {
|    | [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
|4033|4033| 			PlaySound(name, member);
|4034|4034| 	}
|4035|4035| 	else
|4036|    |-	{
|    |4036|+	
|4037|4037| 		// Otherwise use our own sounds
|4038|4038| 		PlaySound(name, this.entity);
|4039|    |-	}
|    |4039|+	
|4040|4040| };
|4041|4041| 
|4042|4042| /*
|    | [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
|4479|4479| UnitAI.prototype.AttackEntityInZone = function(ents)
|4480|4480| {
|4481|4481| 	var target = ents.find(target =>
|4482|    |-		this.CanAttack(target)
|4483|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4482|+		this.CanAttack(target) &&
|    |4483|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4484|4484| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4485|4485| 	);
|4486|4486| 	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
|4480|4480| {
|4481|4481| 	var target = ents.find(target =>
|4482|4482| 		this.CanAttack(target)
|4483|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4484|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4483|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4484|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4485|4485| 	);
|4486|4486| 	if (!target)
|4487|4487| 		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
|4544|4544| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4545|4545| 	if (this.isGuardOf)
|4546|4546| 	{
|4547|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4547|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4548|4548| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4549|4549| 		if (cmpUnitAI && cmpAttack &&
|4550|4550| 		    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
|4548|4548| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4549|4549| 		if (cmpUnitAI && cmpAttack &&
|4550|4550| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4551|    |-				return false;
|    |4551|+			return false;
|4552|4552| 	}
|4553|4553| 
|4554|4554| 	// 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
|4553|4553| 
|4554|4554| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4555|4555| 	if (this.GetStance().respondHoldGround)
|4556|    |-	{
|    |4556|+	
|4557|4557| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4558|4558| 			return true;
|4559|    |-	}
|    |4559|+	
|4560|4560| 
|4561|4561| 	// Stop if it's left our vision range, unless we're especially persistent
|4562|4562| 	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
|4560|4560| 
|4561|4561| 	// Stop if it's left our vision range, unless we're especially persistent
|4562|4562| 	if (!this.GetStance().respondChaseBeyondVision)
|4563|    |-	{
|    |4563|+	
|4564|4564| 		if (!this.CheckTargetIsInVisionRange(target))
|4565|4565| 			return true;
|4566|    |-	}
|    |4566|+	
|4567|4567| 
|4568|4568| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4569|4569| 	// 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
|4586|4586| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4587|4587| 	if (this.isGuardOf)
|4588|4588| 	{
|4589|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4589|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4590|4590| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4591|4591| 		if (cmpUnitAI && cmpAttack &&
|4592|4592| 		    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
|4599|4599| 	return false;
|4600|4600| };
|4601|4601| 
|4602|    |-//// External interface functions ////
|    |4602|+// // External interface functions ////
|4603|4603| 
|4604|4604| UnitAI.prototype.SetFormationController = function(ent)
|4605|4605| {
|    | [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
|4609|4609| 	// of our own formation (or ourself if not in formation)
|4610|4610| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4611|4611| 	if (cmpObstruction)
|4612|    |-	{
|    |4612|+	
|4613|4613| 		if (ent == INVALID_ENTITY)
|4614|4614| 			cmpObstruction.SetControlGroup(this.entity);
|4615|4615| 		else
|4616|4616| 			cmpObstruction.SetControlGroup(ent);
|4617|    |-	}
|    |4617|+	
|4618|4618| 
|4619|4619| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4620|4620| 	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
|4752|4752| 	// if we already had an old guard order, do nothing if the target is the same
|4753|4753| 	// and the order is running, otherwise remove the previous order
|4754|4754| 	if (this.isGuardOf)
|4755|    |-	{
|    |4755|+	
|4756|4756| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4757|4757| 			return;
|4758|4758| 		else
|4759|4759| 			this.RemoveGuard();
|4760|    |-	}
|    |4760|+	
|4761|4761| 
|4762|4762| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4763|4763| };
|    | [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
|4755|4755| 	{
|4756|4756| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4757|4757| 			return;
|4758|    |-		else
|4759|    |-			this.RemoveGuard();
|    |4758|+		this.RemoveGuard();
|4760|4759| 	}
|4761|4760| 
|4762|4761| 	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
|5087|5087| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5088|5088| 	{
|5089|5089| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5090|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5090|+		if (cmpTrader.HasBothMarkets() &&
|5091|5091| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5092|5092| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5093|5093| 		{
|    | [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
|5368|5368| 				{
|5369|5369| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5370|5370| 					var targetClasses = this.order.data.targetClasses;
|5371|    |-					if (targetClasses.attack && cmpIdentity
|5372|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5371|+					if (targetClasses.attack && cmpIdentity &&
|    |5372|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5373|5373| 						continue;
|5374|5374| 					if (targetClasses.avoid && cmpIdentity
|5375|5375| 						&& 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
|5371|5371| 					if (targetClasses.attack && cmpIdentity
|5372|5372| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5373|5373| 						continue;
|5374|    |-					if (targetClasses.avoid && cmpIdentity
|5375|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5374|+					if (targetClasses.avoid && cmpIdentity &&
|    |5375|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5376|5376| 						continue;
|5377|5377| 					// Only used by the AIs to prevent some choices of targets
|5378|5378| 					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
|5394|5394| 		{
|5395|5395| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5396|5396| 			var targetClasses = this.order.data.targetClasses;
|5397|    |-			if (cmpIdentity && targetClasses.attack
|5398|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5397|+			if (cmpIdentity && targetClasses.attack &&
|    |5398|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5399|5399| 				continue;
|5400|5400| 			if (cmpIdentity && targetClasses.avoid
|5401|5401| 				&& 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
|5397|5397| 			if (cmpIdentity && targetClasses.attack
|5398|5398| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5399|5399| 				continue;
|5400|    |-			if (cmpIdentity && targetClasses.avoid
|5401|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5400|+			if (cmpIdentity && targetClasses.avoid &&
|    |5401|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5402|5402| 				continue;
|5403|5403| 			// Only used by the AIs to prevent some choices of targets
|5404|5404| 			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
|5554|5554| 
|5555|5555| UnitAI.prototype.SetHeldPosition = function(x, z)
|5556|5556| {
|5557|    |-	this.heldPosition = {"x": x, "z": z};
|    |5557|+	this.heldPosition = { "x": x, "z": z};
|5558|5558| };
|5559|5559| 
|5560|5560| 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
|5554|5554| 
|5555|5555| UnitAI.prototype.SetHeldPosition = function(x, z)
|5556|5556| {
|5557|    |-	this.heldPosition = {"x": x, "z": z};
|    |5557|+	this.heldPosition = {"x": x, "z": z };
|5558|5558| };
|5559|5559| 
|5560|5560| 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
|5581|5581| 	return false;
|5582|5582| };
|5583|5583| 
|5584|    |-//// Helper functions ////
|    |5584|+// // Helper functions ////
|5585|5585| 
|5586|5586| UnitAI.prototype.CanAttack = function(target)
|5587|5587| {
|    | [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
|5785|5785| 	return cmpPack && cmpPack.IsPacking();
|5786|5786| };
|5787|5787| 
|5788|    |-//// Formation specific functions ////
|    |5788|+// // Formation specific functions ////
|5789|5789| 
|5790|5790| UnitAI.prototype.IsAttackingAsFormation = function()
|5791|5791| {
|    | [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
|5790|5790| UnitAI.prototype.IsAttackingAsFormation = function()
|5791|5791| {
|5792|5792| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5793|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5794|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5793|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5794|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5795|5795| };
|5796|5796| 
|5797|5797| //// 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
|5794|5794| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5795|5795| };
|5796|5796| 
|5797|    |-//// Animal specific functions ////
|    |5797|+// // Animal specific functions ////
|5798|5798| 
|5799|5799| UnitAI.prototype.MoveRandomly = function(distance)
|5800|5800| {

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
|1250| »   »   "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
|1309| »   »   »   "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
|1400| »   »   »   "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
|1480| »   »   »   "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
|1499| »   »   »   "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
|1528| »   »   »   "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
|1680| »   »   »   "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
|1730| »   »   »   »   "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
|1805| »   »   »   »   "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
|1969| »   »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|1985| »   »   »   »   "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
|2073| »   »   »   »   "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
|2325| »   »   »   »   "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
|2443| »   »   »   »   "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
|2505| »   »   »   »   "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
|2544| »   »   »   »   "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
|2750| »   »   »   »   "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
|2930| »   »   »   »   "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
|3653| »   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
|4466| »   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
|4481| »   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
|4527| »   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
|4550| »   »   ····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
|1946| »   »   »   »   »   »   &&·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
|2482| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5794| »   »   &&·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/101/display/redirect

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