Page MenuHomeWildfire Games

Look for foundations near the target
ClosedPublic

Authored by wraitii on Wed, May 20, 6:54 PM.

Details

Summary

When entities are ordered to repair a foundation, and the foundations is repaired while the unit is approaching, the unit will look for a new foundation.

It seems better to look near the target than near the unit.


Open question: should there be a distance cutoff for the "look near me" fallback?

Test Plan

Compare behaviour before and after, with and without:

  • foundations near the target
  • foundations near the unit.

Check that resource gathering still behaves correctly.

Diff Detail

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

Event Timeline

wraitii created this revision.Wed, May 20, 6:54 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
|2042|2042| 
|2043|2043| 				"Attacked": function(msg) {
|2044|2044| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2045|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2046|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2045|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2046|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2047|2047| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2048|2048| 				},
|2049|2049| 			},
|    | [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
|2201|2201| 					"MovementUpdate": function(msg) {
|2202|2202| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2203|2203| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2204|    |-						if (msg.likelyFailure || 
|    |2204|+						if (msg.likelyFailure ||
|2205|2205| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2206|2206| 							!msg.obstructed && this.CheckRange(this.order.data))
|2207|2207| 							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
|2843|2843| 					{
|2844|2844| 						// The building was already finished/fully repaired before we arrived;
|2845|2845| 						// let the ConstructionFinished handler handle this.
|2846|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2846|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2847|2847| 						return true;
|2848|2848| 					}
|2849|2849| 
|    | [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
|2843|2843| 					{
|2844|2844| 						// The building was already finished/fully repaired before we arrived;
|2845|2845| 						// let the ConstructionFinished handler handle this.
|2846|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2846|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2847|2847| 						return true;
|2848|2848| 					}
|2849|2849| 
|    | [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
|3148|3148| 				this.StopTimer();
|3149|3149| 				this.ResetAnimation();
|3150|3150| 				if (this.formationAnimationVariant)
|3151|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3151|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3152|3152| 				else
|3153|3153| 					this.SetDefaultAnimationVariant();
|3154|3154| 				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
|3374|3374| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3375|3375| 
|3376|3376| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3377|    |-							// only used for domestic animals
|    |3377|+		// only used for domestic animals
|3378|3378| 
|3379|3379| 		// Reuse the same garrison behaviour for animals.
|3380|3380| 		"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
|3436|3436| 
|3437|3437| UnitAI.prototype.IsAnimal = function()
|3438|3438| {
|3439|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3439|+	return (!!this.template.NaturalBehaviour);
|3440|3440| };
|3441|3441| 
|3442|3442| 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
|3552|3552| 		{
|3553|3553| 			let index = this.GetCurrentState().indexOf(".");
|3554|3554| 			if (index != -1)
|3555|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3555|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3556|3556| 			this.Stop(false);
|3557|3557| 		}
|3558|3558| 
|    | [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
|3608|3608| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3609|3609| 			continue;
|3610|3610| 		if (i == 0)
|3611|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3611|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3612|3612| 		else
|3613|3613| 			this.orderQueue.splice(i, 1);
|3614|3614| 		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
|3608|3608| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3609|3609| 			continue;
|3610|3610| 		if (i == 0)
|3611|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3611|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3612|3612| 		else
|3613|3613| 			this.orderQueue.splice(i, 1);
|3614|3614| 		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
|3695|3695| };
|3696|3696| 
|3697|3697| 
|3698|    |-//// FSM linkage functions ////
|    |3698|+// // FSM linkage functions ////
|3699|3699| 
|3700|3700| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3701|3701| 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
|3866|3866| 				continue;
|3867|3867| 			if (this.orderQueue[i].type == type)
|3868|3868| 				continue;
|3869|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3869|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3870|3870| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3871|3871| 			return;
|3872|3872| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3866|3866| 				continue;
|3867|3867| 			if (this.orderQueue[i].type == type)
|3868|3868| 				continue;
|3869|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3869|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3870|3870| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3871|3871| 			return;
|3872|3872| 		}
|    | [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
|4108|4108| 	if (data.timerRepeat === undefined)
|4109|4109| 		this.timer = undefined;
|4110|4110| 
|4111|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4111|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4112|4112| };
|4113|4113| 
|4114|4114| /**
|    | [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
|4108|4108| 	if (data.timerRepeat === undefined)
|4109|4109| 		this.timer = undefined;
|4110|4110| 
|4111|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4111|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4112|4112| };
|4113|4113| 
|4114|4114| /**
|    | [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
|4153|4153| 	// TODO: This is a bit inefficient since every unit listens to every
|4154|4154| 	// construction message - ideally we could scope it to only the one we're building
|4155|4155| 
|4156|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4156|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4157|4157| };
|4158|4158| 
|4159|4159| 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
|4153|4153| 	// TODO: This is a bit inefficient since every unit listens to every
|4154|4154| 	// construction message - ideally we could scope it to only the one we're building
|4155|4155| 
|4156|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4156|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4157|4157| };
|4158|4158| 
|4159|4159| 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
|4184|4184| 	if (msg.fromStatusEffect)
|4185|4185| 		return;
|4186|4186| 
|4187|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4187|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4188|4188| };
|4189|4189| 
|4190|4190| 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
|4184|4184| 	if (msg.fromStatusEffect)
|4185|4185| 		return;
|4186|4186| 
|4187|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4187|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4188|4188| };
|4189|4189| 
|4190|4190| 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
|4189|4189| 
|4190|4190| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4191|4191| {
|4192|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4192|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4193|4193| };
|4194|4194| 
|4195|4195| 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
|4189|4189| 
|4190|4190| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4191|4191| {
|4192|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4192|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4193|4193| };
|4194|4194| 
|4195|4195| 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
|4194|4194| 
|4195|4195| UnitAI.prototype.OnHealthChanged = function(msg)
|4196|4196| {
|4197|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4197|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4198|4198| };
|4199|4199| 
|4200|4200| 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
|4194|4194| 
|4195|4195| UnitAI.prototype.OnHealthChanged = function(msg)
|4196|4196| {
|4197|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4197|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4198|4198| };
|4199|4199| 
|4200|4200| 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
|4200|4200| UnitAI.prototype.OnRangeUpdate = function(msg)
|4201|4201| {
|4202|4202| 	if (msg.tag == this.losRangeQuery)
|4203|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4203|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4204|4204| 	else if (msg.tag == this.losHealRangeQuery)
|4205|4205| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4206|4206| };
|    | [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
|4200|4200| UnitAI.prototype.OnRangeUpdate = function(msg)
|4201|4201| {
|4202|4202| 	if (msg.tag == this.losRangeQuery)
|4203|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4203|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4204|4204| 	else if (msg.tag == this.losHealRangeQuery)
|4205|4205| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4206|4206| };
|    | [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
|4202|4202| 	if (msg.tag == this.losRangeQuery)
|4203|4203| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4204|4204| 	else if (msg.tag == this.losHealRangeQuery)
|4205|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4205|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4206|4206| };
|4207|4207| 
|4208|4208| 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
|4202|4202| 	if (msg.tag == this.losRangeQuery)
|4203|4203| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4204|4204| 	else if (msg.tag == this.losHealRangeQuery)
|4205|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4205|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4206|4206| };
|4207|4207| 
|4208|4208| 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
|4207|4207| 
|4208|4208| UnitAI.prototype.OnPackFinished = function(msg)
|4209|4209| {
|4210|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4210|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4211|4211| };
|4212|4212| 
|4213|4213| //// 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
|4207|4207| 
|4208|4208| UnitAI.prototype.OnPackFinished = function(msg)
|4209|4209| {
|4210|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4210|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4211|4211| };
|4212|4212| 
|4213|4213| //// 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
|4210|4210| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4211|4211| };
|4212|4212| 
|4213|    |-//// Helper functions to be called by the FSM ////
|    |4213|+// // Helper functions to be called by the FSM ////
|4214|4214| 
|4215|4215| UnitAI.prototype.GetWalkSpeed = function()
|4216|4216| {
|    | [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
|4927|4927| UnitAI.prototype.AttackEntityInZone = function(ents)
|4928|4928| {
|4929|4929| 	var target = ents.find(target =>
|4930|    |-		this.CanAttack(target)
|4931|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4930|+		this.CanAttack(target) &&
|    |4931|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4932|4932| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4933|4933| 	);
|4934|4934| 	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
|4928|4928| {
|4929|4929| 	var target = ents.find(target =>
|4930|4930| 		this.CanAttack(target)
|4931|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4932|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4931|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4932|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4933|4933| 	);
|4934|4934| 	if (!target)
|4935|4935| 		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
|4994|4994| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4995|4995| 	if (this.isGuardOf)
|4996|4996| 	{
|4997|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4997|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4998|4998| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4999|4999| 		if (cmpUnitAI && cmpAttack &&
|5000|5000| 		    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
|4998|4998| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4999|4999| 		if (cmpUnitAI && cmpAttack &&
|5000|5000| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|5001|    |-				return false;
|    |5001|+			return false;
|5002|5002| 	}
|5003|5003| 
|5004|5004| 	// 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
|5036|5036| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5037|5037| 	if (this.isGuardOf)
|5038|5038| 	{
|5039|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5039|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5040|5040| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5041|5041| 		if (cmpUnitAI && cmpAttack &&
|5042|5042| 		    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
|5049|5049| 	return false;
|5050|5050| };
|5051|5051| 
|5052|    |-//// External interface functions ////
|    |5052|+// // External interface functions ////
|5053|5053| 
|5054|5054| UnitAI.prototype.SetFormationController = function(ent)
|5055|5055| {
|    | [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
|5205|5205| 	{
|5206|5206| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5207|5207| 			return;
|5208|    |-		else
|5209|    |-			this.RemoveGuard();
|    |5208|+		this.RemoveGuard();
|5210|5209| 	}
|5211|5210| 
|5212|5211| 	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
|5536|5536| 
|5537|5537| 	if (this.IsFormationController())
|5538|5538| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5539|    |-}
|    |5539|+};
|5540|5540| /**
|5541|5541|  * Adds trade order to the queue. Either walk to the first market, or
|5542|5542|  * 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
|5557|5557| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5558|5558| 	{
|5559|5559| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5560|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5560|+		if (cmpTrader.HasBothMarkets() &&
|5561|5561| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5562|5562| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5563|5563| 		{
|    | [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
|5838|5838| 				{
|5839|5839| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5840|5840| 					var targetClasses = this.order.data.targetClasses;
|5841|    |-					if (targetClasses.attack && cmpIdentity
|5842|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5841|+					if (targetClasses.attack && cmpIdentity &&
|    |5842|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5843|5843| 						continue;
|5844|5844| 					if (targetClasses.avoid && cmpIdentity
|5845|5845| 						&& 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
|5841|5841| 					if (targetClasses.attack && cmpIdentity
|5842|5842| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5843|5843| 						continue;
|5844|    |-					if (targetClasses.avoid && cmpIdentity
|5845|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5844|+					if (targetClasses.avoid && cmpIdentity &&
|    |5845|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5846|5846| 						continue;
|5847|5847| 					// Only used by the AIs to prevent some choices of targets
|5848|5848| 					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
|5864|5864| 		{
|5865|5865| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5866|5866| 			var targetClasses = this.order.data.targetClasses;
|5867|    |-			if (cmpIdentity && targetClasses.attack
|5868|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5867|+			if (cmpIdentity && targetClasses.attack &&
|    |5868|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5869|5869| 				continue;
|5870|5870| 			if (cmpIdentity && targetClasses.avoid
|5871|5871| 				&& 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
|5867|5867| 			if (cmpIdentity && targetClasses.attack
|5868|5868| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5869|5869| 				continue;
|5870|    |-			if (cmpIdentity && targetClasses.avoid
|5871|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5870|+			if (cmpIdentity && targetClasses.avoid &&
|    |5871|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5872|5872| 				continue;
|5873|5873| 			// Only used by the AIs to prevent some choices of targets
|5874|5874| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6010|6010| 
|6011|6011| UnitAI.prototype.SetHeldPosition = function(x, z)
|6012|6012| {
|6013|    |-	this.heldPosition = {"x": x, "z": z};
|    |6013|+	this.heldPosition = { "x": x, "z": z};
|6014|6014| };
|6015|6015| 
|6016|6016| 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
|6010|6010| 
|6011|6011| UnitAI.prototype.SetHeldPosition = function(x, z)
|6012|6012| {
|6013|    |-	this.heldPosition = {"x": x, "z": z};
|    |6013|+	this.heldPosition = {"x": x, "z": z };
|6014|6014| };
|6015|6015| 
|6016|6016| 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
|6037|6037| 	return false;
|6038|6038| };
|6039|6039| 
|6040|    |-//// Helper functions ////
|    |6040|+// // Helper functions ////
|6041|6041| 
|6042|6042| /**
|6043|6043|  * 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
|6056|6056| 		return undefined;
|6057|6057| 
|6058|6058| 	return component.GetRange(type);
|6059|    |-}
|    |6059|+};
|6060|6060| 
|6061|6061| UnitAI.prototype.CanAttack = function(target)
|6062|6062| {
|    | [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
|6224|6224| 	return cmpPack && cmpPack.IsPacking();
|6225|6225| };
|6226|6226| 
|6227|    |-//// Formation specific functions ////
|    |6227|+// // Formation specific functions ////
|6228|6228| 
|6229|6229| UnitAI.prototype.IsAttackingAsFormation = function()
|6230|6230| {
|    | [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
|6229|6229| UnitAI.prototype.IsAttackingAsFormation = function()
|6230|6230| {
|6231|6231| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6232|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6233|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6232|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6233|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6234|6234| };
|6235|6235| 
|6236|6236| //// 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
|6233|6233| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6234|6234| };
|6235|6235| 
|6236|    |-//// Animal specific functions ////
|    |6236|+// // Animal specific functions ////
|6237|6237| 
|6238|6238| UnitAI.prototype.MoveRandomly = function(distance)
|6239|6239| {

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
|4013| »   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
|4914| »   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
|4929| »   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
|4977| »   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
|5000| »   »   ····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
|2046| »   »   »   »   »   »   &&·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
|3151| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5868| »   »   »   »   &&·!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
|5871| »   »   »   »   &&·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
|6059| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

wraitii added inline comments.Tue, Jun 2, 10:39 AM
binaries/data/mods/public/simulation/components/UnitAI.js
2994 ↗(On Diff #11937)

As noted by stan, this should be moved to the function itself, that's simpler.

wraitii updated this revision to Diff 12103.Tue, Jun 2, 5:38 PM
wraitii edited the test plan for this revision. (Show Details)
wraitii added a subscriber: Stan.

Small refactoring following @Stan 's comment.

This is actually a cleanup of rP22342, which implemented the same functionality for gathering.
I've tested that hunting in FOW still works as well.

Also do some defensive programming by checking if positions are undefined.

wraitii updated this revision to Diff 12104.Tue, Jun 2, 5:41 PM
wraitii retitled this revision from Look for foundations near the target to Look for foundations near the target.

Accidentally introduced a "fat-finger" typo.

Vulcan added a comment.Tue, Jun 2, 5:44 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 (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2496|2496| 
|2497|2497| 								return type.specific == resourceType.specific &&
|2498|2498| 								    (type.specific != "meat" || resourceTemplate == template);
|2499|    |-						});
|    |2499|+							});
|2500|2500| 
|2501|2501| 						if (nearbyResource)
|2502|2502| 						{
|    | [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
|2836|2836| 					{
|2837|2837| 						// The building was already finished/fully repaired before we arrived;
|2838|2838| 						// let the ConstructionFinished handler handle this.
|2839|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2839|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2840|2840| 						return true;
|2841|2841| 					}
|2842|2842| 
|    | [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
|2836|2836| 					{
|2837|2837| 						// The building was already finished/fully repaired before we arrived;
|2838|2838| 						// let the ConstructionFinished handler handle this.
|2839|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2839|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2840|2840| 						return true;
|2841|2841| 					}
|2842|2842| 
|    | [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
|3129|3129| 				this.StopTimer();
|3130|3130| 				this.ResetAnimation();
|3131|3131| 				if (this.formationAnimationVariant)
|3132|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3132|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3133|3133| 				else
|3134|3134| 					this.SetDefaultAnimationVariant();
|3135|3135| 				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
|3355|3355| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3356|3356| 
|3357|3357| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3358|    |-							// only used for domestic animals
|    |3358|+		// only used for domestic animals
|3359|3359| 
|3360|3360| 		// Reuse the same garrison behaviour for animals.
|3361|3361| 		"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
|3418|3418| 
|3419|3419| UnitAI.prototype.IsAnimal = function()
|3420|3420| {
|3421|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3421|+	return (!!this.template.NaturalBehaviour);
|3422|3422| };
|3423|3423| 
|3424|3424| 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
|3558|3558| 		{
|3559|3559| 			let index = this.GetCurrentState().indexOf(".");
|3560|3560| 			if (index != -1)
|3561|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3561|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3562|3562| 			this.Stop(false);
|3563|3563| 		}
|3564|3564| 
|    | [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
|3614|3614| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3615|3615| 			continue;
|3616|3616| 		if (i == 0)
|3617|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3617|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3618|3618| 		else
|3619|3619| 			this.orderQueue.splice(i, 1);
|3620|3620| 		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
|3614|3614| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3615|3615| 			continue;
|3616|3616| 		if (i == 0)
|3617|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3617|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3618|3618| 		else
|3619|3619| 			this.orderQueue.splice(i, 1);
|3620|3620| 		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
|3701|3701| };
|3702|3702| 
|3703|3703| 
|3704|    |-//// FSM linkage functions ////
|    |3704|+// // FSM linkage functions ////
|3705|3705| 
|3706|3706| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3707|3707| 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
|3872|3872| 				continue;
|3873|3873| 			if (this.orderQueue[i].type == type)
|3874|3874| 				continue;
|3875|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3875|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3876|3876| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3877|3877| 			return;
|3878|3878| 		}
|    | [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
|3872|3872| 				continue;
|3873|3873| 			if (this.orderQueue[i].type == type)
|3874|3874| 				continue;
|3875|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3875|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3876|3876| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3877|3877| 			return;
|3878|3878| 		}
|    | [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
|4113|4113| 	if (data.timerRepeat === undefined)
|4114|4114| 		this.timer = undefined;
|4115|4115| 
|4116|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4116|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4117|4117| };
|4118|4118| 
|4119|4119| /**
|    | [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
|4113|4113| 	if (data.timerRepeat === undefined)
|4114|4114| 		this.timer = undefined;
|4115|4115| 
|4116|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4116|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4117|4117| };
|4118|4118| 
|4119|4119| /**
|    | [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
|4158|4158| 	// TODO: This is a bit inefficient since every unit listens to every
|4159|4159| 	// construction message - ideally we could scope it to only the one we're building
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	// TODO: This is a bit inefficient since every unit listens to every
|4159|4159| 	// construction message - ideally we could scope it to only the one we're building
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4189|4189| 	if (msg.fromStatusEffect)
|4190|4190| 		return;
|4191|4191| 
|4192|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4192|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4193|4193| };
|4194|4194| 
|4195|4195| 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
|4189|4189| 	if (msg.fromStatusEffect)
|4190|4190| 		return;
|4191|4191| 
|4192|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4192|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4193|4193| };
|4194|4194| 
|4195|4195| 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
|4194|4194| 
|4195|4195| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4196|4196| {
|4197|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4197|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4198|4198| };
|4199|4199| 
|4200|4200| 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
|4194|4194| 
|4195|4195| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4196|4196| {
|4197|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4197|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4198|4198| };
|4199|4199| 
|4200|4200| 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
|4199|4199| 
|4200|4200| UnitAI.prototype.OnHealthChanged = function(msg)
|4201|4201| {
|4202|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4202|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4203|4203| };
|4204|4204| 
|4205|4205| 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
|4199|4199| 
|4200|4200| UnitAI.prototype.OnHealthChanged = function(msg)
|4201|4201| {
|4202|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4202|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4203|4203| };
|4204|4204| 
|4205|4205| 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
|4205|4205| UnitAI.prototype.OnRangeUpdate = function(msg)
|4206|4206| {
|4207|4207| 	if (msg.tag == this.losRangeQuery)
|4208|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4208|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4209|4209| 	else if (msg.tag == this.losHealRangeQuery)
|4210|4210| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4211|4211| };
|    | [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
|4205|4205| UnitAI.prototype.OnRangeUpdate = function(msg)
|4206|4206| {
|4207|4207| 	if (msg.tag == this.losRangeQuery)
|4208|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4208|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4209|4209| 	else if (msg.tag == this.losHealRangeQuery)
|4210|4210| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4211|4211| };
|    | [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
|4207|4207| 	if (msg.tag == this.losRangeQuery)
|4208|4208| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4209|4209| 	else if (msg.tag == this.losHealRangeQuery)
|4210|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4210|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4211|4211| };
|4212|4212| 
|4213|4213| 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
|4207|4207| 	if (msg.tag == this.losRangeQuery)
|4208|4208| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4209|4209| 	else if (msg.tag == this.losHealRangeQuery)
|4210|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4210|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4211|4211| };
|4212|4212| 
|4213|4213| 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
|4212|4212| 
|4213|4213| UnitAI.prototype.OnPackFinished = function(msg)
|4214|4214| {
|4215|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4215|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4216|4216| };
|4217|4217| 
|4218|4218| //// 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
|4212|4212| 
|4213|4213| UnitAI.prototype.OnPackFinished = function(msg)
|4214|4214| {
|4215|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4215|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4216|4216| };
|4217|4217| 
|4218|4218| //// 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
|4215|4215| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4216|4216| };
|4217|4217| 
|4218|    |-//// Helper functions to be called by the FSM ////
|    |4218|+// // Helper functions to be called by the FSM ////
|4219|4219| 
|4220|4220| UnitAI.prototype.GetWalkSpeed = function()
|4221|4221| {
|    | [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
|4945|4945| UnitAI.prototype.AttackEntityInZone = function(ents)
|4946|4946| {
|4947|4947| 	var target = ents.find(target =>
|4948|    |-		this.CanAttack(target)
|4949|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4948|+		this.CanAttack(target) &&
|    |4949|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4950|4950| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4951|4951| 	);
|4952|4952| 	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
|4946|4946| {
|4947|4947| 	var target = ents.find(target =>
|4948|4948| 		this.CanAttack(target)
|4949|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4950|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4949|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4950|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4951|4951| 	);
|4952|4952| 	if (!target)
|4953|4953| 		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
|5012|5012| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|5013|5013| 	if (this.isGuardOf)
|5014|5014| 	{
|5015|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5015|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5016|5016| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5017|5017| 		if (cmpUnitAI && cmpAttack &&
|5018|5018| 		    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
|5016|5016| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5017|5017| 		if (cmpUnitAI && cmpAttack &&
|5018|5018| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|5019|    |-				return false;
|    |5019|+			return false;
|5020|5020| 	}
|5021|5021| 
|5022|5022| 	// 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
|5054|5054| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5055|5055| 	if (this.isGuardOf)
|5056|5056| 	{
|5057|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5057|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5058|5058| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5059|5059| 		if (cmpUnitAI && cmpAttack &&
|5060|5060| 		    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
|5067|5067| 	return false;
|5068|5068| };
|5069|5069| 
|5070|    |-//// External interface functions ////
|    |5070|+// // External interface functions ////
|5071|5071| 
|5072|5072| UnitAI.prototype.SetFormationController = function(ent)
|5073|5073| {
|    | [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
|5223|5223| 	{
|5224|5224| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5225|5225| 			return;
|5226|    |-		else
|5227|    |-			this.RemoveGuard();
|    |5226|+		this.RemoveGuard();
|5228|5227| 	}
|5229|5228| 
|5230|5229| 	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
|5557|5557| 
|5558|5558| 	if (this.IsFormationController())
|5559|5559| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5560|    |-}
|    |5560|+};
|5561|5561| /**
|5562|5562|  * Adds trade order to the queue. Either walk to the first market, or
|5563|5563|  * 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
|5578|5578| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5579|5579| 	{
|5580|5580| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5581|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5581|+		if (cmpTrader.HasBothMarkets() &&
|5582|5582| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5583|5583| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5584|5584| 		{
|    | [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
|5859|5859| 				{
|5860|5860| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5861|5861| 					var targetClasses = this.order.data.targetClasses;
|5862|    |-					if (targetClasses.attack && cmpIdentity
|5863|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5862|+					if (targetClasses.attack && cmpIdentity &&
|    |5863|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5864|5864| 						continue;
|5865|5865| 					if (targetClasses.avoid && cmpIdentity
|5866|5866| 						&& 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
|5862|5862| 					if (targetClasses.attack && cmpIdentity
|5863|5863| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5864|5864| 						continue;
|5865|    |-					if (targetClasses.avoid && cmpIdentity
|5866|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5865|+					if (targetClasses.avoid && cmpIdentity &&
|    |5866|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5867|5867| 						continue;
|5868|5868| 					// Only used by the AIs to prevent some choices of targets
|5869|5869| 					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
|5885|5885| 		{
|5886|5886| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5887|5887| 			var targetClasses = this.order.data.targetClasses;
|5888|    |-			if (cmpIdentity && targetClasses.attack
|5889|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5888|+			if (cmpIdentity && targetClasses.attack &&
|    |5889|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5890|5890| 				continue;
|5891|5891| 			if (cmpIdentity && targetClasses.avoid
|5892|5892| 				&& 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
|5888|5888| 			if (cmpIdentity && targetClasses.attack
|5889|5889| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5890|5890| 				continue;
|5891|    |-			if (cmpIdentity && targetClasses.avoid
|5892|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5891|+			if (cmpIdentity && targetClasses.avoid &&
|    |5892|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5893|5893| 				continue;
|5894|5894| 			// Only used by the AIs to prevent some choices of targets
|5895|5895| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6048|6048| 
|6049|6049| UnitAI.prototype.SetHeldPosition = function(x, z)
|6050|6050| {
|6051|    |-	this.heldPosition = {"x": x, "z": z};
|    |6051|+	this.heldPosition = { "x": x, "z": z};
|6052|6052| };
|6053|6053| 
|6054|6054| 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
|6048|6048| 
|6049|6049| UnitAI.prototype.SetHeldPosition = function(x, z)
|6050|6050| {
|6051|    |-	this.heldPosition = {"x": x, "z": z};
|    |6051|+	this.heldPosition = {"x": x, "z": z };
|6052|6052| };
|6053|6053| 
|6054|6054| 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
|6075|6075| 	return false;
|6076|6076| };
|6077|6077| 
|6078|    |-//// Helper functions ////
|    |6078|+// // Helper functions ////
|6079|6079| 
|6080|6080| /**
|6081|6081|  * 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
|6094|6094| 		return undefined;
|6095|6095| 
|6096|6096| 	return component.GetRange(type);
|6097|    |-}
|    |6097|+};
|6098|6098| 
|6099|6099| UnitAI.prototype.CanAttack = function(target)
|6100|6100| {
|    | [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
|6262|6262| 	return cmpPack && cmpPack.IsPacking();
|6263|6263| };
|6264|6264| 
|6265|    |-//// Formation specific functions ////
|    |6265|+// // Formation specific functions ////
|6266|6266| 
|6267|6267| UnitAI.prototype.IsAttackingAsFormation = function()
|6268|6268| {
|    | [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
|6267|6267| UnitAI.prototype.IsAttackingAsFormation = function()
|6268|6268| {
|6269|6269| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6270|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6271|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6270|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6271|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6272|6272| };
|6273|6273| 
|6274|6274| //// 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
|6271|6271| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6272|6272| };
|6273|6273| 
|6274|    |-//// Animal specific functions ////
|    |6274|+// // Animal specific functions ////
|6275|6275| 
|6276|6276| UnitAI.prototype.MoveRandomly = function(distance)
|6277|6277| {

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
|2882| »   »   »   »   »   »   returgn;
|    | [NORMAL] ESLintBear (no-unused-expressions):
|    | Expected an assignment or function call and instead saw an expression.

binaries/data/mods/public/simulation/components/UnitAI.js
|4018| »   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
|4932| »   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
|4947| »   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
|4995| »   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
|5018| »   »   ····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
|2882| »   »   »   »   »   »   returgn;
|    | [NORMAL] JSHintBear:
|    | Expected an assignment or function call and instead saw an expression.

binaries/data/mods/public/simulation/components/UnitAI.js
|3132| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5889| »   »   »   »   &&·!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
|5892| »   »   »   »   &&·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
|6097| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

Vulcan added a comment.Tue, Jun 2, 5:49 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 (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2496|2496| 
|2497|2497| 								return type.specific == resourceType.specific &&
|2498|2498| 								    (type.specific != "meat" || resourceTemplate == template);
|2499|    |-						});
|    |2499|+							});
|2500|2500| 
|2501|2501| 						if (nearbyResource)
|2502|2502| 						{
|    | [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
|2836|2836| 					{
|2837|2837| 						// The building was already finished/fully repaired before we arrived;
|2838|2838| 						// let the ConstructionFinished handler handle this.
|2839|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2839|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2840|2840| 						return true;
|2841|2841| 					}
|2842|2842| 
|    | [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
|2836|2836| 					{
|2837|2837| 						// The building was already finished/fully repaired before we arrived;
|2838|2838| 						// let the ConstructionFinished handler handle this.
|2839|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2839|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2840|2840| 						return true;
|2841|2841| 					}
|2842|2842| 
|    | [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
|3129|3129| 				this.StopTimer();
|3130|3130| 				this.ResetAnimation();
|3131|3131| 				if (this.formationAnimationVariant)
|3132|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3132|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3133|3133| 				else
|3134|3134| 					this.SetDefaultAnimationVariant();
|3135|3135| 				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
|3355|3355| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3356|3356| 
|3357|3357| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3358|    |-							// only used for domestic animals
|    |3358|+		// only used for domestic animals
|3359|3359| 
|3360|3360| 		// Reuse the same garrison behaviour for animals.
|3361|3361| 		"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
|3418|3418| 
|3419|3419| UnitAI.prototype.IsAnimal = function()
|3420|3420| {
|3421|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3421|+	return (!!this.template.NaturalBehaviour);
|3422|3422| };
|3423|3423| 
|3424|3424| 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
|3558|3558| 		{
|3559|3559| 			let index = this.GetCurrentState().indexOf(".");
|3560|3560| 			if (index != -1)
|3561|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3561|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3562|3562| 			this.Stop(false);
|3563|3563| 		}
|3564|3564| 
|    | [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
|3614|3614| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3615|3615| 			continue;
|3616|3616| 		if (i == 0)
|3617|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3617|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3618|3618| 		else
|3619|3619| 			this.orderQueue.splice(i, 1);
|3620|3620| 		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
|3614|3614| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3615|3615| 			continue;
|3616|3616| 		if (i == 0)
|3617|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3617|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3618|3618| 		else
|3619|3619| 			this.orderQueue.splice(i, 1);
|3620|3620| 		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
|3701|3701| };
|3702|3702| 
|3703|3703| 
|3704|    |-//// FSM linkage functions ////
|    |3704|+// // FSM linkage functions ////
|3705|3705| 
|3706|3706| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3707|3707| 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
|3872|3872| 				continue;
|3873|3873| 			if (this.orderQueue[i].type == type)
|3874|3874| 				continue;
|3875|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3875|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3876|3876| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3877|3877| 			return;
|3878|3878| 		}
|    | [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
|3872|3872| 				continue;
|3873|3873| 			if (this.orderQueue[i].type == type)
|3874|3874| 				continue;
|3875|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3875|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3876|3876| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3877|3877| 			return;
|3878|3878| 		}
|    | [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
|4113|4113| 	if (data.timerRepeat === undefined)
|4114|4114| 		this.timer = undefined;
|4115|4115| 
|4116|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4116|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4117|4117| };
|4118|4118| 
|4119|4119| /**
|    | [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
|4113|4113| 	if (data.timerRepeat === undefined)
|4114|4114| 		this.timer = undefined;
|4115|4115| 
|4116|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4116|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4117|4117| };
|4118|4118| 
|4119|4119| /**
|    | [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
|4158|4158| 	// TODO: This is a bit inefficient since every unit listens to every
|4159|4159| 	// construction message - ideally we could scope it to only the one we're building
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	// TODO: This is a bit inefficient since every unit listens to every
|4159|4159| 	// construction message - ideally we could scope it to only the one we're building
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4189|4189| 	if (msg.fromStatusEffect)
|4190|4190| 		return;
|4191|4191| 
|4192|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4192|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4193|4193| };
|4194|4194| 
|4195|4195| 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
|4189|4189| 	if (msg.fromStatusEffect)
|4190|4190| 		return;
|4191|4191| 
|4192|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4192|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4193|4193| };
|4194|4194| 
|4195|4195| 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
|4194|4194| 
|4195|4195| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4196|4196| {
|4197|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4197|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4198|4198| };
|4199|4199| 
|4200|4200| 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
|4194|4194| 
|4195|4195| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4196|4196| {
|4197|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4197|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4198|4198| };
|4199|4199| 
|4200|4200| 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
|4199|4199| 
|4200|4200| UnitAI.prototype.OnHealthChanged = function(msg)
|4201|4201| {
|4202|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4202|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4203|4203| };
|4204|4204| 
|4205|4205| 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
|4199|4199| 
|4200|4200| UnitAI.prototype.OnHealthChanged = function(msg)
|4201|4201| {
|4202|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4202|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4203|4203| };
|4204|4204| 
|4205|4205| 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
|4205|4205| UnitAI.prototype.OnRangeUpdate = function(msg)
|4206|4206| {
|4207|4207| 	if (msg.tag == this.losRangeQuery)
|4208|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4208|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4209|4209| 	else if (msg.tag == this.losHealRangeQuery)
|4210|4210| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4211|4211| };
|    | [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
|4205|4205| UnitAI.prototype.OnRangeUpdate = function(msg)
|4206|4206| {
|4207|4207| 	if (msg.tag == this.losRangeQuery)
|4208|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4208|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4209|4209| 	else if (msg.tag == this.losHealRangeQuery)
|4210|4210| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4211|4211| };
|    | [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
|4207|4207| 	if (msg.tag == this.losRangeQuery)
|4208|4208| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4209|4209| 	else if (msg.tag == this.losHealRangeQuery)
|4210|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4210|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4211|4211| };
|4212|4212| 
|4213|4213| 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
|4207|4207| 	if (msg.tag == this.losRangeQuery)
|4208|4208| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4209|4209| 	else if (msg.tag == this.losHealRangeQuery)
|4210|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4210|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4211|4211| };
|4212|4212| 
|4213|4213| 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
|4212|4212| 
|4213|4213| UnitAI.prototype.OnPackFinished = function(msg)
|4214|4214| {
|4215|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4215|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4216|4216| };
|4217|4217| 
|4218|4218| //// 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
|4212|4212| 
|4213|4213| UnitAI.prototype.OnPackFinished = function(msg)
|4214|4214| {
|4215|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4215|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4216|4216| };
|4217|4217| 
|4218|4218| //// 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
|4215|4215| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4216|4216| };
|4217|4217| 
|4218|    |-//// Helper functions to be called by the FSM ////
|    |4218|+// // Helper functions to be called by the FSM ////
|4219|4219| 
|4220|4220| UnitAI.prototype.GetWalkSpeed = function()
|4221|4221| {
|    | [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
|4945|4945| UnitAI.prototype.AttackEntityInZone = function(ents)
|4946|4946| {
|4947|4947| 	var target = ents.find(target =>
|4948|    |-		this.CanAttack(target)
|4949|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4948|+		this.CanAttack(target) &&
|    |4949|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4950|4950| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4951|4951| 	);
|4952|4952| 	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
|4946|4946| {
|4947|4947| 	var target = ents.find(target =>
|4948|4948| 		this.CanAttack(target)
|4949|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4950|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4949|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4950|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4951|4951| 	);
|4952|4952| 	if (!target)
|4953|4953| 		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
|5012|5012| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|5013|5013| 	if (this.isGuardOf)
|5014|5014| 	{
|5015|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5015|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5016|5016| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5017|5017| 		if (cmpUnitAI && cmpAttack &&
|5018|5018| 		    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
|5016|5016| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5017|5017| 		if (cmpUnitAI && cmpAttack &&
|5018|5018| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|5019|    |-				return false;
|    |5019|+			return false;
|5020|5020| 	}
|5021|5021| 
|5022|5022| 	// 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
|5054|5054| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5055|5055| 	if (this.isGuardOf)
|5056|5056| 	{
|5057|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5057|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5058|5058| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5059|5059| 		if (cmpUnitAI && cmpAttack &&
|5060|5060| 		    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
|5067|5067| 	return false;
|5068|5068| };
|5069|5069| 
|5070|    |-//// External interface functions ////
|    |5070|+// // External interface functions ////
|5071|5071| 
|5072|5072| UnitAI.prototype.SetFormationController = function(ent)
|5073|5073| {
|    | [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
|5223|5223| 	{
|5224|5224| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5225|5225| 			return;
|5226|    |-		else
|5227|    |-			this.RemoveGuard();
|    |5226|+		this.RemoveGuard();
|5228|5227| 	}
|5229|5228| 
|5230|5229| 	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
|5557|5557| 
|5558|5558| 	if (this.IsFormationController())
|5559|5559| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5560|    |-}
|    |5560|+};
|5561|5561| /**
|5562|5562|  * Adds trade order to the queue. Either walk to the first market, or
|5563|5563|  * 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
|5578|5578| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5579|5579| 	{
|5580|5580| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5581|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5581|+		if (cmpTrader.HasBothMarkets() &&
|5582|5582| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5583|5583| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5584|5584| 		{
|    | [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
|5859|5859| 				{
|5860|5860| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5861|5861| 					var targetClasses = this.order.data.targetClasses;
|5862|    |-					if (targetClasses.attack && cmpIdentity
|5863|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5862|+					if (targetClasses.attack && cmpIdentity &&
|    |5863|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5864|5864| 						continue;
|5865|5865| 					if (targetClasses.avoid && cmpIdentity
|5866|5866| 						&& 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
|5862|5862| 					if (targetClasses.attack && cmpIdentity
|5863|5863| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5864|5864| 						continue;
|5865|    |-					if (targetClasses.avoid && cmpIdentity
|5866|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5865|+					if (targetClasses.avoid && cmpIdentity &&
|    |5866|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5867|5867| 						continue;
|5868|5868| 					// Only used by the AIs to prevent some choices of targets
|5869|5869| 					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
|5885|5885| 		{
|5886|5886| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5887|5887| 			var targetClasses = this.order.data.targetClasses;
|5888|    |-			if (cmpIdentity && targetClasses.attack
|5889|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5888|+			if (cmpIdentity && targetClasses.attack &&
|    |5889|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5890|5890| 				continue;
|5891|5891| 			if (cmpIdentity && targetClasses.avoid
|5892|5892| 				&& 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
|5888|5888| 			if (cmpIdentity && targetClasses.attack
|5889|5889| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5890|5890| 				continue;
|5891|    |-			if (cmpIdentity && targetClasses.avoid
|5892|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5891|+			if (cmpIdentity && targetClasses.avoid &&
|    |5892|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5893|5893| 				continue;
|5894|5894| 			// Only used by the AIs to prevent some choices of targets
|5895|5895| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6048|6048| 
|6049|6049| UnitAI.prototype.SetHeldPosition = function(x, z)
|6050|6050| {
|6051|    |-	this.heldPosition = {"x": x, "z": z};
|    |6051|+	this.heldPosition = { "x": x, "z": z};
|6052|6052| };
|6053|6053| 
|6054|6054| 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
|6048|6048| 
|6049|6049| UnitAI.prototype.SetHeldPosition = function(x, z)
|6050|6050| {
|6051|    |-	this.heldPosition = {"x": x, "z": z};
|    |6051|+	this.heldPosition = {"x": x, "z": z };
|6052|6052| };
|6053|6053| 
|6054|6054| 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
|6075|6075| 	return false;
|6076|6076| };
|6077|6077| 
|6078|    |-//// Helper functions ////
|    |6078|+// // Helper functions ////
|6079|6079| 
|6080|6080| /**
|6081|6081|  * 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
|6094|6094| 		return undefined;
|6095|6095| 
|6096|6096| 	return component.GetRange(type);
|6097|    |-}
|    |6097|+};
|6098|6098| 
|6099|6099| UnitAI.prototype.CanAttack = function(target)
|6100|6100| {
|    | [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
|6262|6262| 	return cmpPack && cmpPack.IsPacking();
|6263|6263| };
|6264|6264| 
|6265|    |-//// Formation specific functions ////
|    |6265|+// // Formation specific functions ////
|6266|6266| 
|6267|6267| UnitAI.prototype.IsAttackingAsFormation = function()
|6268|6268| {
|    | [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
|6267|6267| UnitAI.prototype.IsAttackingAsFormation = function()
|6268|6268| {
|6269|6269| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6270|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6271|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6270|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6271|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6272|6272| };
|6273|6273| 
|6274|6274| //// 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
|6271|6271| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6272|6272| };
|6273|6273| 
|6274|    |-//// Animal specific functions ////
|    |6274|+// // Animal specific functions ////
|6275|6275| 
|6276|6276| UnitAI.prototype.MoveRandomly = function(distance)
|6277|6277| {

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
|4018| »   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
|4932| »   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
|4947| »   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
|4995| »   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
|5018| »   »   ····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
|3132| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5889| »   »   »   »   &&·!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
|5892| »   »   »   »   &&·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
|6097| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

Angen added a subscriber: Angen.Wed, Jun 3, 11:24 AM

did not test it but looks good by checking the code

This revision was not accepted when it landed; it landed in state Needs Review.Thu, Jun 4, 1:07 PM
This revision was automatically updated to reflect the committed changes.