Page MenuHomeWildfire Games

[WIP] - Support for mining.
Needs ReviewPublic

Authored by Freagarach on Oct 13 2019, 10:38 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This allows units to gather whilst (visibly) garrisoned.

Test Plan

Verify that:

  • Normal gathering still works as usual.
  • When an entity is full it ungarrisons and returns resources (and walks back).
  • When the mine is empty the entities search for the next target.

Event Timeline

Freagarach created this revision.Oct 13 2019, 10:38 PM
Freagarach created this object with visibility "No One".
Freagarach updated this revision to Diff 10149.Oct 14 2019, 8:46 AM
Freagarach changed the visibility from "No One" to "Public (No Login Required)".

Test has to be fixed yet.

Stan awarded a token.Oct 14 2019, 8:51 AM

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

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

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

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

Angen awarded a token.Oct 14 2019, 2:07 PM
Freagarach updated this revision to Diff 10150.Oct 14 2019, 5:17 PM
Freagarach retitled this revision from Support for mining. to [WIP] - Support for mining..
  • Fixed test.
  • Some stuff which will be split into other diffs.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Player.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Player.js
| 333| 333| 	return IsOwnedByHelper(player, target, "IsMutualAlly");
| 334| 334| }
| 335| 335| 
| 336|    |-function IsOwnedByNeutralOfPlayer(player,target)
|    | 336|+function IsOwnedByNeutralOfPlayer(player, target)
| 337| 337| {
| 338| 338| 	return IsOwnedByHelper(player, target, "IsNeutral");
| 339| 339| }

binaries/data/mods/public/simulation/helpers/Player.js
|  78| »   »   let·cmpPlayer·=·QueryPlayerIDInterface(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpPlayer' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Player.js
| 155| »   »   for·(let·i·=·0;·i·<·numPlayers;·++i)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Player.js
|  67| »   »   var·entID·=·cmpPlayerManager.GetPlayerByID(i);
|    | [NORMAL] JSHintBear:
|    | 'entID' is already defined.

binaries/data/mods/public/simulation/helpers/Player.js
|  76| »   for·(var·i·=·0;·i·<·numPlayers;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/helpers/Player.js
| 133| »   »   »   for·(var·j·=·0;·j·<·numPlayers;·++j)
|    | [NORMAL] JSHintBear:
|    | 'j' is already defined.
|    | [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
| 762| 762| 					this.FinishOrder();
| 763| 763| 					return;
| 764| 764| 				}
| 765|    |-				else
| 766|    |-				{
|    | 765|+				
| 767| 766| 					this.SetNextState("GARRISON.APPROACHING");
| 768| 767| 					return;
| 769|    |-				}
|    | 768|+				
| 770| 769| 			}
| 771| 770| 
| 772| 771| 			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
|1030|1030| 			},
|1031|1031| 		},
|1032|1032| 
|1033|    |-		"GARRISON":{
|    |1033|+		"GARRISON": {
|1034|1034| 			"enter": function() {
|1035|1035| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1036|1036| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [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
|1979|1979| 
|1980|1980| 				"Attacked": function(msg) {
|1981|1981| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1982|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1983|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1982|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1983|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1984|1984| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1985|1985| 				},
|1986|1986| 			},
|    | [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
|2739|2739| 					{
|2740|2740| 						// The building was already finished/fully repaired before we arrived;
|2741|2741| 						// let the ConstructionFinished handler handle this.
|2742|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2742|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2743|2743| 						return true;
|2744|2744| 					}
|2745|2745| 
|    | [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
|2739|2739| 					{
|2740|2740| 						// The building was already finished/fully repaired before we arrived;
|2741|2741| 						// let the ConstructionFinished handler handle this.
|2742|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2742|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2743|2743| 						return true;
|2744|2744| 					}
|2745|2745| 
|    | [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
|2984|2984| 									delete this.pickup;
|2985|2985| 								}
|2986|2986| 
|2987|    |-								//if (this.IsTurret())
|    |2987|+								// if (this.IsTurret())
|2988|2988| 								//{
|2989|2989| 									this.FinishOrder();
|2990|2990| 									return true;
|    | [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
|2985|2985| 								}
|2986|2986| 
|2987|2987| 								//if (this.IsTurret())
|2988|    |-								//{
|    |2988|+								// {
|2989|2989| 									this.FinishOrder();
|2990|2990| 									return true;
|2991|2991| 								//}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 9.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2986|2986| 
|2987|2987| 								//if (this.IsTurret())
|2988|2988| 								//{
|2989|    |-									this.FinishOrder();
|    |2989|+								this.FinishOrder();
|2990|2990| 									return true;
|2991|2991| 								//}
|2992|2992| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 9.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2987|2987| 								//if (this.IsTurret())
|2988|2988| 								//{
|2989|2989| 									this.FinishOrder();
|2990|    |-									return true;
|    |2990|+								return true;
|2991|2991| 								//}
|2992|2992| 
|2993|2993| 								//return false;
|    | [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
|2988|2988| 								//{
|2989|2989| 									this.FinishOrder();
|2990|2990| 									return true;
|2991|    |-								//}
|    |2991|+								// }
|2992|2992| 
|2993|2993| 								//return false;
|2994|2994| 							}
|    | [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
|2990|2990| 									return true;
|2991|2991| 								//}
|2992|2992| 
|2993|    |-								//return false;
|    |2993|+								// return false;
|2994|2994| 							}
|2995|2995| 						}
|2996|2996| 						else
|    | [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
|3252|3252| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3253|3253| 
|3254|3254| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3255|    |-							// only used for domestic animals
|    |3255|+		// only used for domestic animals
|3256|3256| 	},
|3257|3257| };
|3258|3258| 
|    | [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
|3309|3309| 
|3310|3310| UnitAI.prototype.IsAnimal = function()
|3311|3311| {
|3312|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3312|+	return (!!this.template.NaturalBehaviour);
|3313|3313| };
|3314|3314| 
|3315|3315| 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
|3425|3425| 		{
|3426|3426| 			let index = this.GetCurrentState().indexOf(".");
|3427|3427| 			if (index != -1)
|3428|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3428|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3429|3429| 			this.Stop(false);
|3430|3430| 		}
|3431|3431| 
|    | [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
|3481|3481| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3482|3482| 			continue;
|3483|3483| 		if (i == 0)
|3484|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3484|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3485|3485| 		else
|3486|3486| 			this.orderQueue.splice(i, 1);
|3487|3487| 		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
|3481|3481| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3482|3482| 			continue;
|3483|3483| 		if (i == 0)
|3484|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3484|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3485|3485| 		else
|3486|3486| 			this.orderQueue.splice(i, 1);
|3487|3487| 		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
|3565|3565| };
|3566|3566| 
|3567|3567| 
|3568|    |-//// FSM linkage functions ////
|    |3568|+// // FSM linkage functions ////
|3569|3569| 
|3570|3570| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3571|3571| 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
|3735|3735| 				continue;
|3736|3736| 			if (this.orderQueue[i].type == type)
|3737|3737| 				continue;
|3738|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3738|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3739|3739| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3740|3740| 			return;
|3741|3741| 		}
|    | [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
|3735|3735| 				continue;
|3736|3736| 			if (this.orderQueue[i].type == type)
|3737|3737| 				continue;
|3738|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3738|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3739|3739| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3740|3740| 			return;
|3741|3741| 		}
|    | [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
|3906|3906| 	if (data.timerRepeat === undefined)
|3907|3907| 		this.timer = undefined;
|3908|3908| 
|3909|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3909|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3910|3910| };
|3911|3911| 
|3912|3912| /**
|    | [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
|3906|3906| 	if (data.timerRepeat === undefined)
|3907|3907| 		this.timer = undefined;
|3908|3908| 
|3909|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3909|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3910|3910| };
|3911|3911| 
|3912|3912| /**
|    | [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
|3951|3951| 	// TODO: This is a bit inefficient since every unit listens to every
|3952|3952| 	// construction message - ideally we could scope it to only the one we're building
|3953|3953| 
|3954|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3954|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3955|3955| };
|3956|3956| 
|3957|3957| 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
|3951|3951| 	// TODO: This is a bit inefficient since every unit listens to every
|3952|3952| 	// construction message - ideally we could scope it to only the one we're building
|3953|3953| 
|3954|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3954|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3955|3955| };
|3956|3956| 
|3957|3957| 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
|3976|3976| 
|3977|3977| UnitAI.prototype.OnAttacked = function(msg)
|3978|3978| {
|3979|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3979|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3980|3980| };
|3981|3981| 
|3982|3982| 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
|3976|3976| 
|3977|3977| UnitAI.prototype.OnAttacked = function(msg)
|3978|3978| {
|3979|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3979|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3980|3980| };
|3981|3981| 
|3982|3982| 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
|3981|3981| 
|3982|3982| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3983|3983| {
|3984|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3984|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3985|3985| };
|3986|3986| 
|3987|3987| 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
|3981|3981| 
|3982|3982| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3983|3983| {
|3984|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3984|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3985|3985| };
|3986|3986| 
|3987|3987| 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
|3986|3986| 
|3987|3987| UnitAI.prototype.OnHealthChanged = function(msg)
|3988|3988| {
|3989|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3989|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3990|3990| };
|3991|3991| 
|3992|3992| 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
|3986|3986| 
|3987|3987| UnitAI.prototype.OnHealthChanged = function(msg)
|3988|3988| {
|3989|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3989|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3990|3990| };
|3991|3991| 
|3992|3992| 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
|3992|3992| UnitAI.prototype.OnRangeUpdate = function(msg)
|3993|3993| {
|3994|3994| 	if (msg.tag == this.losRangeQuery)
|3995|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3995|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3996|3996| 	else if (msg.tag == this.losHealRangeQuery)
|3997|3997| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3998|3998| };
|    | [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
|3992|3992| UnitAI.prototype.OnRangeUpdate = function(msg)
|3993|3993| {
|3994|3994| 	if (msg.tag == this.losRangeQuery)
|3995|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3995|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3996|3996| 	else if (msg.tag == this.losHealRangeQuery)
|3997|3997| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3998|3998| };
|    | [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
|3994|3994| 	if (msg.tag == this.losRangeQuery)
|3995|3995| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3996|3996| 	else if (msg.tag == this.losHealRangeQuery)
|3997|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3997|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3998|3998| };
|3999|3999| 
|4000|4000| 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
|3994|3994| 	if (msg.tag == this.losRangeQuery)
|3995|3995| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3996|3996| 	else if (msg.tag == this.losHealRangeQuery)
|3997|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3997|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3998|3998| };
|3999|3999| 
|4000|4000| 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
|3999|3999| 
|4000|4000| UnitAI.prototype.OnPackFinished = function(msg)
|4001|4001| {
|4002|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4002|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4003|4003| };
|4004|4004| 
|4005|4005| //// 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
|3999|3999| 
|4000|4000| UnitAI.prototype.OnPackFinished = function(msg)
|4001|4001| {
|4002|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4002|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4003|4003| };
|4004|4004| 
|4005|4005| //// 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
|4002|4002| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4003|4003| };
|4004|4004| 
|4005|    |-//// Helper functions to be called by the FSM ////
|    |4005|+// // Helper functions to be called by the FSM ////
|4006|4006| 
|4007|4007| UnitAI.prototype.GetWalkSpeed = function()
|4008|4008| {
|    | [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
|4671|4671| UnitAI.prototype.AttackEntityInZone = function(ents)
|4672|4672| {
|4673|4673| 	var target = ents.find(target =>
|4674|    |-		this.CanAttack(target)
|4675|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4674|+		this.CanAttack(target) &&
|    |4675|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4676|4676| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4677|4677| 	);
|4678|4678| 	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
|4672|4672| {
|4673|4673| 	var target = ents.find(target =>
|4674|4674| 		this.CanAttack(target)
|4675|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4676|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4675|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4676|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4677|4677| 	);
|4678|4678| 	if (!target)
|4679|4679| 		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
|4736|4736| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4737|4737| 	if (this.isGuardOf)
|4738|4738| 	{
|4739|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4739|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4740|4740| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4741|4741| 		if (cmpUnitAI && cmpAttack &&
|4742|4742| 		    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
|4740|4740| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4741|4741| 		if (cmpUnitAI && cmpAttack &&
|4742|4742| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4743|    |-				return false;
|    |4743|+			return false;
|4744|4744| 	}
|4745|4745| 
|4746|4746| 	// 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
|4778|4778| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4779|4779| 	if (this.isGuardOf)
|4780|4780| 	{
|4781|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4781|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4782|4782| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4783|4783| 		if (cmpUnitAI && cmpAttack &&
|4784|4784| 		    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
|4791|4791| 	return false;
|4792|4792| };
|4793|4793| 
|4794|    |-//// External interface functions ////
|    |4794|+// // External interface functions ////
|4795|4795| 
|4796|4796| UnitAI.prototype.SetFormationController = function(ent)
|4797|4797| {
|    | [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
|4947|4947| 	{
|4948|4948| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4949|4949| 			return;
|4950|    |-		else
|4951|    |-			this.RemoveGuard();
|    |4950|+		this.RemoveGuard();
|4952|4951| 	}
|4953|4952| 
|4954|4953| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5279|5279| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5280|5280| 	{
|5281|5281| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5282|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5282|+		if (cmpTrader.HasBothMarkets() &&
|5283|5283| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5284|5284| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5285|5285| 		{
|    | [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
|5560|5560| 				{
|5561|5561| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5562|5562| 					var targetClasses = this.order.data.targetClasses;
|5563|    |-					if (targetClasses.attack && cmpIdentity
|5564|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5563|+					if (targetClasses.attack && cmpIdentity &&
|    |5564|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5565|5565| 						continue;
|5566|5566| 					if (targetClasses.avoid && cmpIdentity
|5567|5567| 						&& 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
|5563|5563| 					if (targetClasses.attack && cmpIdentity
|5564|5564| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5565|5565| 						continue;
|5566|    |-					if (targetClasses.avoid && cmpIdentity
|5567|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5566|+					if (targetClasses.avoid && cmpIdentity &&
|    |5567|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5568|5568| 						continue;
|5569|5569| 					// Only used by the AIs to prevent some choices of targets
|5570|5570| 					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
|5586|5586| 		{
|5587|5587| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5588|5588| 			var targetClasses = this.order.data.targetClasses;
|5589|    |-			if (cmpIdentity && targetClasses.attack
|5590|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5589|+			if (cmpIdentity && targetClasses.attack &&
|    |5590|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5591|5591| 				continue;
|5592|5592| 			if (cmpIdentity && targetClasses.avoid
|5593|5593| 				&& 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
|5589|5589| 			if (cmpIdentity && targetClasses.attack
|5590|5590| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5591|5591| 				continue;
|5592|    |-			if (cmpIdentity && targetClasses.avoid
|5593|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5592|+			if (cmpIdentity && targetClasses.avoid &&
|    |5593|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5594|5594| 				continue;
|5595|5595| 			// Only used by the AIs to prevent some choices of targets
|5596|5596| 			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
|5746|5746| 
|5747|5747| UnitAI.prototype.SetHeldPosition = function(x, z)
|5748|5748| {
|5749|    |-	this.heldPosition = {"x": x, "z": z};
|    |5749|+	this.heldPosition = { "x": x, "z": z};
|5750|5750| };
|5751|5751| 
|5752|5752| 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
|5746|5746| 
|5747|5747| UnitAI.prototype.SetHeldPosition = function(x, z)
|5748|5748| {
|5749|    |-	this.heldPosition = {"x": x, "z": z};
|    |5749|+	this.heldPosition = {"x": x, "z": z };
|5750|5750| };
|5751|5751| 
|5752|5752| 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
|5773|5773| 	return false;
|5774|5774| };
|5775|5775| 
|5776|    |-//// Helper functions ////
|    |5776|+// // Helper functions ////
|5777|5777| 
|5778|5778| UnitAI.prototype.CanAttack = function(target)
|5779|5779| {
|    | [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
|5982|5982| 	return cmpPack && cmpPack.IsPacking();
|5983|5983| };
|5984|5984| 
|5985|    |-//// Formation specific functions ////
|    |5985|+// // Formation specific functions ////
|5986|5986| 
|5987|5987| UnitAI.prototype.IsAttackingAsFormation = function()
|5988|5988| {
|    | [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
|5987|5987| UnitAI.prototype.IsAttackingAsFormation = function()
|5988|5988| {
|5989|5989| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5990|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5991|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5990|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5991|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5992|5992| };
|5993|5993| 
|5994|5994| //// 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
|5991|5991| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5992|5992| };
|5993|5993| 
|5994|    |-//// Animal specific functions ////
|    |5994|+// // Animal specific functions ////
|5995|5995| 
|5996|5996| UnitAI.prototype.MoveRandomly = function(distance)
|5997|5997| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 917| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 942| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|1055| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1091| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1123| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1283| »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1340| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1515| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1537| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1569| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1723| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1773| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1851| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2028| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2144| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2328| »   »   »   »   »   »   »   »   this.order·?·this.order.data.target·=·INVALID_ENTITY·:·orderData.target·=·INVALID_ENTITY;
|    | [NORMAL] ESLintBear (no-unused-expressions):
|    | Expected an assignment or function call and instead saw an expression.

binaries/data/mods/public/simulation/components/UnitAI.js
|2451| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2484| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2590| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2656| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2695| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2906| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3087| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3811| »   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
|4658| »   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
|4673| »   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
|4719| »   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
|4742| »   »   ····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
|1983| »   »   »   »   »   »   &&·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
|2328| »   »   »   »   »   »   »   »   this.order·?·this.order.data.target·=·INVALID_ENTITY·:·orderData.target·=·INVALID_ENTITY;
|    | [NORMAL] JSHintBear:
|    | Expected an assignment or function call and instead saw an expression.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Stan added a comment.Oct 15 2019, 6:32 PM

I guess unit carrying resources or on a resource should obey orders and leave the wall or maybe a flag in the garrison holder that says unit are able to 'dismount' and should ignore orders

Freagarach edited the summary of this revision. (Show Details)Nov 7 2019, 7:25 PM
Stan added inline comments.Nov 8 2019, 10:01 AM
binaries/data/mods/public/simulation/components/ResourceSupply.js
53

Could be

return cmpGarrisonHolder && this.template.Mine && this.template.Mine == "true";
binaries/data/mods/public/simulation/components/UnitAI.js
2987

dead code ?