Page MenuHomeWildfire Games

Create function to match a target's speed.
ClosedPublic

Authored by Freagarach on May 13 2020, 7:52 PM.

Details

Summary

When escorting the speed of the guarded entity is matched. This diff creates a function for that behaviour, to allow to use it for other purposes as well (D1958, the follow state).

Test Plan

Verify that when guarding an entity the speed is matched if it is slower, but walking speed is maintained when the target is faster.

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

Freagarach created this revision.May 13 2020, 7:52 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [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
| 788| 788| 					this.FinishOrder();
| 789| 789| 					return;
| 790| 790| 				}
| 791|    |-				else
| 792|    |-				{
|    | 791|+				
| 793| 792| 					this.SetNextState("GARRISON.APPROACHING");
| 794| 793| 					return;
| 795|    |-				}
|    | 794|+				
| 796| 795| 			}
| 797| 796| 
| 798| 797| 			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
|1060|1060| 			},
|1061|1061| 		},
|1062|1062| 
|1063|    |-		"GARRISON":{
|    |1063|+		"GARRISON": {
|1064|1064| 			"APPROACHING": {
|1065|1065| 				"enter": function() {
|1066|1066| 					if (!this.MoveToGarrisonRange(this.order.data.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
|2034|2034| 
|2035|2035| 				"Attacked": function(msg) {
|2036|2036| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2037|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2038|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2037|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2038|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2039|2039| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2040|2040| 				},
|2041|2041| 			},
|    | [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
|2193|2193| 					"MovementUpdate": function(msg) {
|2194|2194| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2195|2195| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2196|    |-						if (msg.likelyFailure || 
|    |2196|+						if (msg.likelyFailure ||
|2197|2197| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2198|2198| 							!msg.obstructed && this.CheckRange(this.order.data))
|2199|2199| 							this.FinishOrder();
|    | [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
|2835|2835| 					{
|2836|2836| 						// The building was already finished/fully repaired before we arrived;
|2837|2837| 						// let the ConstructionFinished handler handle this.
|2838|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2838|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2839|2839| 						return true;
|2840|2840| 					}
|2841|2841| 
|    | [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
|2835|2835| 					{
|2836|2836| 						// The building was already finished/fully repaired before we arrived;
|2837|2837| 						// let the ConstructionFinished handler handle this.
|2838|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2838|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2839|2839| 						return true;
|2840|2840| 					}
|2841|2841| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3133|3133| 				this.StopTimer();
|3134|3134| 				this.ResetAnimation();
|3135|3135| 				if (this.formationAnimationVariant)
|3136|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3136|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3137|3137| 				else
|3138|3138| 					this.SetDefaultAnimationVariant();
|3139|3139| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [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
|3359|3359| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3360|3360| 
|3361|3361| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3362|    |-							// only used for domestic animals
|    |3362|+		// only used for domestic animals
|3363|3363| 
|3364|3364| 		// Reuse the same garrison behaviour for animals.
|3365|3365| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [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
|3421|3421| 
|3422|3422| UnitAI.prototype.IsAnimal = function()
|3423|3423| {
|3424|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3424|+	return (!!this.template.NaturalBehaviour);
|3425|3425| };
|3426|3426| 
|3427|3427| UnitAI.prototype.IsDangerousAnimal = function()
|    | [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
|3537|3537| 		{
|3538|3538| 			let index = this.GetCurrentState().indexOf(".");
|3539|3539| 			if (index != -1)
|3540|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3540|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3541|3541| 			this.Stop(false);
|3542|3542| 		}
|3543|3543| 
|    | [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
|3593|3593| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3594|3594| 			continue;
|3595|3595| 		if (i == 0)
|3596|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3596|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3597|3597| 		else
|3598|3598| 			this.orderQueue.splice(i, 1);
|3599|3599| 		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
|3593|3593| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3594|3594| 			continue;
|3595|3595| 		if (i == 0)
|3596|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3596|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3597|3597| 		else
|3598|3598| 			this.orderQueue.splice(i, 1);
|3599|3599| 		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
|3680|3680| };
|3681|3681| 
|3682|3682| 
|3683|    |-//// FSM linkage functions ////
|    |3683|+// // FSM linkage functions ////
|3684|3684| 
|3685|3685| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3686|3686| 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
|3851|3851| 				continue;
|3852|3852| 			if (this.orderQueue[i].type == type)
|3853|3853| 				continue;
|3854|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3854|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3855|3855| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3856|3856| 			return;
|3857|3857| 		}
|    | [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
|3851|3851| 				continue;
|3852|3852| 			if (this.orderQueue[i].type == type)
|3853|3853| 				continue;
|3854|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3854|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3855|3855| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3856|3856| 			return;
|3857|3857| 		}
|    | [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
|4093|4093| 	if (data.timerRepeat === undefined)
|4094|4094| 		this.timer = undefined;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4096|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4097|4097| };
|4098|4098| 
|4099|4099| /**
|    | [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
|4093|4093| 	if (data.timerRepeat === undefined)
|4094|4094| 		this.timer = undefined;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4096|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4097|4097| };
|4098|4098| 
|4099|4099| /**
|    | [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
|4138|4138| 	// TODO: This is a bit inefficient since every unit listens to every
|4139|4139| 	// construction message - ideally we could scope it to only the one we're building
|4140|4140| 
|4141|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4141|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4142|4142| };
|4143|4143| 
|4144|4144| 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
|4138|4138| 	// TODO: This is a bit inefficient since every unit listens to every
|4139|4139| 	// construction message - ideally we could scope it to only the one we're building
|4140|4140| 
|4141|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4141|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4142|4142| };
|4143|4143| 
|4144|4144| 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
|4169|4169| 	if (msg.fromStatusEffect)
|4170|4170| 		return;
|4171|4171| 
|4172|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4172|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4173|4173| };
|4174|4174| 
|4175|4175| 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
|4169|4169| 	if (msg.fromStatusEffect)
|4170|4170| 		return;
|4171|4171| 
|4172|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4172|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4173|4173| };
|4174|4174| 
|4175|4175| 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
|4174|4174| 
|4175|4175| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4176|4176| {
|4177|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4177|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4178|4178| };
|4179|4179| 
|4180|4180| 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
|4174|4174| 
|4175|4175| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4176|4176| {
|4177|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4177|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4178|4178| };
|4179|4179| 
|4180|4180| 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
|4179|4179| 
|4180|4180| UnitAI.prototype.OnHealthChanged = function(msg)
|4181|4181| {
|4182|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4182|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4183|4183| };
|4184|4184| 
|4185|4185| 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
|4179|4179| 
|4180|4180| UnitAI.prototype.OnHealthChanged = function(msg)
|4181|4181| {
|4182|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4182|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4183|4183| };
|4184|4184| 
|4185|4185| 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
|4185|4185| UnitAI.prototype.OnRangeUpdate = function(msg)
|4186|4186| {
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4188|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|4190| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|    | [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
|4185|4185| UnitAI.prototype.OnRangeUpdate = function(msg)
|4186|4186| {
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4188|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|4190| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|    | [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
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|4188| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4190|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|4192|4192| 
|4193|4193| 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
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|4188| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4190|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4191|4191| };
|4192|4192| 
|4193|4193| 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
|4192|4192| 
|4193|4193| UnitAI.prototype.OnPackFinished = function(msg)
|4194|4194| {
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4195|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4196|4196| };
|4197|4197| 
|4198|4198| //// 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
|4192|4192| 
|4193|4193| UnitAI.prototype.OnPackFinished = function(msg)
|4194|4194| {
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4195|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4196|4196| };
|4197|4197| 
|4198|4198| //// 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
|4195|4195| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4196|4196| };
|4197|4197| 
|4198|    |-//// Helper functions to be called by the FSM ////
|    |4198|+// // Helper functions to be called by the FSM ////
|4199|4199| 
|4200|4200| UnitAI.prototype.GetWalkSpeed = function()
|4201|4201| {
|    | [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
|4907|4907| UnitAI.prototype.AttackEntityInZone = function(ents)
|4908|4908| {
|4909|4909| 	var target = ents.find(target =>
|4910|    |-		this.CanAttack(target)
|4911|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4910|+		this.CanAttack(target) &&
|    |4911|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4912|4912| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4913|4913| 	);
|4914|4914| 	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
|4908|4908| {
|4909|4909| 	var target = ents.find(target =>
|4910|4910| 		this.CanAttack(target)
|4911|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4912|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4911|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4912|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4913|4913| 	);
|4914|4914| 	if (!target)
|4915|4915| 		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
|4974|4974| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4975|4975| 	if (this.isGuardOf)
|4976|4976| 	{
|4977|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4977|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4978|4978| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4979|4979| 		if (cmpUnitAI && cmpAttack &&
|4980|4980| 		    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
|4978|4978| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4979|4979| 		if (cmpUnitAI && cmpAttack &&
|4980|4980| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4981|    |-				return false;
|    |4981|+			return false;
|4982|4982| 	}
|4983|4983| 
|4984|4984| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [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
|5016|5016| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5017|5017| 	if (this.isGuardOf)
|5018|5018| 	{
|5019|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5019|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5020|5020| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5021|5021| 		if (cmpUnitAI && cmpAttack &&
|5022|5022| 		    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
|5029|5029| 	return false;
|5030|5030| };
|5031|5031| 
|5032|    |-//// External interface functions ////
|    |5032|+// // External interface functions ////
|5033|5033| 
|5034|5034| UnitAI.prototype.SetFormationController = function(ent)
|5035|5035| {
|    | [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
|5185|5185| 	{
|5186|5186| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5187|5187| 			return;
|5188|    |-		else
|5189|    |-			this.RemoveGuard();
|    |5188|+		this.RemoveGuard();
|5190|5189| 	}
|5191|5190| 
|5192|5191| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5516|5516| 
|5517|5517| 	if (this.IsFormationController())
|5518|5518| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5519|    |-}
|    |5519|+};
|5520|5520| /**
|5521|5521|  * Adds trade order to the queue. Either walk to the first market, or
|5522|5522|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [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
|5537|5537| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5538|5538| 	{
|5539|5539| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5540|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5540|+		if (cmpTrader.HasBothMarkets() &&
|5541|5541| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5542|5542| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5543|5543| 		{
|    | [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
|5818|5818| 				{
|5819|5819| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5820|5820| 					var targetClasses = this.order.data.targetClasses;
|5821|    |-					if (targetClasses.attack && cmpIdentity
|5822|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5821|+					if (targetClasses.attack && cmpIdentity &&
|    |5822|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5823|5823| 						continue;
|5824|5824| 					if (targetClasses.avoid && cmpIdentity
|5825|5825| 						&& 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
|5821|5821| 					if (targetClasses.attack && cmpIdentity
|5822|5822| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5823|5823| 						continue;
|5824|    |-					if (targetClasses.avoid && cmpIdentity
|5825|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5824|+					if (targetClasses.avoid && cmpIdentity &&
|    |5825|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5826|5826| 						continue;
|5827|5827| 					// Only used by the AIs to prevent some choices of targets
|5828|5828| 					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
|5844|5844| 		{
|5845|5845| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5846|5846| 			var targetClasses = this.order.data.targetClasses;
|5847|    |-			if (cmpIdentity && targetClasses.attack
|5848|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5847|+			if (cmpIdentity && targetClasses.attack &&
|    |5848|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5849|5849| 				continue;
|5850|5850| 			if (cmpIdentity && targetClasses.avoid
|5851|5851| 				&& 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
|5847|5847| 			if (cmpIdentity && targetClasses.attack
|5848|5848| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5849|5849| 				continue;
|5850|    |-			if (cmpIdentity && targetClasses.avoid
|5851|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5850|+			if (cmpIdentity && targetClasses.avoid &&
|    |5851|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5852|5852| 				continue;
|5853|5853| 			// Only used by the AIs to prevent some choices of targets
|5854|5854| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5987|5987| 	{
|5988|5988| 		let targetSpeed = cmpUnitMotionTarget.GetCurrentSpeed();
|5989|5989| 		if (!targetSpeed)
|5990|    |-			return
|    |5990|+			return;
|5991|5991| 
|5992|5992| 		let walkSpeed = this.GetWalkSpeed();
|5993|5993| 		if (targetSpeed < walkSpeed)
|    | [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
|6014|6014| 
|6015|6015| UnitAI.prototype.SetHeldPosition = function(x, z)
|6016|6016| {
|6017|    |-	this.heldPosition = {"x": x, "z": z};
|    |6017|+	this.heldPosition = { "x": x, "z": z};
|6018|6018| };
|6019|6019| 
|6020|6020| 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
|6014|6014| 
|6015|6015| UnitAI.prototype.SetHeldPosition = function(x, z)
|6016|6016| {
|6017|    |-	this.heldPosition = {"x": x, "z": z};
|    |6017|+	this.heldPosition = {"x": x, "z": z };
|6018|6018| };
|6019|6019| 
|6020|6020| 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
|6041|6041| 	return false;
|6042|6042| };
|6043|6043| 
|6044|    |-//// Helper functions ////
|    |6044|+// // Helper functions ////
|6045|6045| 
|6046|6046| /**
|6047|6047|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6060|6060| 		return undefined;
|6061|6061| 
|6062|6062| 	return component.GetRange(type);
|6063|    |-}
|    |6063|+};
|6064|6064| 
|6065|6065| UnitAI.prototype.CanAttack = function(target)
|6066|6066| {
|    | [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
|6228|6228| 	return cmpPack && cmpPack.IsPacking();
|6229|6229| };
|6230|6230| 
|6231|    |-//// Formation specific functions ////
|    |6231|+// // Formation specific functions ////
|6232|6232| 
|6233|6233| UnitAI.prototype.IsAttackingAsFormation = function()
|6234|6234| {
|    | [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
|6233|6233| UnitAI.prototype.IsAttackingAsFormation = function()
|6234|6234| {
|6235|6235| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6236|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6237|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6236|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6237|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6238|6238| };
|6239|6239| 
|6240|6240| //// 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
|6237|6237| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6238|6238| };
|6239|6239| 
|6240|    |-//// Animal specific functions ////
|    |6240|+// // Animal specific functions ////
|6241|6241| 
|6242|6242| UnitAI.prototype.MoveRandomly = function(distance)
|6243|6243| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3998| »   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
|4894| »   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
|4909| »   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
|4957| »   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
|4980| »   »   ····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
|2038| »   »   »   »   »   »   &&·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
|3136| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4911| »   »   &&·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
|4912| »   »   &&·(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
|5519| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5848| »   »   »   »   &&·!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
|5851| »   »   »   »   &&·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
|5990| »   »   »   return
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|6063| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

bb added a subscriber: bb.May 15 2020, 10:14 PM
bb added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
5993–5997 ↗(On Diff #11849)

this.SetSpeedMultiplier(Math.min(mayRun ? this.GetRunMultiplier() : 1, targetSpeed / walkSpeed));

Concerning what happens if walkSpeed==0in this code

Freagarach added inline comments.May 20 2020, 4:42 PM
binaries/data/mods/public/simulation/components/UnitAI.js
5993–5997 ↗(On Diff #11849)

That would mean calling the function even though we don't need to (e.g. a target being faster but us not allowed to run).

Freagarach updated this revision to Diff 11932.May 20 2020, 4:49 PM
Freagarach marked an inline comment as done.
  • Oneline new speed.
  • Protect against /0.
bb added inline comments.May 20 2020, 4:51 PM
binaries/data/mods/public/simulation/components/UnitAI.js
5993–5997 ↗(On Diff #11849)

But in that case we should call the function right? since we need to set it to 1 (never trust the current value, we could have been chasing some other unit)

There is an extra function call namely the this.GetRunMultiplier in case we don't need to run (target is slow), but the benefit is that we don't need to store the walkspeed (can be inlined) and there is a check less.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [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
| 788| 788| 					this.FinishOrder();
| 789| 789| 					return;
| 790| 790| 				}
| 791|    |-				else
| 792|    |-				{
|    | 791|+				
| 793| 792| 					this.SetNextState("GARRISON.APPROACHING");
| 794| 793| 					return;
| 795|    |-				}
|    | 794|+				
| 796| 795| 			}
| 797| 796| 
| 798| 797| 			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
|1060|1060| 			},
|1061|1061| 		},
|1062|1062| 
|1063|    |-		"GARRISON":{
|    |1063|+		"GARRISON": {
|1064|1064| 			"APPROACHING": {
|1065|1065| 				"enter": function() {
|1066|1066| 					if (!this.MoveToGarrisonRange(this.order.data.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
|2034|2034| 
|2035|2035| 				"Attacked": function(msg) {
|2036|2036| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2037|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2038|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2037|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2038|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2039|2039| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2040|2040| 				},
|2041|2041| 			},
|    | [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
|2193|2193| 					"MovementUpdate": function(msg) {
|2194|2194| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2195|2195| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2196|    |-						if (msg.likelyFailure || 
|    |2196|+						if (msg.likelyFailure ||
|2197|2197| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2198|2198| 							!msg.obstructed && this.CheckRange(this.order.data))
|2199|2199| 							this.FinishOrder();
|    | [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
|2835|2835| 					{
|2836|2836| 						// The building was already finished/fully repaired before we arrived;
|2837|2837| 						// let the ConstructionFinished handler handle this.
|2838|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2838|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2839|2839| 						return true;
|2840|2840| 					}
|2841|2841| 
|    | [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
|2835|2835| 					{
|2836|2836| 						// The building was already finished/fully repaired before we arrived;
|2837|2837| 						// let the ConstructionFinished handler handle this.
|2838|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2838|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2839|2839| 						return true;
|2840|2840| 					}
|2841|2841| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3133|3133| 				this.StopTimer();
|3134|3134| 				this.ResetAnimation();
|3135|3135| 				if (this.formationAnimationVariant)
|3136|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3136|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3137|3137| 				else
|3138|3138| 					this.SetDefaultAnimationVariant();
|3139|3139| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [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
|3359|3359| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3360|3360| 
|3361|3361| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3362|    |-							// only used for domestic animals
|    |3362|+		// only used for domestic animals
|3363|3363| 
|3364|3364| 		// Reuse the same garrison behaviour for animals.
|3365|3365| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [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
|3421|3421| 
|3422|3422| UnitAI.prototype.IsAnimal = function()
|3423|3423| {
|3424|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3424|+	return (!!this.template.NaturalBehaviour);
|3425|3425| };
|3426|3426| 
|3427|3427| UnitAI.prototype.IsDangerousAnimal = function()
|    | [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
|3537|3537| 		{
|3538|3538| 			let index = this.GetCurrentState().indexOf(".");
|3539|3539| 			if (index != -1)
|3540|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3540|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3541|3541| 			this.Stop(false);
|3542|3542| 		}
|3543|3543| 
|    | [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
|3593|3593| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3594|3594| 			continue;
|3595|3595| 		if (i == 0)
|3596|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3596|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3597|3597| 		else
|3598|3598| 			this.orderQueue.splice(i, 1);
|3599|3599| 		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
|3593|3593| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3594|3594| 			continue;
|3595|3595| 		if (i == 0)
|3596|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3596|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3597|3597| 		else
|3598|3598| 			this.orderQueue.splice(i, 1);
|3599|3599| 		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
|3680|3680| };
|3681|3681| 
|3682|3682| 
|3683|    |-//// FSM linkage functions ////
|    |3683|+// // FSM linkage functions ////
|3684|3684| 
|3685|3685| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3686|3686| 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
|3851|3851| 				continue;
|3852|3852| 			if (this.orderQueue[i].type == type)
|3853|3853| 				continue;
|3854|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3854|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3855|3855| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3856|3856| 			return;
|3857|3857| 		}
|    | [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
|3851|3851| 				continue;
|3852|3852| 			if (this.orderQueue[i].type == type)
|3853|3853| 				continue;
|3854|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3854|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3855|3855| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3856|3856| 			return;
|3857|3857| 		}
|    | [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
|4093|4093| 	if (data.timerRepeat === undefined)
|4094|4094| 		this.timer = undefined;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4096|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4097|4097| };
|4098|4098| 
|4099|4099| /**
|    | [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
|4093|4093| 	if (data.timerRepeat === undefined)
|4094|4094| 		this.timer = undefined;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4096|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4097|4097| };
|4098|4098| 
|4099|4099| /**
|    | [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
|4138|4138| 	// TODO: This is a bit inefficient since every unit listens to every
|4139|4139| 	// construction message - ideally we could scope it to only the one we're building
|4140|4140| 
|4141|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4141|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4142|4142| };
|4143|4143| 
|4144|4144| 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
|4138|4138| 	// TODO: This is a bit inefficient since every unit listens to every
|4139|4139| 	// construction message - ideally we could scope it to only the one we're building
|4140|4140| 
|4141|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4141|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4142|4142| };
|4143|4143| 
|4144|4144| 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
|4169|4169| 	if (msg.fromStatusEffect)
|4170|4170| 		return;
|4171|4171| 
|4172|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4172|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4173|4173| };
|4174|4174| 
|4175|4175| 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
|4169|4169| 	if (msg.fromStatusEffect)
|4170|4170| 		return;
|4171|4171| 
|4172|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4172|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4173|4173| };
|4174|4174| 
|4175|4175| 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
|4174|4174| 
|4175|4175| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4176|4176| {
|4177|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4177|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4178|4178| };
|4179|4179| 
|4180|4180| 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
|4174|4174| 
|4175|4175| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4176|4176| {
|4177|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4177|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4178|4178| };
|4179|4179| 
|4180|4180| 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
|4179|4179| 
|4180|4180| UnitAI.prototype.OnHealthChanged = function(msg)
|4181|4181| {
|4182|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4182|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4183|4183| };
|4184|4184| 
|4185|4185| 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
|4179|4179| 
|4180|4180| UnitAI.prototype.OnHealthChanged = function(msg)
|4181|4181| {
|4182|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4182|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4183|4183| };
|4184|4184| 
|4185|4185| 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
|4185|4185| UnitAI.prototype.OnRangeUpdate = function(msg)
|4186|4186| {
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4188|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|4190| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|    | [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
|4185|4185| UnitAI.prototype.OnRangeUpdate = function(msg)
|4186|4186| {
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4188|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|4190| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|    | [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
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|4188| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4190|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|4192|4192| 
|4193|4193| 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
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|4188| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4190|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4191|4191| };
|4192|4192| 
|4193|4193| 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
|4192|4192| 
|4193|4193| UnitAI.prototype.OnPackFinished = function(msg)
|4194|4194| {
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4195|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4196|4196| };
|4197|4197| 
|4198|4198| //// 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
|4192|4192| 
|4193|4193| UnitAI.prototype.OnPackFinished = function(msg)
|4194|4194| {
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4195|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4196|4196| };
|4197|4197| 
|4198|4198| //// 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
|4195|4195| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4196|4196| };
|4197|4197| 
|4198|    |-//// Helper functions to be called by the FSM ////
|    |4198|+// // Helper functions to be called by the FSM ////
|4199|4199| 
|4200|4200| UnitAI.prototype.GetWalkSpeed = function()
|4201|4201| {
|    | [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
|4907|4907| UnitAI.prototype.AttackEntityInZone = function(ents)
|4908|4908| {
|4909|4909| 	var target = ents.find(target =>
|4910|    |-		this.CanAttack(target)
|4911|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4910|+		this.CanAttack(target) &&
|    |4911|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4912|4912| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4913|4913| 	);
|4914|4914| 	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
|4908|4908| {
|4909|4909| 	var target = ents.find(target =>
|4910|4910| 		this.CanAttack(target)
|4911|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4912|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4911|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4912|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4913|4913| 	);
|4914|4914| 	if (!target)
|4915|4915| 		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
|4974|4974| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4975|4975| 	if (this.isGuardOf)
|4976|4976| 	{
|4977|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4977|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4978|4978| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4979|4979| 		if (cmpUnitAI && cmpAttack &&
|4980|4980| 		    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
|4978|4978| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4979|4979| 		if (cmpUnitAI && cmpAttack &&
|4980|4980| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4981|    |-				return false;
|    |4981|+			return false;
|4982|4982| 	}
|4983|4983| 
|4984|4984| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [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
|5016|5016| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5017|5017| 	if (this.isGuardOf)
|5018|5018| 	{
|5019|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5019|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5020|5020| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5021|5021| 		if (cmpUnitAI && cmpAttack &&
|5022|5022| 		    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
|5029|5029| 	return false;
|5030|5030| };
|5031|5031| 
|5032|    |-//// External interface functions ////
|    |5032|+// // External interface functions ////
|5033|5033| 
|5034|5034| UnitAI.prototype.SetFormationController = function(ent)
|5035|5035| {
|    | [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
|5185|5185| 	{
|5186|5186| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5187|5187| 			return;
|5188|    |-		else
|5189|    |-			this.RemoveGuard();
|    |5188|+		this.RemoveGuard();
|5190|5189| 	}
|5191|5190| 
|5192|5191| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5516|5516| 
|5517|5517| 	if (this.IsFormationController())
|5518|5518| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5519|    |-}
|    |5519|+};
|5520|5520| /**
|5521|5521|  * Adds trade order to the queue. Either walk to the first market, or
|5522|5522|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [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
|5537|5537| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5538|5538| 	{
|5539|5539| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5540|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5540|+		if (cmpTrader.HasBothMarkets() &&
|5541|5541| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5542|5542| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5543|5543| 		{
|    | [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
|5818|5818| 				{
|5819|5819| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5820|5820| 					var targetClasses = this.order.data.targetClasses;
|5821|    |-					if (targetClasses.attack && cmpIdentity
|5822|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5821|+					if (targetClasses.attack && cmpIdentity &&
|    |5822|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5823|5823| 						continue;
|5824|5824| 					if (targetClasses.avoid && cmpIdentity
|5825|5825| 						&& 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
|5821|5821| 					if (targetClasses.attack && cmpIdentity
|5822|5822| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5823|5823| 						continue;
|5824|    |-					if (targetClasses.avoid && cmpIdentity
|5825|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5824|+					if (targetClasses.avoid && cmpIdentity &&
|    |5825|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5826|5826| 						continue;
|5827|5827| 					// Only used by the AIs to prevent some choices of targets
|5828|5828| 					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
|5844|5844| 		{
|5845|5845| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5846|5846| 			var targetClasses = this.order.data.targetClasses;
|5847|    |-			if (cmpIdentity && targetClasses.attack
|5848|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5847|+			if (cmpIdentity && targetClasses.attack &&
|    |5848|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5849|5849| 				continue;
|5850|5850| 			if (cmpIdentity && targetClasses.avoid
|5851|5851| 				&& 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
|5847|5847| 			if (cmpIdentity && targetClasses.attack
|5848|5848| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5849|5849| 				continue;
|5850|    |-			if (cmpIdentity && targetClasses.avoid
|5851|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5850|+			if (cmpIdentity && targetClasses.avoid &&
|    |5851|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5852|5852| 				continue;
|5853|5853| 			// Only used by the AIs to prevent some choices of targets
|5854|5854| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5987|5987| 	{
|5988|5988| 		let targetSpeed = cmpUnitMotionTarget.GetCurrentSpeed();
|5989|5989| 		if (!targetSpeed)
|5990|    |-			return
|    |5990|+			return;
|5991|5991| 
|5992|5992| 		let walkSpeed = this.GetWalkSpeed();
|5993|5993| 		if (!walkSpeed)
|    | [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
|6015|6015| 
|6016|6016| UnitAI.prototype.SetHeldPosition = function(x, z)
|6017|6017| {
|6018|    |-	this.heldPosition = {"x": x, "z": z};
|    |6018|+	this.heldPosition = { "x": x, "z": z};
|6019|6019| };
|6020|6020| 
|6021|6021| 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
|6015|6015| 
|6016|6016| UnitAI.prototype.SetHeldPosition = function(x, z)
|6017|6017| {
|6018|    |-	this.heldPosition = {"x": x, "z": z};
|    |6018|+	this.heldPosition = {"x": x, "z": z };
|6019|6019| };
|6020|6020| 
|6021|6021| 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
|6042|6042| 	return false;
|6043|6043| };
|6044|6044| 
|6045|    |-//// Helper functions ////
|    |6045|+// // Helper functions ////
|6046|6046| 
|6047|6047| /**
|6048|6048|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6061|6061| 		return undefined;
|6062|6062| 
|6063|6063| 	return component.GetRange(type);
|6064|    |-}
|    |6064|+};
|6065|6065| 
|6066|6066| UnitAI.prototype.CanAttack = function(target)
|6067|6067| {
|    | [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
|6229|6229| 	return cmpPack && cmpPack.IsPacking();
|6230|6230| };
|6231|6231| 
|6232|    |-//// Formation specific functions ////
|    |6232|+// // Formation specific functions ////
|6233|6233| 
|6234|6234| UnitAI.prototype.IsAttackingAsFormation = function()
|6235|6235| {
|    | [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
|6234|6234| UnitAI.prototype.IsAttackingAsFormation = function()
|6235|6235| {
|6236|6236| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6237|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6238|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6237|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6238|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6239|6239| };
|6240|6240| 
|6241|6241| //// 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
|6238|6238| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6239|6239| };
|6240|6240| 
|6241|    |-//// Animal specific functions ////
|    |6241|+// // Animal specific functions ////
|6242|6242| 
|6243|6243| UnitAI.prototype.MoveRandomly = function(distance)
|6244|6244| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3998| »   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
|4894| »   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
|4909| »   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
|4957| »   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
|4980| »   »   ····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
|2038| »   »   »   »   »   »   &&·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
|3136| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4911| »   »   &&·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
|4912| »   »   &&·(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
|5519| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5848| »   »   »   »   &&·!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
|5851| »   »   »   »   &&·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
|5990| »   »   »   return
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|6064| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

Freagarach updated this revision to Diff 11933.May 20 2020, 5:02 PM
Freagarach marked an inline comment as done.
  • Don't check for 0 speed (`Math.min(1/0, 1) == 1).
  • Set SpeedMultiplier also when it would be set to 1 (don't assume people reset it).

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [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
| 788| 788| 					this.FinishOrder();
| 789| 789| 					return;
| 790| 790| 				}
| 791|    |-				else
| 792|    |-				{
|    | 791|+				
| 793| 792| 					this.SetNextState("GARRISON.APPROACHING");
| 794| 793| 					return;
| 795|    |-				}
|    | 794|+				
| 796| 795| 			}
| 797| 796| 
| 798| 797| 			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
|1060|1060| 			},
|1061|1061| 		},
|1062|1062| 
|1063|    |-		"GARRISON":{
|    |1063|+		"GARRISON": {
|1064|1064| 			"APPROACHING": {
|1065|1065| 				"enter": function() {
|1066|1066| 					if (!this.MoveToGarrisonRange(this.order.data.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
|2034|2034| 
|2035|2035| 				"Attacked": function(msg) {
|2036|2036| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2037|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2038|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2037|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2038|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2039|2039| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2040|2040| 				},
|2041|2041| 			},
|    | [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
|2193|2193| 					"MovementUpdate": function(msg) {
|2194|2194| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2195|2195| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2196|    |-						if (msg.likelyFailure || 
|    |2196|+						if (msg.likelyFailure ||
|2197|2197| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2198|2198| 							!msg.obstructed && this.CheckRange(this.order.data))
|2199|2199| 							this.FinishOrder();
|    | [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
|2835|2835| 					{
|2836|2836| 						// The building was already finished/fully repaired before we arrived;
|2837|2837| 						// let the ConstructionFinished handler handle this.
|2838|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2838|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2839|2839| 						return true;
|2840|2840| 					}
|2841|2841| 
|    | [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
|2835|2835| 					{
|2836|2836| 						// The building was already finished/fully repaired before we arrived;
|2837|2837| 						// let the ConstructionFinished handler handle this.
|2838|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2838|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2839|2839| 						return true;
|2840|2840| 					}
|2841|2841| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3133|3133| 				this.StopTimer();
|3134|3134| 				this.ResetAnimation();
|3135|3135| 				if (this.formationAnimationVariant)
|3136|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3136|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3137|3137| 				else
|3138|3138| 					this.SetDefaultAnimationVariant();
|3139|3139| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [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
|3359|3359| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3360|3360| 
|3361|3361| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3362|    |-							// only used for domestic animals
|    |3362|+		// only used for domestic animals
|3363|3363| 
|3364|3364| 		// Reuse the same garrison behaviour for animals.
|3365|3365| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [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
|3421|3421| 
|3422|3422| UnitAI.prototype.IsAnimal = function()
|3423|3423| {
|3424|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3424|+	return (!!this.template.NaturalBehaviour);
|3425|3425| };
|3426|3426| 
|3427|3427| UnitAI.prototype.IsDangerousAnimal = function()
|    | [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
|3537|3537| 		{
|3538|3538| 			let index = this.GetCurrentState().indexOf(".");
|3539|3539| 			if (index != -1)
|3540|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3540|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3541|3541| 			this.Stop(false);
|3542|3542| 		}
|3543|3543| 
|    | [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
|3593|3593| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3594|3594| 			continue;
|3595|3595| 		if (i == 0)
|3596|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3596|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3597|3597| 		else
|3598|3598| 			this.orderQueue.splice(i, 1);
|3599|3599| 		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
|3593|3593| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3594|3594| 			continue;
|3595|3595| 		if (i == 0)
|3596|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3596|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3597|3597| 		else
|3598|3598| 			this.orderQueue.splice(i, 1);
|3599|3599| 		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
|3680|3680| };
|3681|3681| 
|3682|3682| 
|3683|    |-//// FSM linkage functions ////
|    |3683|+// // FSM linkage functions ////
|3684|3684| 
|3685|3685| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3686|3686| 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
|3851|3851| 				continue;
|3852|3852| 			if (this.orderQueue[i].type == type)
|3853|3853| 				continue;
|3854|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3854|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3855|3855| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3856|3856| 			return;
|3857|3857| 		}
|    | [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
|3851|3851| 				continue;
|3852|3852| 			if (this.orderQueue[i].type == type)
|3853|3853| 				continue;
|3854|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3854|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3855|3855| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3856|3856| 			return;
|3857|3857| 		}
|    | [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
|4093|4093| 	if (data.timerRepeat === undefined)
|4094|4094| 		this.timer = undefined;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4096|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4097|4097| };
|4098|4098| 
|4099|4099| /**
|    | [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
|4093|4093| 	if (data.timerRepeat === undefined)
|4094|4094| 		this.timer = undefined;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4096|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4097|4097| };
|4098|4098| 
|4099|4099| /**
|    | [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
|4138|4138| 	// TODO: This is a bit inefficient since every unit listens to every
|4139|4139| 	// construction message - ideally we could scope it to only the one we're building
|4140|4140| 
|4141|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4141|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4142|4142| };
|4143|4143| 
|4144|4144| 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
|4138|4138| 	// TODO: This is a bit inefficient since every unit listens to every
|4139|4139| 	// construction message - ideally we could scope it to only the one we're building
|4140|4140| 
|4141|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4141|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4142|4142| };
|4143|4143| 
|4144|4144| 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
|4169|4169| 	if (msg.fromStatusEffect)
|4170|4170| 		return;
|4171|4171| 
|4172|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4172|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4173|4173| };
|4174|4174| 
|4175|4175| 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
|4169|4169| 	if (msg.fromStatusEffect)
|4170|4170| 		return;
|4171|4171| 
|4172|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4172|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4173|4173| };
|4174|4174| 
|4175|4175| 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
|4174|4174| 
|4175|4175| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4176|4176| {
|4177|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4177|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4178|4178| };
|4179|4179| 
|4180|4180| 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
|4174|4174| 
|4175|4175| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4176|4176| {
|4177|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4177|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4178|4178| };
|4179|4179| 
|4180|4180| 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
|4179|4179| 
|4180|4180| UnitAI.prototype.OnHealthChanged = function(msg)
|4181|4181| {
|4182|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4182|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4183|4183| };
|4184|4184| 
|4185|4185| 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
|4179|4179| 
|4180|4180| UnitAI.prototype.OnHealthChanged = function(msg)
|4181|4181| {
|4182|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4182|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4183|4183| };
|4184|4184| 
|4185|4185| 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
|4185|4185| UnitAI.prototype.OnRangeUpdate = function(msg)
|4186|4186| {
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4188|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|4190| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|    | [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
|4185|4185| UnitAI.prototype.OnRangeUpdate = function(msg)
|4186|4186| {
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4188|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|4190| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|    | [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
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|4188| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4190|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4191|4191| };
|4192|4192| 
|4193|4193| 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
|4187|4187| 	if (msg.tag == this.losRangeQuery)
|4188|4188| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4189|4189| 	else if (msg.tag == this.losHealRangeQuery)
|4190|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4190|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4191|4191| };
|4192|4192| 
|4193|4193| 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
|4192|4192| 
|4193|4193| UnitAI.prototype.OnPackFinished = function(msg)
|4194|4194| {
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4195|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4196|4196| };
|4197|4197| 
|4198|4198| //// 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
|4192|4192| 
|4193|4193| UnitAI.prototype.OnPackFinished = function(msg)
|4194|4194| {
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4195|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4196|4196| };
|4197|4197| 
|4198|4198| //// 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
|4195|4195| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4196|4196| };
|4197|4197| 
|4198|    |-//// Helper functions to be called by the FSM ////
|    |4198|+// // Helper functions to be called by the FSM ////
|4199|4199| 
|4200|4200| UnitAI.prototype.GetWalkSpeed = function()
|4201|4201| {
|    | [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
|4907|4907| UnitAI.prototype.AttackEntityInZone = function(ents)
|4908|4908| {
|4909|4909| 	var target = ents.find(target =>
|4910|    |-		this.CanAttack(target)
|4911|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4910|+		this.CanAttack(target) &&
|    |4911|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4912|4912| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4913|4913| 	);
|4914|4914| 	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
|4908|4908| {
|4909|4909| 	var target = ents.find(target =>
|4910|4910| 		this.CanAttack(target)
|4911|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4912|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4911|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4912|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4913|4913| 	);
|4914|4914| 	if (!target)
|4915|4915| 		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
|4974|4974| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4975|4975| 	if (this.isGuardOf)
|4976|4976| 	{
|4977|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4977|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4978|4978| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4979|4979| 		if (cmpUnitAI && cmpAttack &&
|4980|4980| 		    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
|4978|4978| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4979|4979| 		if (cmpUnitAI && cmpAttack &&
|4980|4980| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4981|    |-				return false;
|    |4981|+			return false;
|4982|4982| 	}
|4983|4983| 
|4984|4984| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [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
|5016|5016| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5017|5017| 	if (this.isGuardOf)
|5018|5018| 	{
|5019|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5019|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5020|5020| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5021|5021| 		if (cmpUnitAI && cmpAttack &&
|5022|5022| 		    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
|5029|5029| 	return false;
|5030|5030| };
|5031|5031| 
|5032|    |-//// External interface functions ////
|    |5032|+// // External interface functions ////
|5033|5033| 
|5034|5034| UnitAI.prototype.SetFormationController = function(ent)
|5035|5035| {
|    | [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
|5185|5185| 	{
|5186|5186| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5187|5187| 			return;
|5188|    |-		else
|5189|    |-			this.RemoveGuard();
|    |5188|+		this.RemoveGuard();
|5190|5189| 	}
|5191|5190| 
|5192|5191| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5516|5516| 
|5517|5517| 	if (this.IsFormationController())
|5518|5518| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5519|    |-}
|    |5519|+};
|5520|5520| /**
|5521|5521|  * Adds trade order to the queue. Either walk to the first market, or
|5522|5522|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [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
|5537|5537| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5538|5538| 	{
|5539|5539| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5540|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5540|+		if (cmpTrader.HasBothMarkets() &&
|5541|5541| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5542|5542| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5543|5543| 		{
|    | [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
|5818|5818| 				{
|5819|5819| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5820|5820| 					var targetClasses = this.order.data.targetClasses;
|5821|    |-					if (targetClasses.attack && cmpIdentity
|5822|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5821|+					if (targetClasses.attack && cmpIdentity &&
|    |5822|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5823|5823| 						continue;
|5824|5824| 					if (targetClasses.avoid && cmpIdentity
|5825|5825| 						&& 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
|5821|5821| 					if (targetClasses.attack && cmpIdentity
|5822|5822| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5823|5823| 						continue;
|5824|    |-					if (targetClasses.avoid && cmpIdentity
|5825|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5824|+					if (targetClasses.avoid && cmpIdentity &&
|    |5825|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5826|5826| 						continue;
|5827|5827| 					// Only used by the AIs to prevent some choices of targets
|5828|5828| 					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
|5844|5844| 		{
|5845|5845| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5846|5846| 			var targetClasses = this.order.data.targetClasses;
|5847|    |-			if (cmpIdentity && targetClasses.attack
|5848|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5847|+			if (cmpIdentity && targetClasses.attack &&
|    |5848|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5849|5849| 				continue;
|5850|5850| 			if (cmpIdentity && targetClasses.avoid
|5851|5851| 				&& 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
|5847|5847| 			if (cmpIdentity && targetClasses.attack
|5848|5848| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5849|5849| 				continue;
|5850|    |-			if (cmpIdentity && targetClasses.avoid
|5851|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5850|+			if (cmpIdentity && targetClasses.avoid &&
|    |5851|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5852|5852| 				continue;
|5853|5853| 			// Only used by the AIs to prevent some choices of targets
|5854|5854| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5987|5987| 	{
|5988|5988| 		let targetSpeed = cmpUnitMotionTarget.GetCurrentSpeed();
|5989|5989| 		if (!targetSpeed)
|5990|    |-			return
|    |5990|+			return;
|5991|5991| 
|5992|5992| 		this.SetSpeedMultiplier(Math.min(mayRun ? this.GetRunMultiplier() : 1, targetSpeed / this.GetWalkSpeed()));
|5993|5993| 	}
|    | [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
|6009|6009| 
|6010|6010| UnitAI.prototype.SetHeldPosition = function(x, z)
|6011|6011| {
|6012|    |-	this.heldPosition = {"x": x, "z": z};
|    |6012|+	this.heldPosition = { "x": x, "z": z};
|6013|6013| };
|6014|6014| 
|6015|6015| 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
|6009|6009| 
|6010|6010| UnitAI.prototype.SetHeldPosition = function(x, z)
|6011|6011| {
|6012|    |-	this.heldPosition = {"x": x, "z": z};
|    |6012|+	this.heldPosition = {"x": x, "z": z };
|6013|6013| };
|6014|6014| 
|6015|6015| 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
|6036|6036| 	return false;
|6037|6037| };
|6038|6038| 
|6039|    |-//// Helper functions ////
|    |6039|+// // Helper functions ////
|6040|6040| 
|6041|6041| /**
|6042|6042|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6055|6055| 		return undefined;
|6056|6056| 
|6057|6057| 	return component.GetRange(type);
|6058|    |-}
|    |6058|+};
|6059|6059| 
|6060|6060| UnitAI.prototype.CanAttack = function(target)
|6061|6061| {
|    | [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
|6223|6223| 	return cmpPack && cmpPack.IsPacking();
|6224|6224| };
|6225|6225| 
|6226|    |-//// Formation specific functions ////
|    |6226|+// // Formation specific functions ////
|6227|6227| 
|6228|6228| UnitAI.prototype.IsAttackingAsFormation = function()
|6229|6229| {
|    | [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
|6228|6228| UnitAI.prototype.IsAttackingAsFormation = function()
|6229|6229| {
|6230|6230| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6231|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6232|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6231|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6232|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6233|6233| };
|6234|6234| 
|6235|6235| //// 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
|6232|6232| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6233|6233| };
|6234|6234| 
|6235|    |-//// Animal specific functions ////
|    |6235|+// // Animal specific functions ////
|6236|6236| 
|6237|6237| UnitAI.prototype.MoveRandomly = function(distance)
|6238|6238| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3998| »   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
|4894| »   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
|4909| »   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
|4957| »   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
|4980| »   »   ····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
|2038| »   »   »   »   »   »   &&·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
|3136| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4911| »   »   &&·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
|4912| »   »   &&·(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
|5519| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5848| »   »   »   »   &&·!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
|5851| »   »   »   »   &&·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
|5990| »   »   »   return
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|6058| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

bb accepted this revision as: bb.May 20 2020, 9:36 PM
bb removed a reviewer: Restricted Owners Package.

Note that valuemodifications are equally broken.

Rather likely that this function will be used more often in future.

This revision is now accepted and ready to land.May 20 2020, 9:36 PM
bb added inline comments.May 20 2020, 9:37 PM
binaries/data/mods/public/simulation/components/UnitAI.js
5990 ↗(On Diff #11933)

semi

This revision was automatically updated to reflect the committed changes.
bb added inline comments.May 20 2020, 9:47 PM
binaries/data/mods/public/simulation/components/UnitAI.js
5990 ↗(On Diff #11933)

actually this early return makes no sense, should invert the case => stupid me

Thanks for the review and commit @bb :)

binaries/data/mods/public/simulation/components/UnitAI.js
5990 ↗(On Diff #11933)

Could be worse.