Page MenuHomeWildfire Games

Fix Let certain formations stay in formation while attacking
AbandonedPublic

Authored by Silier on Apr 25 2020, 9:28 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Trac Tickets
#4951
Summary

rP14633 introduced checks in MoveToTargetAttackRange and CheckTargetAttackRange to not move formation member if they are attacking as one formation.
However check in CheckTargetAttackRange is causing members to never check their range, see example in #4951.

This is removing falsy check and replacing it with separate function in required places.

Test Plan

Set CanAttackAsFormation to true and make some play tests.

Event Timeline

Silier created this revision.Apr 25 2020, 9:28 PM

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1502/display/redirect

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

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

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

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

Silier planned changes to this revision.Apr 25 2020, 9:42 PM

need to fix tests

Silier updated this revision to Diff 11723.Apr 26 2020, 4:01 PM

remove &&
nicer condition
fix wrong placement of function in attacking state

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
| 794| 794| 					this.FinishOrder();
| 795| 795| 					return;
| 796| 796| 				}
| 797|    |-				else
| 798|    |-				{
|    | 797|+				
| 799| 798| 					this.SetNextState("GARRISON.APPROACHING");
| 800| 799| 					return;
| 801|    |-				}
|    | 800|+				
| 802| 801| 			}
| 803| 802| 
| 804| 803| 			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
|1066|1066| 			},
|1067|1067| 		},
|1068|1068| 
|1069|    |-		"GARRISON":{
|    |1069|+		"GARRISON": {
|1070|1070| 			"APPROACHING": {
|1071|1071| 				"enter": function() {
|1072|1072| 					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
|2053|2053| 
|2054|2054| 				"Attacked": function(msg) {
|2055|2055| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2056|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2057|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2056|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2057|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2058|2058| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2059|2059| 				},
|2060|2060| 			},
|    | [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
|2212|2212| 					"MovementUpdate": function(msg) {
|2213|2213| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2214|2214| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2215|    |-						if (msg.likelyFailure || 
|    |2215|+						if (msg.likelyFailure ||
|2216|2216| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2217|2217| 							!msg.obstructed && this.CheckRange(this.order.data))
|2218|2218| 							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
|2854|2854| 					{
|2855|2855| 						// The building was already finished/fully repaired before we arrived;
|2856|2856| 						// let the ConstructionFinished handler handle this.
|2857|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2857|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2858|2858| 						return true;
|2859|2859| 					}
|2860|2860| 
|    | [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
|2854|2854| 					{
|2855|2855| 						// The building was already finished/fully repaired before we arrived;
|2856|2856| 						// let the ConstructionFinished handler handle this.
|2857|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2857|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2858|2858| 						return true;
|2859|2859| 					}
|2860|2860| 
|    | [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
|3152|3152| 				this.StopTimer();
|3153|3153| 				this.ResetAnimation();
|3154|3154| 				if (this.formationAnimationVariant)
|3155|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3155|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3156|3156| 				else
|3157|3157| 					this.SetDefaultAnimationVariant();
|3158|3158| 				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
|3378|3378| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3379|3379| 
|3380|3380| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3381|    |-							// only used for domestic animals
|    |3381|+		// only used for domestic animals
|3382|3382| 
|3383|3383| 		// Reuse the same garrison behaviour for animals.
|3384|3384| 		"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
|3440|3440| 
|3441|3441| UnitAI.prototype.IsAnimal = function()
|3442|3442| {
|3443|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3443|+	return (!!this.template.NaturalBehaviour);
|3444|3444| };
|3445|3445| 
|3446|3446| 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
|3556|3556| 		{
|3557|3557| 			let index = this.GetCurrentState().indexOf(".");
|3558|3558| 			if (index != -1)
|3559|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3559|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3560|3560| 			this.Stop(false);
|3561|3561| 		}
|3562|3562| 
|    | [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
|3612|3612| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3613|3613| 			continue;
|3614|3614| 		if (i == 0)
|3615|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3615|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3616|3616| 		else
|3617|3617| 			this.orderQueue.splice(i, 1);
|3618|3618| 		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
|3612|3612| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3613|3613| 			continue;
|3614|3614| 		if (i == 0)
|3615|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3615|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3616|3616| 		else
|3617|3617| 			this.orderQueue.splice(i, 1);
|3618|3618| 		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
|3699|3699| };
|3700|3700| 
|3701|3701| 
|3702|    |-//// FSM linkage functions ////
|    |3702|+// // FSM linkage functions ////
|3703|3703| 
|3704|3704| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3705|3705| 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
|3870|3870| 				continue;
|3871|3871| 			if (this.orderQueue[i].type == type)
|3872|3872| 				continue;
|3873|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3873|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3874|3874| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3875|3875| 			return;
|3876|3876| 		}
|    | [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
|3870|3870| 				continue;
|3871|3871| 			if (this.orderQueue[i].type == type)
|3872|3872| 				continue;
|3873|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3873|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3874|3874| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3875|3875| 			return;
|3876|3876| 		}
|    | [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
|4112|4112| 	if (data.timerRepeat === undefined)
|4113|4113| 		this.timer = undefined;
|4114|4114| 
|4115|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4115|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4116|4116| };
|4117|4117| 
|4118|4118| /**
|    | [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
|4112|4112| 	if (data.timerRepeat === undefined)
|4113|4113| 		this.timer = undefined;
|4114|4114| 
|4115|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4115|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4116|4116| };
|4117|4117| 
|4118|4118| /**
|    | [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
|4157|4157| 	// TODO: This is a bit inefficient since every unit listens to every
|4158|4158| 	// construction message - ideally we could scope it to only the one we're building
|4159|4159| 
|4160|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4160|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4161|4161| };
|4162|4162| 
|4163|4163| 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
|4157|4157| 	// TODO: This is a bit inefficient since every unit listens to every
|4158|4158| 	// construction message - ideally we could scope it to only the one we're building
|4159|4159| 
|4160|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4160|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4161|4161| };
|4162|4162| 
|4163|4163| 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
|4188|4188| 	if (msg.fromStatusEffect)
|4189|4189| 		return;
|4190|4190| 
|4191|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4191|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4192|4192| };
|4193|4193| 
|4194|4194| 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
|4188|4188| 	if (msg.fromStatusEffect)
|4189|4189| 		return;
|4190|4190| 
|4191|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4191|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4192|4192| };
|4193|4193| 
|4194|4194| 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
|4193|4193| 
|4194|4194| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4195|4195| {
|4196|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4196|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4197|4197| };
|4198|4198| 
|4199|4199| 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
|4193|4193| 
|4194|4194| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4195|4195| {
|4196|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4196|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4197|4197| };
|4198|4198| 
|4199|4199| 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
|4198|4198| 
|4199|4199| UnitAI.prototype.OnHealthChanged = function(msg)
|4200|4200| {
|4201|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4201|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4202|4202| };
|4203|4203| 
|4204|4204| 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
|4198|4198| 
|4199|4199| UnitAI.prototype.OnHealthChanged = function(msg)
|4200|4200| {
|4201|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4201|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4202|4202| };
|4203|4203| 
|4204|4204| 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
|4204|4204| UnitAI.prototype.OnRangeUpdate = function(msg)
|4205|4205| {
|4206|4206| 	if (msg.tag == this.losRangeQuery)
|4207|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4207|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4208|4208| 	else if (msg.tag == this.losHealRangeQuery)
|4209|4209| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4210|4210| };
|    | [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| UnitAI.prototype.OnRangeUpdate = function(msg)
|4205|4205| {
|4206|4206| 	if (msg.tag == this.losRangeQuery)
|4207|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4207|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4208|4208| 	else if (msg.tag == this.losHealRangeQuery)
|4209|4209| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4210|4210| };
|    | [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
|4206|4206| 	if (msg.tag == this.losRangeQuery)
|4207|4207| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4208|4208| 	else if (msg.tag == this.losHealRangeQuery)
|4209|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4209|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4210|4210| };
|4211|4211| 
|4212|4212| 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
|4206|4206| 	if (msg.tag == this.losRangeQuery)
|4207|4207| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4208|4208| 	else if (msg.tag == this.losHealRangeQuery)
|4209|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4209|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4210|4210| };
|4211|4211| 
|4212|4212| 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
|4211|4211| 
|4212|4212| UnitAI.prototype.OnPackFinished = function(msg)
|4213|4213| {
|4214|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4214|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4215|4215| };
|4216|4216| 
|4217|4217| //// 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
|4211|4211| 
|4212|4212| UnitAI.prototype.OnPackFinished = function(msg)
|4213|4213| {
|4214|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4214|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4215|4215| };
|4216|4216| 
|4217|4217| //// 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
|4214|4214| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4215|4215| };
|4216|4216| 
|4217|    |-//// Helper functions to be called by the FSM ////
|    |4217|+// // Helper functions to be called by the FSM ////
|4218|4218| 
|4219|4219| UnitAI.prototype.GetWalkSpeed = function()
|4220|4220| {
|    | [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
|4686|4686| 	// For formation members, the formation will take care of the range check
|4687|4687| 	let cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4688|4688| 	return !cmpFormationUnitAI || !cmpFormationUnitAI.IsAttackingAsFormation();
|4689|    |-}
|    |4689|+};
|4690|4690| 
|4691|4691| /**
|4692|4692|  * Check if the target is inside the attack range
|    | [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
|4923|4923| UnitAI.prototype.AttackEntityInZone = function(ents)
|4924|4924| {
|4925|4925| 	var target = ents.find(target =>
|4926|    |-		this.CanAttack(target)
|4927|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4926|+		this.CanAttack(target) &&
|    |4927|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4928|4928| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4929|4929| 	);
|4930|4930| 	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
|4924|4924| {
|4925|4925| 	var target = ents.find(target =>
|4926|4926| 		this.CanAttack(target)
|4927|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4928|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4927|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4928|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4929|4929| 	);
|4930|4930| 	if (!target)
|4931|4931| 		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
|4988|4988| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4989|4989| 	if (this.isGuardOf)
|4990|4990| 	{
|4991|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4991|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4992|4992| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4993|4993| 		if (cmpUnitAI && cmpAttack &&
|4994|4994| 		    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
|4992|4992| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4993|4993| 		if (cmpUnitAI && cmpAttack &&
|4994|4994| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4995|    |-				return false;
|    |4995|+			return false;
|4996|4996| 	}
|4997|4997| 
|4998|4998| 	// 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
|5030|5030| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5031|5031| 	if (this.isGuardOf)
|5032|5032| 	{
|5033|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5033|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5034|5034| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5035|5035| 		if (cmpUnitAI && cmpAttack &&
|5036|5036| 		    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
|5043|5043| 	return false;
|5044|5044| };
|5045|5045| 
|5046|    |-//// External interface functions ////
|    |5046|+// // External interface functions ////
|5047|5047| 
|5048|5048| UnitAI.prototype.SetFormationController = function(ent)
|5049|5049| {
|    | [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
|5199|5199| 	{
|5200|5200| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5201|5201| 			return;
|5202|    |-		else
|5203|    |-			this.RemoveGuard();
|    |5202|+		this.RemoveGuard();
|5204|5203| 	}
|5205|5204| 
|5206|5205| 	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
|5530|5530| 
|5531|5531| 	if (this.IsFormationController())
|5532|5532| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5533|    |-}
|    |5533|+};
|5534|5534| /**
|5535|5535|  * Adds trade order to the queue. Either walk to the first market, or
|5536|5536|  * 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
|5551|5551| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5552|5552| 	{
|5553|5553| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5554|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5554|+		if (cmpTrader.HasBothMarkets() &&
|5555|5555| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5556|5556| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5557|5557| 		{
|    | [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
|5832|5832| 				{
|5833|5833| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5834|5834| 					var targetClasses = this.order.data.targetClasses;
|5835|    |-					if (targetClasses.attack && cmpIdentity
|5836|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5835|+					if (targetClasses.attack && cmpIdentity &&
|    |5836|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5837|5837| 						continue;
|5838|5838| 					if (targetClasses.avoid && cmpIdentity
|5839|5839| 						&& 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
|5835|5835| 					if (targetClasses.attack && cmpIdentity
|5836|5836| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5837|5837| 						continue;
|5838|    |-					if (targetClasses.avoid && cmpIdentity
|5839|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5838|+					if (targetClasses.avoid && cmpIdentity &&
|    |5839|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5840|5840| 						continue;
|5841|5841| 					// Only used by the AIs to prevent some choices of targets
|5842|5842| 					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
|5858|5858| 		{
|5859|5859| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5860|5860| 			var targetClasses = this.order.data.targetClasses;
|5861|    |-			if (cmpIdentity && targetClasses.attack
|5862|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5861|+			if (cmpIdentity && targetClasses.attack &&
|    |5862|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5863|5863| 				continue;
|5864|5864| 			if (cmpIdentity && targetClasses.avoid
|5865|5865| 				&& 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
|5861|5861| 			if (cmpIdentity && targetClasses.attack
|5862|5862| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5863|5863| 				continue;
|5864|    |-			if (cmpIdentity && targetClasses.avoid
|5865|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5864|+			if (cmpIdentity && targetClasses.avoid &&
|    |5865|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5866|5866| 				continue;
|5867|5867| 			// Only used by the AIs to prevent some choices of targets
|5868|5868| 			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
|6004|6004| 
|6005|6005| UnitAI.prototype.SetHeldPosition = function(x, z)
|6006|6006| {
|6007|    |-	this.heldPosition = {"x": x, "z": z};
|    |6007|+	this.heldPosition = { "x": x, "z": z};
|6008|6008| };
|6009|6009| 
|6010|6010| 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
|6004|6004| 
|6005|6005| UnitAI.prototype.SetHeldPosition = function(x, z)
|6006|6006| {
|6007|    |-	this.heldPosition = {"x": x, "z": z};
|    |6007|+	this.heldPosition = {"x": x, "z": z };
|6008|6008| };
|6009|6009| 
|6010|6010| 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
|6031|6031| 	return false;
|6032|6032| };
|6033|6033| 
|6034|    |-//// Helper functions ////
|    |6034|+// // Helper functions ////
|6035|6035| 
|6036|6036| /**
|6037|6037|  * 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
|6050|6050| 		return undefined;
|6051|6051| 
|6052|6052| 	return component.GetRange(type);
|6053|    |-}
|    |6053|+};
|6054|6054| 
|6055|6055| UnitAI.prototype.CanAttack = function(target)
|6056|6056| {
|    | [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
|6248|6248| 	return cmpPack && cmpPack.IsPacking();
|6249|6249| };
|6250|6250| 
|6251|    |-//// Formation specific functions ////
|    |6251|+// // Formation specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.IsAttackingAsFormation = function()
|6254|6254| {
|    | [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
|6256|6256| 	if (!cmpAttack || !cmpAttack.CanAttackAsFormation())
|6257|6257| 		return false;
|6258|6258| 	let state = this.GetCurrentState();
|6259|    |-	return state == "FORMATIONCONTROLLER.COMBAT.ATTACKING" || 
|    |6259|+	return state == "FORMATIONCONTROLLER.COMBAT.ATTACKING" ||
|6260|6260| 		state == "FORMATIONCONTROLLER.COMBAT.APPROACHING";
|6261|6261| };
|6262|6262| 
|    | [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
|6260|6260| 		state == "FORMATIONCONTROLLER.COMBAT.APPROACHING";
|6261|6261| };
|6262|6262| 
|6263|    |-//// Animal specific functions ////
|    |6263|+// // Animal specific functions ////
|6264|6264| 
|6265|6265| UnitAI.prototype.MoveRandomly = function(distance)
|6266|6266| {

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
|1258| »   »   »   »   return·false;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Timer' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|4017| »   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
|4910| »   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
|4925| »   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
|4971| »   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
|4994| »   »   ····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
|2057| »   »   »   »   »   »   &&·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
|3155| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5862| »   »   »   »   &&·!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
|5865| »   »   »   »   &&·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
|6053| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
Executing section cli...

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

Silier added a reviewer: Restricted Owners Package.May 1 2020, 12:55 PM
Silier added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
453

i could merge that

4682

I guess it needs better name

Silier planned changes to this revision.May 3 2020, 10:46 AM

1 major issue
infinite loop of picking still the same target when going idle while formation is attacking since member cannot reach the target

another problems causing attacking as formation being broken even if above one is solved somehow:
get closest member of formation is not working with filter
clearance for formations is too big, it was set to big because siege engines do have large passability to find path for them as well but that makes formations only with units with default passability to get stuck in situations they could find a path but they wont because too large clearance
picking of range when attacking as formation is true makes formation to move in the way, only few of them are actually in range
large clearance of formation does not move formations with lower depth close enough to the target
members still destroy formation shape when are idle so this is working only and only if formation is tasked by player to attack something and after target is dead and target was not or was not part of formation, members brake formation again

Probably requires D2702 and D2763 to even think of working properly.

Stan added a subscriber: Stan.Jul 14 2021, 4:57 PM
Stan added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
453

Can you still?

Silier added inline comments.Jul 14 2021, 4:59 PM
binaries/data/mods/public/simulation/components/UnitAI.js
453

Probably not

Silier abandoned this revision.Apr 20 2023, 4:49 PM