Page MenuHomeWildfire Games

[attempt 2] Enable garrisoning on gates / fix movement of units with visible garrison points
ClosedPublic

Authored by wraitii on May 31 2020, 8:12 PM.

Details

Summary

This is the same diff as D1418, fixing noted issues:

  • skirmish-replaced entities did not work, as I ran into a weird issue with the "construction->movement" change (see D1445).
  • OnEntityRenamed was broken. I thought it was necessary for wall/gate upgrading, but it turns out that the renamed entity does get OwnershipChanged messages, and thus this worked. I suppose it might have been broken at some point in the past? I'm unsure what I've done here.

Original description:
This addresses two related issues:

  • Units visibly garrisoned on gates keep the gate open.
  • Units visibly garrisoned on entities keep their pathfinding blocker flags.

The second is fixed by removing the obstruction of visibly garrisoned entities. This fixes #5151 .

The first is fixed by changing some logic to consider the ability of units to move.
Add a "SetImmobile" function to UnitAI, to mark a unit as incapable of moving (though it theoretically could).
Change from IsTurret checks to use that function instead.
Packing logic is kept separate as it's trickier.

With this, gates can subscribe to those events and can choose to ignore units that can't move (since it makes no sense to open the gate for those), fixing the issue.

Attached is a small replay of some cases that wouldn't work properly on SVN.

Test Plan

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.May 31 2020, 8:12 PM

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

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2275/display/redirect

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/877/display/redirect

wraitii updated this revision to Diff 12079.Jun 1 2020, 8:30 AM
wraitii edited the summary of this revision. (Show Details)

Add tests & actually mage visible garrisoned entities have no obstruction at all because it still broke and that makes more sense than hacking around flags.

Vulcan added a comment.Jun 1 2020, 8:35 AM

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/879/display/redirect

Vulcan added a comment.Jun 1 2020, 8:57 AM

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

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpObstruction.cpp
|   1| /*·Copyright·(C)·2018·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2018"

source/simulation2/components/ICmpObstruction.h
|  29| class·ICmpObstruction·:·public·IComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpObstruction:' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/tests/test_ObstructionManager.h
|  23| class·MockObstruction·:·public·ICmpObstruction
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classMockObstruction:' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 788| 788| 					this.FinishOrder();
| 789| 789| 					return;
| 790| 790| 				}
| 791|    |-				else
| 792|    |-				{
|    | 791|+				
| 793| 792| 					this.SetNextState("GARRISON.APPROACHING");
| 794| 793| 					return;
| 795|    |-				}
|    | 794|+				
| 796| 795| 			}
| 797| 796| 
| 798| 797| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1060|1060| 			},
|1061|1061| 		},
|1062|1062| 
|1063|    |-		"GARRISON":{
|    |1063|+		"GARRISON": {
|1064|1064| 			"APPROACHING": {
|1065|1065| 				"enter": function() {
|1066|1066| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2034|2034| 
|2035|2035| 				"Attacked": function(msg) {
|2036|2036| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2037|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2038|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2037|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2038|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2039|2039| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2040|2040| 				},
|2041|2041| 			},
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2193|2193| 					"MovementUpdate": function(msg) {
|2194|2194| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2195|2195| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2196|    |-						if (msg.likelyFailure || 
|    |2196|+						if (msg.likelyFailure ||
|2197|2197| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2198|2198| 							!msg.obstructed && this.CheckRange(this.order.data))
|2199|2199| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2835|2835| 					{
|2836|2836| 						// The building was already finished/fully repaired before we arrived;
|2837|2837| 						// let the ConstructionFinished handler handle this.
|2838|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2838|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2839|2839| 						return true;
|2840|2840| 					}
|2841|2841| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2835|2835| 					{
|2836|2836| 						// The building was already finished/fully repaired before we arrived;
|2837|2837| 						// let the ConstructionFinished handler handle this.
|2838|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2838|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2839|2839| 						return true;
|2840|2840| 					}
|2841|2841| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3134|3134| 				this.StopTimer();
|3135|3135| 				this.ResetAnimation();
|3136|3136| 				if (this.formationAnimationVariant)
|3137|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3137|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3138|3138| 				else
|3139|3139| 					this.SetDefaultAnimationVariant();
|3140|3140| 				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
|3360|3360| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3361|3361| 
|3362|3362| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3363|    |-							// only used for domestic animals
|    |3363|+		// only used for domestic animals
|3364|3364| 
|3365|3365| 		// Reuse the same garrison behaviour for animals.
|3366|3366| 		"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
|3423|3423| 
|3424|3424| UnitAI.prototype.IsAnimal = function()
|3425|3425| {
|3426|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3426|+	return (!!this.template.NaturalBehaviour);
|3427|3427| };
|3428|3428| 
|3429|3429| 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
|3563|3563| 		{
|3564|3564| 			let index = this.GetCurrentState().indexOf(".");
|3565|3565| 			if (index != -1)
|3566|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3566|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3567|3567| 			this.Stop(false);
|3568|3568| 		}
|3569|3569| 
|    | [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
|3619|3619| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3620|3620| 			continue;
|3621|3621| 		if (i == 0)
|3622|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3622|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3623|3623| 		else
|3624|3624| 			this.orderQueue.splice(i, 1);
|3625|3625| 		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
|3619|3619| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3620|3620| 			continue;
|3621|3621| 		if (i == 0)
|3622|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3622|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3623|3623| 		else
|3624|3624| 			this.orderQueue.splice(i, 1);
|3625|3625| 		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
|3706|3706| };
|3707|3707| 
|3708|3708| 
|3709|    |-//// FSM linkage functions ////
|    |3709|+// // FSM linkage functions ////
|3710|3710| 
|3711|3711| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3712|3712| 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
|3877|3877| 				continue;
|3878|3878| 			if (this.orderQueue[i].type == type)
|3879|3879| 				continue;
|3880|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3880|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3881|3881| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3882|3882| 			return;
|3883|3883| 		}
|    | [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
|3877|3877| 				continue;
|3878|3878| 			if (this.orderQueue[i].type == type)
|3879|3879| 				continue;
|3880|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3880|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3881|3881| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3882|3882| 			return;
|3883|3883| 		}
|    | [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
|4118|4118| 	if (data.timerRepeat === undefined)
|4119|4119| 		this.timer = undefined;
|4120|4120| 
|4121|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4121|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4122|4122| };
|4123|4123| 
|4124|4124| /**
|    | [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
|4118|4118| 	if (data.timerRepeat === undefined)
|4119|4119| 		this.timer = undefined;
|4120|4120| 
|4121|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4121|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4122|4122| };
|4123|4123| 
|4124|4124| /**
|    | [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
|4163|4163| 	// TODO: This is a bit inefficient since every unit listens to every
|4164|4164| 	// construction message - ideally we could scope it to only the one we're building
|4165|4165| 
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 	// TODO: This is a bit inefficient since every unit listens to every
|4164|4164| 	// construction message - ideally we could scope it to only the one we're building
|4165|4165| 
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4194|4194| 	if (msg.fromStatusEffect)
|4195|4195| 		return;
|4196|4196| 
|4197|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4197|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4198|4198| };
|4199|4199| 
|4200|4200| 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
|4194|4194| 	if (msg.fromStatusEffect)
|4195|4195| 		return;
|4196|4196| 
|4197|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4197|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4198|4198| };
|4199|4199| 
|4200|4200| 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
|4199|4199| 
|4200|4200| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4201|4201| {
|4202|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4202|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4203|4203| };
|4204|4204| 
|4205|4205| 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
|4199|4199| 
|4200|4200| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4201|4201| {
|4202|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4202|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4203|4203| };
|4204|4204| 
|4205|4205| 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
|4204|4204| 
|4205|4205| UnitAI.prototype.OnHealthChanged = function(msg)
|4206|4206| {
|4207|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4207|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4208|4208| };
|4209|4209| 
|4210|4210| 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
|4204|4204| 
|4205|4205| UnitAI.prototype.OnHealthChanged = function(msg)
|4206|4206| {
|4207|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4207|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4208|4208| };
|4209|4209| 
|4210|4210| 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
|4210|4210| UnitAI.prototype.OnRangeUpdate = function(msg)
|4211|4211| {
|4212|4212| 	if (msg.tag == this.losRangeQuery)
|4213|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4213|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4214|4214| 	else if (msg.tag == this.losHealRangeQuery)
|4215|4215| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4216|4216| };
|    | [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
|4210|4210| UnitAI.prototype.OnRangeUpdate = function(msg)
|4211|4211| {
|4212|4212| 	if (msg.tag == this.losRangeQuery)
|4213|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4213|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4214|4214| 	else if (msg.tag == this.losHealRangeQuery)
|4215|4215| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4216|4216| };
|    | [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| 	if (msg.tag == this.losRangeQuery)
|4213|4213| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4214|4214| 	else if (msg.tag == this.losHealRangeQuery)
|4215|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4215|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4216|4216| };
|4217|4217| 
|4218|4218| 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
|4212|4212| 	if (msg.tag == this.losRangeQuery)
|4213|4213| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4214|4214| 	else if (msg.tag == this.losHealRangeQuery)
|4215|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4215|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4216|4216| };
|4217|4217| 
|4218|4218| 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
|4217|4217| 
|4218|4218| UnitAI.prototype.OnPackFinished = function(msg)
|4219|4219| {
|4220|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4220|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4221|4221| };
|4222|4222| 
|4223|4223| //// 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
|4217|4217| 
|4218|4218| UnitAI.prototype.OnPackFinished = function(msg)
|4219|4219| {
|4220|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4220|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4221|4221| };
|4222|4222| 
|4223|4223| //// 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
|4220|4220| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4221|4221| };
|4222|4222| 
|4223|    |-//// Helper functions to be called by the FSM ////
|    |4223|+// // Helper functions to be called by the FSM ////
|4224|4224| 
|4225|4225| UnitAI.prototype.GetWalkSpeed = function()
|4226|4226| {
|    | [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
|4935|4935| UnitAI.prototype.AttackEntityInZone = function(ents)
|4936|4936| {
|4937|4937| 	var target = ents.find(target =>
|4938|    |-		this.CanAttack(target)
|4939|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4938|+		this.CanAttack(target) &&
|    |4939|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4940|4940| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4941|4941| 	);
|4942|4942| 	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
|4936|4936| {
|4937|4937| 	var target = ents.find(target =>
|4938|4938| 		this.CanAttack(target)
|4939|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4940|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4939|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4940|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4941|4941| 	);
|4942|4942| 	if (!target)
|4943|4943| 		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
|5002|5002| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|5003|5003| 	if (this.isGuardOf)
|5004|5004| 	{
|5005|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5005|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5006|5006| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5007|5007| 		if (cmpUnitAI && cmpAttack &&
|5008|5008| 		    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
|5006|5006| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5007|5007| 		if (cmpUnitAI && cmpAttack &&
|5008|5008| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|5009|    |-				return false;
|    |5009|+			return false;
|5010|5010| 	}
|5011|5011| 
|5012|5012| 	// 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
|5044|5044| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5045|5045| 	if (this.isGuardOf)
|5046|5046| 	{
|5047|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5047|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5048|5048| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5049|5049| 		if (cmpUnitAI && cmpAttack &&
|5050|5050| 		    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
|5057|5057| 	return false;
|5058|5058| };
|5059|5059| 
|5060|    |-//// External interface functions ////
|    |5060|+// // External interface functions ////
|5061|5061| 
|5062|5062| UnitAI.prototype.SetFormationController = function(ent)
|5063|5063| {
|    | [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
|5213|5213| 	{
|5214|5214| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5215|5215| 			return;
|5216|    |-		else
|5217|    |-			this.RemoveGuard();
|    |5216|+		this.RemoveGuard();
|5218|5217| 	}
|5219|5218| 
|5220|5219| 	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
|5547|5547| 
|5548|5548| 	if (this.IsFormationController())
|5549|5549| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5550|    |-}
|    |5550|+};
|5551|5551| /**
|5552|5552|  * Adds trade order to the queue. Either walk to the first market, or
|5553|5553|  * 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
|5568|5568| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5569|5569| 	{
|5570|5570| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5571|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5571|+		if (cmpTrader.HasBothMarkets() &&
|5572|5572| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5573|5573| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5574|5574| 		{
|    | [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
|5849|5849| 				{
|5850|5850| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5851|5851| 					var targetClasses = this.order.data.targetClasses;
|5852|    |-					if (targetClasses.attack && cmpIdentity
|5853|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5852|+					if (targetClasses.attack && cmpIdentity &&
|    |5853|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5854|5854| 						continue;
|5855|5855| 					if (targetClasses.avoid && cmpIdentity
|5856|5856| 						&& 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
|5852|5852| 					if (targetClasses.attack && cmpIdentity
|5853|5853| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5854|5854| 						continue;
|5855|    |-					if (targetClasses.avoid && cmpIdentity
|5856|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5855|+					if (targetClasses.avoid && cmpIdentity &&
|    |5856|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5857|5857| 						continue;
|5858|5858| 					// Only used by the AIs to prevent some choices of targets
|5859|5859| 					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
|5875|5875| 		{
|5876|5876| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5877|5877| 			var targetClasses = this.order.data.targetClasses;
|5878|    |-			if (cmpIdentity && targetClasses.attack
|5879|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5878|+			if (cmpIdentity && targetClasses.attack &&
|    |5879|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5880|5880| 				continue;
|5881|5881| 			if (cmpIdentity && targetClasses.avoid
|5882|5882| 				&& 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
|5878|5878| 			if (cmpIdentity && targetClasses.attack
|5879|5879| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5880|5880| 				continue;
|5881|    |-			if (cmpIdentity && targetClasses.avoid
|5882|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5881|+			if (cmpIdentity && targetClasses.avoid &&
|    |5882|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5883|5883| 				continue;
|5884|5884| 			// Only used by the AIs to prevent some choices of targets
|5885|5885| 			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
|6038|6038| 
|6039|6039| UnitAI.prototype.SetHeldPosition = function(x, z)
|6040|6040| {
|6041|    |-	this.heldPosition = {"x": x, "z": z};
|    |6041|+	this.heldPosition = { "x": x, "z": z};
|6042|6042| };
|6043|6043| 
|6044|6044| 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
|6038|6038| 
|6039|6039| UnitAI.prototype.SetHeldPosition = function(x, z)
|6040|6040| {
|6041|    |-	this.heldPosition = {"x": x, "z": z};
|    |6041|+	this.heldPosition = {"x": x, "z": z };
|6042|6042| };
|6043|6043| 
|6044|6044| 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
|6065|6065| 	return false;
|6066|6066| };
|6067|6067| 
|6068|    |-//// Helper functions ////
|    |6068|+// // Helper functions ////
|6069|6069| 
|6070|6070| /**
|6071|6071|  * 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
|6084|6084| 		return undefined;
|6085|6085| 
|6086|6086| 	return component.GetRange(type);
|6087|    |-}
|    |6087|+};
|6088|6088| 
|6089|6089| UnitAI.prototype.CanAttack = function(target)
|6090|6090| {
|    | [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
|6252|6252| 	return cmpPack && cmpPack.IsPacking();
|6253|6253| };
|6254|6254| 
|6255|    |-//// Formation specific functions ////
|    |6255|+// // Formation specific functions ////
|6256|6256| 
|6257|6257| UnitAI.prototype.IsAttackingAsFormation = function()
|6258|6258| {
|    | [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
|6257|6257| UnitAI.prototype.IsAttackingAsFormation = function()
|6258|6258| {
|6259|6259| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6260|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6261|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6260|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6261|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6262|6262| };
|6263|6263| 
|6264|6264| //// 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
|6261|6261| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6262|6262| };
|6263|6263| 
|6264|    |-//// Animal specific functions ////
|    |6264|+// // Animal specific functions ////
|6265|6265| 
|6266|6266| UnitAI.prototype.MoveRandomly = function(distance)
|6267|6267| {

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
|4023| »   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
|4922| »   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
|4937| »   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
|4985| »   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
|5008| »   »   ····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
|3137| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

wraitii added inline comments.Jun 2 2020, 10:29 AM
binaries/data/mods/public/simulation/components/GarrisonHolder.js
257 ↗(On Diff #12079)

This is safe with regards to range queries since the range manager doesn't care about active or inactive obstructions, so I do think it's the simplest fix.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 2 2020, 1:40 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.