Page MenuHomeWildfire Games

Move the controllability of an entity to a component.
Needs ReviewPublic

Authored by Freagarach on Jun 8 2019, 7:11 PM.

Details

Reviewers
wraitii
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

This patch lets players be able to move any unit under their control around. Cf. this thread.
One can set "Controllable" to false for an entity in the new Controllability component to prevent this behaviour for that unit.

The check whether a unit can be controlled is moved higher up the command-chain, which seems more logical to me.
When the Control all units-cheat is on, an entity can still be controlled.

Also the check whether one can delete an entity is moved to this component.

Test Plan

Give oneself a non-domestic animal and watch how you can move it around.
Verify by playing games that normal behaviour is maintained.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

I like the change:

  • Good for modding
  • Allows triggers to order gaia around which is nice.

However:

  • I dislike relying on an Identity class. This should be a property of UnitAI.
  • I don't really like the message that pops.
  • The GUI should be made aware of that so it doesn't look like they can be ordered.
This revision now requires changes to proceed.Sep 1 2019, 4:57 PM

Also while at it, add a setter/getter so that triggers can mark some entities as uncontrollable at runtime (could be useful for scenarios).

Freagarach updated this revision to Diff 9593.Sep 1 2019, 7:37 PM
Freagarach edited the summary of this revision. (Show Details)
Freagarach edited the test plan for this revision. (Show Details)
  • cmpIdentity -> cmpUnitAI.

ToDo:

  • "Make a unit look uncontrollable."
Vulcan added a comment.Sep 1 2019, 7:41 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 537| 537| 			if (cmpGarrisonHolder)
| 538| 538| 			{
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541|    |-				    && player != +cmd.owner)
|    | 540|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 541|+				    player != +cmd.owner)
| 542| 542| 						continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540| 540| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541| 541| 				    && player != +cmd.owner)
| 542|    |-						continue;
|    | 542|+					continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 545| 545| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1266|1266| 		}
|1267|1267| 
|1268|1268| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1269|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1269|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1270|1270| 	}
|1271|1271| 
|1272|1272| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1330|1330| 
|1331|1331| 				if (i > 0)
|1332|1332| 				{
|1333|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1333|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1334|1334| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1335|1335| 					// TODO: ensure that cmpPreviousObstruction exists
|1336|1336| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1493|1493| 		// Check that all its members are selected
|1494|1494| 		var fid = formationIds[0];
|1495|1495| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1496|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1497|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1496|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1497|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1498|1498| 		{
|1499|1499| 			cmpFormation.DeleteTwinFormations();
|1500|1500| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1601|1601| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1602|1602| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1603|1603| 				if (matrix[i][j] < distSq)
|1604|    |-					closeClusters = [i,j];
|    |1604|+					closeClusters = [i, j];
|1605|1605| 
|1606|1606| 		// if no more close clusters found, just return all found clusters so far
|1607|1607| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1623|1623| 		}
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|    |-		clusters.splice(closeClusters[0],1);
|    |1626|+		clusters.splice(closeClusters[0], 1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|    |-		clusters.splice(closeClusters[1],1);
|    |1627|+		clusters.splice(closeClusters[1], 1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|    |-		matrix.splice(closeClusters[0],1);
|    |1628|+		matrix.splice(closeClusters[0], 1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|    |-		matrix.splice(closeClusters[1],1);
|    |1629|+		matrix.splice(closeClusters[1], 1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|    |-				matrix[i].splice(closeClusters[0],1);
|    |1633|+				matrix[i].splice(closeClusters[0], 1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|1635| 				matrix[i].splice(closeClusters[1],1);
|1636|1636| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|1633| 				matrix[i].splice(closeClusters[0],1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|    |-				matrix[i].splice(closeClusters[1],1);
|    |1635|+				matrix[i].splice(closeClusters[1], 1);
|1636|1636| 		}
|1637|1637| 		// add a new row of distances to the matrix and the new cluster
|1638|1638| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 789| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1289| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1290| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1520| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1599| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 541| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 729| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 976| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1123| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1375| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1458| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1497| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1523| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1556| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' 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
| 758| 758| 					this.FinishOrder();
| 759| 759| 					return;
| 760| 760| 				}
| 761|    |-				else
| 762|    |-				{
|    | 761|+				
| 763| 762| 					this.SetNextState("GARRISON.APPROACHING");
| 764| 763| 					return;
| 765|    |-				}
|    | 764|+				
| 766| 765| 			}
| 767| 766| 
| 768| 767| 			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
|1026|1026| 			},
|1027|1027| 		},
|1028|1028| 
|1029|    |-		"GARRISON":{
|    |1029|+		"GARRISON": {
|1030|1030| 			"enter": function() {
|1031|1031| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1032|1032| 				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
|1975|1975| 
|1976|1976| 				"Attacked": function(msg) {
|1977|1977| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1978|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1979|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1978|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1979|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1980|1980| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1981|1981| 				},
|1982|1982| 			},
|    | [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
|2703|2703| 					{
|2704|2704| 						// The building was already finished/fully repaired before we arrived;
|2705|2705| 						// let the ConstructionFinished handler handle this.
|2706|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2706|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2707|2707| 						return true;
|2708|2708| 					}
|2709|2709| 
|    | [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
|2703|2703| 					{
|2704|2704| 						// The building was already finished/fully repaired before we arrived;
|2705|2705| 						// let the ConstructionFinished handler handle this.
|2706|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2706|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2707|2707| 						return true;
|2708|2708| 					}
|2709|2709| 
|    | [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
|3216|3216| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3217|3217| 
|3218|3218| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3219|    |-							// only used for domestic animals
|    |3219|+		// only used for domestic animals
|3220|3220| 	},
|3221|3221| };
|3222|3222| 
|    | [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
|3274|3274| 
|3275|3275| UnitAI.prototype.IsAnimal = function()
|3276|3276| {
|3277|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3277|+	return (!!this.template.NaturalBehaviour);
|3278|3278| };
|3279|3279| 
|3280|3280| 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
|3404|3404| 		{
|3405|3405| 			let index = this.GetCurrentState().indexOf(".");
|3406|3406| 			if (index != -1)
|3407|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3407|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3408|3408| 			this.Stop(false);
|3409|3409| 		}
|3410|3410| 
|    | [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
|3460|3460| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3461|3461| 			continue;
|3462|3462| 		if (i == 0)
|3463|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3463|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3464|3464| 		else
|3465|3465| 			this.orderQueue.splice(i, 1);
|3466|3466| 		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
|3460|3460| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3461|3461| 			continue;
|3462|3462| 		if (i == 0)
|3463|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3463|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3464|3464| 		else
|3465|3465| 			this.orderQueue.splice(i, 1);
|3466|3466| 		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
|3544|3544| };
|3545|3545| 
|3546|3546| 
|3547|    |-//// FSM linkage functions ////
|    |3547|+// // FSM linkage functions ////
|3548|3548| 
|3549|3549| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3550|3550| 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
|3714|3714| 				continue;
|3715|3715| 			if (this.orderQueue[i].type == type)
|3716|3716| 				continue;
|3717|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3717|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3718|3718| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3719|3719| 			return;
|3720|3720| 		}
|    | [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
|3714|3714| 				continue;
|3715|3715| 			if (this.orderQueue[i].type == type)
|3716|3716| 				continue;
|3717|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3717|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3718|3718| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3719|3719| 			return;
|3720|3720| 		}
|    | [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
|3885|3885| 	if (data.timerRepeat === undefined)
|3886|3886| 		this.timer = undefined;
|3887|3887| 
|3888|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3888|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3889|3889| };
|3890|3890| 
|3891|3891| /**
|    | [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
|3885|3885| 	if (data.timerRepeat === undefined)
|3886|3886| 		this.timer = undefined;
|3887|3887| 
|3888|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3888|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3889|3889| };
|3890|3890| 
|3891|3891| /**
|    | [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
|3930|3930| 	// TODO: This is a bit inefficient since every unit listens to every
|3931|3931| 	// construction message - ideally we could scope it to only the one we're building
|3932|3932| 
|3933|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3933|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3934|3934| };
|3935|3935| 
|3936|3936| 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
|3930|3930| 	// TODO: This is a bit inefficient since every unit listens to every
|3931|3931| 	// construction message - ideally we could scope it to only the one we're building
|3932|3932| 
|3933|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3933|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3934|3934| };
|3935|3935| 
|3936|3936| 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
|3955|3955| 
|3956|3956| UnitAI.prototype.OnAttacked = function(msg)
|3957|3957| {
|3958|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3958|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3959|3959| };
|3960|3960| 
|3961|3961| 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
|3955|3955| 
|3956|3956| UnitAI.prototype.OnAttacked = function(msg)
|3957|3957| {
|3958|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3958|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3959|3959| };
|3960|3960| 
|3961|3961| 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
|3960|3960| 
|3961|3961| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3962|3962| {
|3963|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3963|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3964|3964| };
|3965|3965| 
|3966|3966| 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
|3960|3960| 
|3961|3961| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3962|3962| {
|3963|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3963|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3964|3964| };
|3965|3965| 
|3966|3966| 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
|3965|3965| 
|3966|3966| UnitAI.prototype.OnHealthChanged = function(msg)
|3967|3967| {
|3968|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3968|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3969|3969| };
|3970|3970| 
|3971|3971| 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
|3965|3965| 
|3966|3966| UnitAI.prototype.OnHealthChanged = function(msg)
|3967|3967| {
|3968|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3968|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3969|3969| };
|3970|3970| 
|3971|3971| 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
|3971|3971| UnitAI.prototype.OnRangeUpdate = function(msg)
|3972|3972| {
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3974|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|3976| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|    | [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
|3971|3971| UnitAI.prototype.OnRangeUpdate = function(msg)
|3972|3972| {
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3974|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|3976| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|    | [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
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|3974| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3976|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|3978|3978| 
|3979|3979| 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
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|3974| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3976|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3977|3977| };
|3978|3978| 
|3979|3979| 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
|3978|3978| 
|3979|3979| UnitAI.prototype.OnPackFinished = function(msg)
|3980|3980| {
|3981|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3981|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3982|3982| };
|3983|3983| 
|3984|3984| //// 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
|3978|3978| 
|3979|3979| UnitAI.prototype.OnPackFinished = function(msg)
|3980|3980| {
|3981|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3981|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3982|3982| };
|3983|3983| 
|3984|3984| //// 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
|3981|3981| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3982|3982| };
|3983|3983| 
|3984|    |-//// Helper functions to be called by the FSM ////
|    |3984|+// // Helper functions to be called by the FSM ////
|3985|3985| 
|3986|3986| UnitAI.prototype.GetWalkSpeed = function()
|3987|3987| {
|    | [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
|4650|4650| UnitAI.prototype.AttackEntityInZone = function(ents)
|4651|4651| {
|4652|4652| 	var target = ents.find(target =>
|4653|    |-		this.CanAttack(target)
|4654|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4653|+		this.CanAttack(target) &&
|    |4654|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4655|4655| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4656|4656| 	);
|4657|4657| 	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
|4651|4651| {
|4652|4652| 	var target = ents.find(target =>
|4653|4653| 		this.CanAttack(target)
|4654|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4655|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4654|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4655|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4656|4656| 	);
|4657|4657| 	if (!target)
|4658|4658| 		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
|4715|4715| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4716|4716| 	if (this.isGuardOf)
|4717|4717| 	{
|4718|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4718|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4719|4719| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4720|4720| 		if (cmpUnitAI && cmpAttack &&
|4721|4721| 		    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
|4719|4719| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4720|4720| 		if (cmpUnitAI && cmpAttack &&
|4721|4721| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4722|    |-				return false;
|    |4722|+			return false;
|4723|4723| 	}
|4724|4724| 
|4725|4725| 	// 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
|4757|4757| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4758|4758| 	if (this.isGuardOf)
|4759|4759| 	{
|4760|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4760|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4761|4761| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4762|4762| 		if (cmpUnitAI && cmpAttack &&
|4763|4763| 		    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
|4770|4770| 	return false;
|4771|4771| };
|4772|4772| 
|4773|    |-//// External interface functions ////
|    |4773|+// // External interface functions ////
|4774|4774| 
|4775|4775| UnitAI.prototype.SetFormationController = function(ent)
|4776|4776| {
|    | [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
|4926|4926| 	{
|4927|4927| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4928|4928| 			return;
|4929|    |-		else
|4930|    |-			this.RemoveGuard();
|    |4929|+		this.RemoveGuard();
|4931|4930| 	}
|4932|4931| 
|4933|4932| 	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
|5258|5258| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5259|5259| 	{
|5260|5260| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5261|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5261|+		if (cmpTrader.HasBothMarkets() &&
|5262|5262| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5263|5263| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5264|5264| 		{
|    | [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
|5539|5539| 				{
|5540|5540| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5541|5541| 					var targetClasses = this.order.data.targetClasses;
|5542|    |-					if (targetClasses.attack && cmpIdentity
|5543|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5542|+					if (targetClasses.attack && cmpIdentity &&
|    |5543|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5544|5544| 						continue;
|5545|5545| 					if (targetClasses.avoid && cmpIdentity
|5546|5546| 						&& 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
|5542|5542| 					if (targetClasses.attack && cmpIdentity
|5543|5543| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5544|5544| 						continue;
|5545|    |-					if (targetClasses.avoid && cmpIdentity
|5546|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5545|+					if (targetClasses.avoid && cmpIdentity &&
|    |5546|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5547|5547| 						continue;
|5548|5548| 					// Only used by the AIs to prevent some choices of targets
|5549|5549| 					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
|5565|5565| 		{
|5566|5566| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5567|5567| 			var targetClasses = this.order.data.targetClasses;
|5568|    |-			if (cmpIdentity && targetClasses.attack
|5569|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5568|+			if (cmpIdentity && targetClasses.attack &&
|    |5569|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5570|5570| 				continue;
|5571|5571| 			if (cmpIdentity && targetClasses.avoid
|5572|5572| 				&& 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
|5568|5568| 			if (cmpIdentity && targetClasses.attack
|5569|5569| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5570|5570| 				continue;
|5571|    |-			if (cmpIdentity && targetClasses.avoid
|5572|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5571|+			if (cmpIdentity && targetClasses.avoid &&
|    |5572|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5573|5573| 				continue;
|5574|5574| 			// Only used by the AIs to prevent some choices of targets
|5575|5575| 			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
|5725|5725| 
|5726|5726| UnitAI.prototype.SetHeldPosition = function(x, z)
|5727|5727| {
|5728|    |-	this.heldPosition = {"x": x, "z": z};
|    |5728|+	this.heldPosition = { "x": x, "z": z};
|5729|5729| };
|5730|5730| 
|5731|5731| 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
|5725|5725| 
|5726|5726| UnitAI.prototype.SetHeldPosition = function(x, z)
|5727|5727| {
|5728|    |-	this.heldPosition = {"x": x, "z": z};
|    |5728|+	this.heldPosition = {"x": x, "z": z };
|5729|5729| };
|5730|5730| 
|5731|5731| 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
|5752|5752| 	return false;
|5753|5753| };
|5754|5754| 
|5755|    |-//// Helper functions ////
|    |5755|+// // Helper functions ////
|5756|5756| 
|5757|5757| UnitAI.prototype.CanAttack = function(target)
|5758|5758| {
|    | [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
|5956|5956| 	return cmpPack && cmpPack.IsPacking();
|5957|5957| };
|5958|5958| 
|5959|    |-//// Formation specific functions ////
|    |5959|+// // Formation specific functions ////
|5960|5960| 
|5961|5961| UnitAI.prototype.IsAttackingAsFormation = function()
|5962|5962| {
|    | [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
|5961|5961| UnitAI.prototype.IsAttackingAsFormation = function()
|5962|5962| {
|5963|5963| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5964|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5965|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5964|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5965|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5966|5966| };
|5967|5967| 
|5968|5968| //// 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
|5965|5965| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5966|5966| };
|5967|5967| 
|5968|    |-//// Animal specific functions ////
|    |5968|+// // Animal specific functions ////
|5969|5969| 
|5970|5970| UnitAI.prototype.MoveRandomly = function(distance)
|5971|5971| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 913| »   »   »   "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
| 938| »   »   »   "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
| 988| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1051| »   »   »   »   "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
|1087| »   »   »   "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
|1119| »   »   »   »   "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
|1279| »   »   "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
|1336| »   »   »   "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
|1511| »   »   »   "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
|1533| »   »   »   "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
|1565| »   »   »   "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
|1719| »   »   »   "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
|1769| »   »   »   »   "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
|1847| »   »   »   »   "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
|2024| »   »   »   »   "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
|2140| »   »   »   »   "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
|2415| »   »   »   »   "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
|2448| »   »   »   »   "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
|2554| »   »   »   »   "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
|2620| »   »   »   »   "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
|2659| »   »   »   »   "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
|2870| »   »   »   »   "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
|3051| »   »   »   »   "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
|3790| »   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
|4637| »   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
|4652| »   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
|4698| »   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
|4721| »   »   ····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
|1979| »   »   »   »   »   »   &&·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
|3752| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

Vulcan added a comment.Sep 1 2019, 8:20 PM

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

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

Freagarach updated this revision to Diff 9619.Sep 3 2019, 9:50 PM

"Make a unit look uncontrollable." by removing buttons when uncontrollable. The unit looks exactly like an enemy unit whilst selected now.

Owners added a subscriber: Restricted Owners Package.Sep 3 2019, 9:50 PM
Vulcan added a comment.Sep 3 2019, 9:52 PM

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

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

Vulcan added a comment.Sep 3 2019, 9:54 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 537| 537| 			if (cmpGarrisonHolder)
| 538| 538| 			{
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541|    |-				    && player != +cmd.owner)
|    | 540|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 541|+				    player != +cmd.owner)
| 542| 542| 						continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540| 540| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541| 541| 				    && player != +cmd.owner)
| 542|    |-						continue;
|    | 542|+					continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 545| 545| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1266|1266| 		}
|1267|1267| 
|1268|1268| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1269|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1269|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1270|1270| 	}
|1271|1271| 
|1272|1272| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1330|1330| 
|1331|1331| 				if (i > 0)
|1332|1332| 				{
|1333|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1333|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1334|1334| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1335|1335| 					// TODO: ensure that cmpPreviousObstruction exists
|1336|1336| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1493|1493| 		// Check that all its members are selected
|1494|1494| 		var fid = formationIds[0];
|1495|1495| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1496|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1497|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1496|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1497|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1498|1498| 		{
|1499|1499| 			cmpFormation.DeleteTwinFormations();
|1500|1500| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1601|1601| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1602|1602| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1603|1603| 				if (matrix[i][j] < distSq)
|1604|    |-					closeClusters = [i,j];
|    |1604|+					closeClusters = [i, j];
|1605|1605| 
|1606|1606| 		// if no more close clusters found, just return all found clusters so far
|1607|1607| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1623|1623| 		}
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|    |-		clusters.splice(closeClusters[0],1);
|    |1626|+		clusters.splice(closeClusters[0], 1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|    |-		clusters.splice(closeClusters[1],1);
|    |1627|+		clusters.splice(closeClusters[1], 1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|    |-		matrix.splice(closeClusters[0],1);
|    |1628|+		matrix.splice(closeClusters[0], 1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|    |-		matrix.splice(closeClusters[1],1);
|    |1629|+		matrix.splice(closeClusters[1], 1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|    |-				matrix[i].splice(closeClusters[0],1);
|    |1633|+				matrix[i].splice(closeClusters[0], 1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|1635| 				matrix[i].splice(closeClusters[1],1);
|1636|1636| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|1633| 				matrix[i].splice(closeClusters[0],1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|    |-				matrix[i].splice(closeClusters[1],1);
|    |1635|+				matrix[i].splice(closeClusters[1], 1);
|1636|1636| 		}
|1637|1637| 		// add a new row of distances to the matrix and the new cluster
|1638|1638| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 789| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1289| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1290| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1520| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1599| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 541| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 729| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 976| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1123| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1375| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1458| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1497| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1523| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1556| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 797| 797| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 798| 798| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 799| 799| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 800|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 800|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 801| 801| 	}
| 802| 802| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 803| 803| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1630|1630| 			{
|1631|1631| 				minDist2 = dist2;
|1632|1632| 				minDistEntitySnapData = {
|1633|    |-						"x": pos.x,
|    |1633|+					"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1631|1631| 				minDist2 = dist2;
|1632|1632| 				minDistEntitySnapData = {
|1633|1633| 						"x": pos.x,
|1634|    |-						"z": pos.z,
|    |1634|+					"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|1637|1637| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1632|1632| 				minDistEntitySnapData = {
|1633|1633| 						"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|    |-						"angle": cmpPosition.GetRotation().y,
|    |1635|+					"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|1637|1637| 				};
|1638|1638| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1633|1633| 						"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|    |-						"ent": ent
|    |1636|+					"ent": ent
|1637|1637| 				};
|1638|1638| 			}
|1639|1639| 		}
|    | [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
| 758| 758| 					this.FinishOrder();
| 759| 759| 					return;
| 760| 760| 				}
| 761|    |-				else
| 762|    |-				{
|    | 761|+				
| 763| 762| 					this.SetNextState("GARRISON.APPROACHING");
| 764| 763| 					return;
| 765|    |-				}
|    | 764|+				
| 766| 765| 			}
| 767| 766| 
| 768| 767| 			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
|1026|1026| 			},
|1027|1027| 		},
|1028|1028| 
|1029|    |-		"GARRISON":{
|    |1029|+		"GARRISON": {
|1030|1030| 			"enter": function() {
|1031|1031| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1032|1032| 				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
|1975|1975| 
|1976|1976| 				"Attacked": function(msg) {
|1977|1977| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1978|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1979|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1978|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1979|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1980|1980| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1981|1981| 				},
|1982|1982| 			},
|    | [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
|2703|2703| 					{
|2704|2704| 						// The building was already finished/fully repaired before we arrived;
|2705|2705| 						// let the ConstructionFinished handler handle this.
|2706|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2706|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2707|2707| 						return true;
|2708|2708| 					}
|2709|2709| 
|    | [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
|2703|2703| 					{
|2704|2704| 						// The building was already finished/fully repaired before we arrived;
|2705|2705| 						// let the ConstructionFinished handler handle this.
|2706|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2706|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2707|2707| 						return true;
|2708|2708| 					}
|2709|2709| 
|    | [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
|3216|3216| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3217|3217| 
|3218|3218| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3219|    |-							// only used for domestic animals
|    |3219|+		// only used for domestic animals
|3220|3220| 	},
|3221|3221| };
|3222|3222| 
|    | [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
|3274|3274| 
|3275|3275| UnitAI.prototype.IsAnimal = function()
|3276|3276| {
|3277|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3277|+	return (!!this.template.NaturalBehaviour);
|3278|3278| };
|3279|3279| 
|3280|3280| 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
|3404|3404| 		{
|3405|3405| 			let index = this.GetCurrentState().indexOf(".");
|3406|3406| 			if (index != -1)
|3407|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3407|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3408|3408| 			this.Stop(false);
|3409|3409| 		}
|3410|3410| 
|    | [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
|3460|3460| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3461|3461| 			continue;
|3462|3462| 		if (i == 0)
|3463|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3463|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3464|3464| 		else
|3465|3465| 			this.orderQueue.splice(i, 1);
|3466|3466| 		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
|3460|3460| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3461|3461| 			continue;
|3462|3462| 		if (i == 0)
|3463|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3463|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3464|3464| 		else
|3465|3465| 			this.orderQueue.splice(i, 1);
|3466|3466| 		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
|3544|3544| };
|3545|3545| 
|3546|3546| 
|3547|    |-//// FSM linkage functions ////
|    |3547|+// // FSM linkage functions ////
|3548|3548| 
|3549|3549| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3550|3550| 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
|3714|3714| 				continue;
|3715|3715| 			if (this.orderQueue[i].type == type)
|3716|3716| 				continue;
|3717|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3717|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3718|3718| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3719|3719| 			return;
|3720|3720| 		}
|    | [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
|3714|3714| 				continue;
|3715|3715| 			if (this.orderQueue[i].type == type)
|3716|3716| 				continue;
|3717|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3717|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3718|3718| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3719|3719| 			return;
|3720|3720| 		}
|    | [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
|3885|3885| 	if (data.timerRepeat === undefined)
|3886|3886| 		this.timer = undefined;
|3887|3887| 
|3888|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3888|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3889|3889| };
|3890|3890| 
|3891|3891| /**
|    | [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
|3885|3885| 	if (data.timerRepeat === undefined)
|3886|3886| 		this.timer = undefined;
|3887|3887| 
|3888|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3888|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3889|3889| };
|3890|3890| 
|3891|3891| /**
|    | [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
|3930|3930| 	// TODO: This is a bit inefficient since every unit listens to every
|3931|3931| 	// construction message - ideally we could scope it to only the one we're building
|3932|3932| 
|3933|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3933|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3934|3934| };
|3935|3935| 
|3936|3936| 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
|3930|3930| 	// TODO: This is a bit inefficient since every unit listens to every
|3931|3931| 	// construction message - ideally we could scope it to only the one we're building
|3932|3932| 
|3933|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3933|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3934|3934| };
|3935|3935| 
|3936|3936| 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
|3955|3955| 
|3956|3956| UnitAI.prototype.OnAttacked = function(msg)
|3957|3957| {
|3958|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3958|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3959|3959| };
|3960|3960| 
|3961|3961| 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
|3955|3955| 
|3956|3956| UnitAI.prototype.OnAttacked = function(msg)
|3957|3957| {
|3958|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3958|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3959|3959| };
|3960|3960| 
|3961|3961| 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
|3960|3960| 
|3961|3961| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3962|3962| {
|3963|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3963|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3964|3964| };
|3965|3965| 
|3966|3966| 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
|3960|3960| 
|3961|3961| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3962|3962| {
|3963|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3963|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3964|3964| };
|3965|3965| 
|3966|3966| 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
|3965|3965| 
|3966|3966| UnitAI.prototype.OnHealthChanged = function(msg)
|3967|3967| {
|3968|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3968|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3969|3969| };
|3970|3970| 
|3971|3971| 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
|3965|3965| 
|3966|3966| UnitAI.prototype.OnHealthChanged = function(msg)
|3967|3967| {
|3968|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3968|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3969|3969| };
|3970|3970| 
|3971|3971| 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
|3971|3971| UnitAI.prototype.OnRangeUpdate = function(msg)
|3972|3972| {
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3974|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|3976| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|    | [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
|3971|3971| UnitAI.prototype.OnRangeUpdate = function(msg)
|3972|3972| {
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3974|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|3976| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|    | [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
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|3974| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3976|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|3978|3978| 
|3979|3979| 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
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|3974| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3976|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3977|3977| };
|3978|3978| 
|3979|3979| 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
|3978|3978| 
|3979|3979| UnitAI.prototype.OnPackFinished = function(msg)
|3980|3980| {
|3981|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3981|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3982|3982| };
|3983|3983| 
|3984|3984| //// 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
|3978|3978| 
|3979|3979| UnitAI.prototype.OnPackFinished = function(msg)
|3980|3980| {
|3981|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3981|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3982|3982| };
|3983|3983| 
|3984|3984| //// 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
|3981|3981| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3982|3982| };
|3983|3983| 
|3984|    |-//// Helper functions to be called by the FSM ////
|    |3984|+// // Helper functions to be called by the FSM ////
|3985|3985| 
|3986|3986| UnitAI.prototype.GetWalkSpeed = function()
|3987|3987| {
|    | [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
|4650|4650| UnitAI.prototype.AttackEntityInZone = function(ents)
|4651|4651| {
|4652|4652| 	var target = ents.find(target =>
|4653|    |-		this.CanAttack(target)
|4654|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4653|+		this.CanAttack(target) &&
|    |4654|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4655|4655| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4656|4656| 	);
|4657|4657| 	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
|4651|4651| {
|4652|4652| 	var target = ents.find(target =>
|4653|4653| 		this.CanAttack(target)
|4654|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4655|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4654|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4655|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4656|4656| 	);
|4657|4657| 	if (!target)
|4658|4658| 		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
|4715|4715| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4716|4716| 	if (this.isGuardOf)
|4717|4717| 	{
|4718|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4718|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4719|4719| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4720|4720| 		if (cmpUnitAI && cmpAttack &&
|4721|4721| 		    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
|4719|4719| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4720|4720| 		if (cmpUnitAI && cmpAttack &&
|4721|4721| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4722|    |-				return false;
|    |4722|+			return false;
|4723|4723| 	}
|4724|4724| 
|4725|4725| 	// 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
|4757|4757| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4758|4758| 	if (this.isGuardOf)
|4759|4759| 	{
|4760|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4760|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4761|4761| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4762|4762| 		if (cmpUnitAI && cmpAttack &&
|4763|4763| 		    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
|4770|4770| 	return false;
|4771|4771| };
|4772|4772| 
|4773|    |-//// External interface functions ////
|    |4773|+// // External interface functions ////
|4774|4774| 
|4775|4775| UnitAI.prototype.SetFormationController = function(ent)
|4776|4776| {
|    | [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
|4926|4926| 	{
|4927|4927| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4928|4928| 			return;
|4929|    |-		else
|4930|    |-			this.RemoveGuard();
|    |4929|+		this.RemoveGuard();
|4931|4930| 	}
|4932|4931| 
|4933|4932| 	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
|5258|5258| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5259|5259| 	{
|5260|5260| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5261|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5261|+		if (cmpTrader.HasBothMarkets() &&
|5262|5262| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5263|5263| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5264|5264| 		{
|    | [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
|5539|5539| 				{
|5540|5540| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5541|5541| 					var targetClasses = this.order.data.targetClasses;
|5542|    |-					if (targetClasses.attack && cmpIdentity
|5543|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5542|+					if (targetClasses.attack && cmpIdentity &&
|    |5543|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5544|5544| 						continue;
|5545|5545| 					if (targetClasses.avoid && cmpIdentity
|5546|5546| 						&& 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
|5542|5542| 					if (targetClasses.attack && cmpIdentity
|5543|5543| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5544|5544| 						continue;
|5545|    |-					if (targetClasses.avoid && cmpIdentity
|5546|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5545|+					if (targetClasses.avoid && cmpIdentity &&
|    |5546|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5547|5547| 						continue;
|5548|5548| 					// Only used by the AIs to prevent some choices of targets
|5549|5549| 					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
|5565|5565| 		{
|5566|5566| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5567|5567| 			var targetClasses = this.order.data.targetClasses;
|5568|    |-			if (cmpIdentity && targetClasses.attack
|5569|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5568|+			if (cmpIdentity && targetClasses.attack &&
|    |5569|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5570|5570| 				continue;
|5571|5571| 			if (cmpIdentity && targetClasses.avoid
|5572|5572| 				&& 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
|5568|5568| 			if (cmpIdentity && targetClasses.attack
|5569|5569| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5570|5570| 				continue;
|5571|    |-			if (cmpIdentity && targetClasses.avoid
|5572|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5571|+			if (cmpIdentity && targetClasses.avoid &&
|    |5572|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5573|5573| 				continue;
|5574|5574| 			// Only used by the AIs to prevent some choices of targets
|5575|5575| 			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
|5725|5725| 
|5726|5726| UnitAI.prototype.SetHeldPosition = function(x, z)
|5727|5727| {
|5728|    |-	this.heldPosition = {"x": x, "z": z};
|    |5728|+	this.heldPosition = { "x": x, "z": z};
|5729|5729| };
|5730|5730| 
|5731|5731| 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
|5725|5725| 
|5726|5726| UnitAI.prototype.SetHeldPosition = function(x, z)
|5727|5727| {
|5728|    |-	this.heldPosition = {"x": x, "z": z};
|    |5728|+	this.heldPosition = {"x": x, "z": z };
|5729|5729| };
|5730|5730| 
|5731|5731| 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
|5752|5752| 	return false;
|5753|5753| };
|5754|5754| 
|5755|    |-//// Helper functions ////
|    |5755|+// // Helper functions ////
|5756|5756| 
|5757|5757| UnitAI.prototype.CanAttack = function(target)
|5758|5758| {
|    | [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
|5956|5956| 	return cmpPack && cmpPack.IsPacking();
|5957|5957| };
|5958|5958| 
|5959|    |-//// Formation specific functions ////
|    |5959|+// // Formation specific functions ////
|5960|5960| 
|5961|5961| UnitAI.prototype.IsAttackingAsFormation = function()
|5962|5962| {
|    | [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
|5961|5961| UnitAI.prototype.IsAttackingAsFormation = function()
|5962|5962| {
|5963|5963| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5964|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5965|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5964|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5965|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5966|5966| };
|5967|5967| 
|5968|5968| //// 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
|5965|5965| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5966|5966| };
|5967|5967| 
|5968|    |-//// Animal specific functions ////
|    |5968|+// // Animal specific functions ////
|5969|5969| 
|5970|5970| UnitAI.prototype.MoveRandomly = function(distance)
|5971|5971| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 913| »   »   »   "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
| 938| »   »   »   "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
| 988| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1051| »   »   »   »   "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
|1087| »   »   »   "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
|1119| »   »   »   »   "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
|1279| »   »   "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
|1336| »   »   »   "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
|1511| »   »   »   "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
|1533| »   »   »   "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
|1565| »   »   »   "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
|1719| »   »   »   "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
|1769| »   »   »   »   "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
|1847| »   »   »   »   "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
|2024| »   »   »   »   "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
|2140| »   »   »   »   "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
|2415| »   »   »   »   "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
|2448| »   »   »   »   "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
|2554| »   »   »   »   "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
|2620| »   »   »   »   "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
|2659| »   »   »   »   "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
|2870| »   »   »   »   "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
|3051| »   »   »   »   "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
|3790| »   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
|4637| »   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
|4652| »   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
|4698| »   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
|4721| »   »   ····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
|1979| »   »   »   »   »   »   &&·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
|3752| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

Stan added a subscriber: Stan.Sep 3 2019, 10:03 PM
Stan added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
27

It's consistent with the rest but it could be nice to make it a lone tag instead of a true false string

<controllable/>
binaries/data/mods/public/simulation/helpers/Commands.js
877

recieve → receive
I believe player is a number ?

1683

(cmpUnitAI ? !cmpUnitAI.IsUncontrollable() : true) → cmpUnitAI && !cmpUnitAI.IsUncontrollable() || !cmpUnitAI I guess whatever the value of cmpUnitAi doesn't change the outcome. Maybe it could be written differently ?

1685

What happens if someone selects all units on the wall ?

Freagarach added inline comments.Sep 3 2019, 10:17 PM
binaries/data/mods/public/simulation/components/UnitAI.js
27

But we want to be able to change it in simulation. (E.g. demoralised units.)

binaries/data/mods/public/simulation/helpers/Commands.js
877

O wow, 2x aye.

1685

If one orders many units which are not controllable, many messages are sent.

Stan added inline comments.Sep 4 2019, 8:05 AM
binaries/data/mods/public/simulation/components/UnitAI.js
27

Can't you delete the key in that case ?

Freagarach marked 2 inline comments as done.Sep 4 2019, 9:27 AM
Freagarach added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
27

It can be a lone tag (I like tags), but I remember that a boolean is preferred.

Stan added inline comments.Sep 4 2019, 10:09 AM
binaries/data/mods/public/simulation/components/UnitAI.js
27

IIRC @wraitii likes tags too.

Actually the boolean could be a tristate yes no not present ^^

Maybe it should be in coding conventions

wraitii added inline comments.Sep 4 2019, 10:20 AM
binaries/data/mods/public/simulation/components/UnitAI.js
27

Template structure and the actual variable state are de-correlated.

TBH I do like better the <controllable/> or <uncontrollable/> over the boolean, since it's much shorter. But to delete it one has to do <controllable disable=""/> which is a bit odd... So maybe we should go with boolean arguments all the time.

Freagarach updated this revision to Diff 9714.Sep 11 2019, 5:13 PM
Freagarach marked 6 inline comments as done.
  • recieve -> receive.
  • JSDOC.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 537| 537| 			if (cmpGarrisonHolder)
| 538| 538| 			{
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541|    |-				    && player != +cmd.owner)
|    | 540|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 541|+				    player != +cmd.owner)
| 542| 542| 						continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540| 540| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541| 541| 				    && player != +cmd.owner)
| 542|    |-						continue;
|    | 542|+					continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 545| 545| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1266|1266| 		}
|1267|1267| 
|1268|1268| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1269|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1269|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1270|1270| 	}
|1271|1271| 
|1272|1272| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1330|1330| 
|1331|1331| 				if (i > 0)
|1332|1332| 				{
|1333|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1333|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1334|1334| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1335|1335| 					// TODO: ensure that cmpPreviousObstruction exists
|1336|1336| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1493|1493| 		// Check that all its members are selected
|1494|1494| 		var fid = formationIds[0];
|1495|1495| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1496|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1497|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1496|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1497|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1498|1498| 		{
|1499|1499| 			cmpFormation.DeleteTwinFormations();
|1500|1500| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1601|1601| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1602|1602| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1603|1603| 				if (matrix[i][j] < distSq)
|1604|    |-					closeClusters = [i,j];
|    |1604|+					closeClusters = [i, j];
|1605|1605| 
|1606|1606| 		// if no more close clusters found, just return all found clusters so far
|1607|1607| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1623|1623| 		}
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|    |-		clusters.splice(closeClusters[0],1);
|    |1626|+		clusters.splice(closeClusters[0], 1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|    |-		clusters.splice(closeClusters[1],1);
|    |1627|+		clusters.splice(closeClusters[1], 1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|    |-		matrix.splice(closeClusters[0],1);
|    |1628|+		matrix.splice(closeClusters[0], 1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|    |-		matrix.splice(closeClusters[1],1);
|    |1629|+		matrix.splice(closeClusters[1], 1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|    |-				matrix[i].splice(closeClusters[0],1);
|    |1633|+				matrix[i].splice(closeClusters[0], 1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|1635| 				matrix[i].splice(closeClusters[1],1);
|1636|1636| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|1633| 				matrix[i].splice(closeClusters[0],1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|    |-				matrix[i].splice(closeClusters[1],1);
|    |1635|+				matrix[i].splice(closeClusters[1], 1);
|1636|1636| 		}
|1637|1637| 		// add a new row of distances to the matrix and the new cluster
|1638|1638| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 789| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1289| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1290| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1520| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1599| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 541| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 729| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 976| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1123| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1375| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1458| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1497| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1523| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1556| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 797| 797| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 798| 798| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 799| 799| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 800|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 800|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 801| 801| 	}
| 802| 802| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 803| 803| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1630|1630| 			{
|1631|1631| 				minDist2 = dist2;
|1632|1632| 				minDistEntitySnapData = {
|1633|    |-						"x": pos.x,
|    |1633|+					"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1631|1631| 				minDist2 = dist2;
|1632|1632| 				minDistEntitySnapData = {
|1633|1633| 						"x": pos.x,
|1634|    |-						"z": pos.z,
|    |1634|+					"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|1637|1637| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1632|1632| 				minDistEntitySnapData = {
|1633|1633| 						"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|    |-						"angle": cmpPosition.GetRotation().y,
|    |1635|+					"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|1637|1637| 				};
|1638|1638| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1633|1633| 						"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|    |-						"ent": ent
|    |1636|+					"ent": ent
|1637|1637| 				};
|1638|1638| 			}
|1639|1639| 		}
|    | [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
| 758| 758| 					this.FinishOrder();
| 759| 759| 					return;
| 760| 760| 				}
| 761|    |-				else
| 762|    |-				{
|    | 761|+				
| 763| 762| 					this.SetNextState("GARRISON.APPROACHING");
| 764| 763| 					return;
| 765|    |-				}
|    | 764|+				
| 766| 765| 			}
| 767| 766| 
| 768| 767| 			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
|1026|1026| 			},
|1027|1027| 		},
|1028|1028| 
|1029|    |-		"GARRISON":{
|    |1029|+		"GARRISON": {
|1030|1030| 			"enter": function() {
|1031|1031| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1032|1032| 				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
|1975|1975| 
|1976|1976| 				"Attacked": function(msg) {
|1977|1977| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1978|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1979|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1978|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1979|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1980|1980| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1981|1981| 				},
|1982|1982| 			},
|    | [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
|2703|2703| 					{
|2704|2704| 						// The building was already finished/fully repaired before we arrived;
|2705|2705| 						// let the ConstructionFinished handler handle this.
|2706|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2706|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2707|2707| 						return true;
|2708|2708| 					}
|2709|2709| 
|    | [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
|2703|2703| 					{
|2704|2704| 						// The building was already finished/fully repaired before we arrived;
|2705|2705| 						// let the ConstructionFinished handler handle this.
|2706|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2706|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2707|2707| 						return true;
|2708|2708| 					}
|2709|2709| 
|    | [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
|3216|3216| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3217|3217| 
|3218|3218| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3219|    |-							// only used for domestic animals
|    |3219|+		// only used for domestic animals
|3220|3220| 	},
|3221|3221| };
|3222|3222| 
|    | [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
|3274|3274| 
|3275|3275| UnitAI.prototype.IsAnimal = function()
|3276|3276| {
|3277|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3277|+	return (!!this.template.NaturalBehaviour);
|3278|3278| };
|3279|3279| 
|3280|3280| 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
|3404|3404| 		{
|3405|3405| 			let index = this.GetCurrentState().indexOf(".");
|3406|3406| 			if (index != -1)
|3407|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3407|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3408|3408| 			this.Stop(false);
|3409|3409| 		}
|3410|3410| 
|    | [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
|3460|3460| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3461|3461| 			continue;
|3462|3462| 		if (i == 0)
|3463|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3463|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3464|3464| 		else
|3465|3465| 			this.orderQueue.splice(i, 1);
|3466|3466| 		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
|3460|3460| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3461|3461| 			continue;
|3462|3462| 		if (i == 0)
|3463|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3463|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3464|3464| 		else
|3465|3465| 			this.orderQueue.splice(i, 1);
|3466|3466| 		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
|3544|3544| };
|3545|3545| 
|3546|3546| 
|3547|    |-//// FSM linkage functions ////
|    |3547|+// // FSM linkage functions ////
|3548|3548| 
|3549|3549| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3550|3550| 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
|3714|3714| 				continue;
|3715|3715| 			if (this.orderQueue[i].type == type)
|3716|3716| 				continue;
|3717|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3717|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3718|3718| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3719|3719| 			return;
|3720|3720| 		}
|    | [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
|3714|3714| 				continue;
|3715|3715| 			if (this.orderQueue[i].type == type)
|3716|3716| 				continue;
|3717|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3717|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3718|3718| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3719|3719| 			return;
|3720|3720| 		}
|    | [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
|3885|3885| 	if (data.timerRepeat === undefined)
|3886|3886| 		this.timer = undefined;
|3887|3887| 
|3888|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3888|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3889|3889| };
|3890|3890| 
|3891|3891| /**
|    | [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
|3885|3885| 	if (data.timerRepeat === undefined)
|3886|3886| 		this.timer = undefined;
|3887|3887| 
|3888|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3888|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3889|3889| };
|3890|3890| 
|3891|3891| /**
|    | [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
|3930|3930| 	// TODO: This is a bit inefficient since every unit listens to every
|3931|3931| 	// construction message - ideally we could scope it to only the one we're building
|3932|3932| 
|3933|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3933|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3934|3934| };
|3935|3935| 
|3936|3936| 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
|3930|3930| 	// TODO: This is a bit inefficient since every unit listens to every
|3931|3931| 	// construction message - ideally we could scope it to only the one we're building
|3932|3932| 
|3933|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3933|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3934|3934| };
|3935|3935| 
|3936|3936| 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
|3955|3955| 
|3956|3956| UnitAI.prototype.OnAttacked = function(msg)
|3957|3957| {
|3958|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3958|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3959|3959| };
|3960|3960| 
|3961|3961| 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
|3955|3955| 
|3956|3956| UnitAI.prototype.OnAttacked = function(msg)
|3957|3957| {
|3958|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3958|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3959|3959| };
|3960|3960| 
|3961|3961| 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
|3960|3960| 
|3961|3961| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3962|3962| {
|3963|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3963|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3964|3964| };
|3965|3965| 
|3966|3966| 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
|3960|3960| 
|3961|3961| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3962|3962| {
|3963|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3963|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3964|3964| };
|3965|3965| 
|3966|3966| 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
|3965|3965| 
|3966|3966| UnitAI.prototype.OnHealthChanged = function(msg)
|3967|3967| {
|3968|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3968|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3969|3969| };
|3970|3970| 
|3971|3971| 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
|3965|3965| 
|3966|3966| UnitAI.prototype.OnHealthChanged = function(msg)
|3967|3967| {
|3968|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3968|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3969|3969| };
|3970|3970| 
|3971|3971| 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
|3971|3971| UnitAI.prototype.OnRangeUpdate = function(msg)
|3972|3972| {
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3974|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|3976| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|    | [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
|3971|3971| UnitAI.prototype.OnRangeUpdate = function(msg)
|3972|3972| {
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3974|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|3976| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|    | [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
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|3974| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3976|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3977|3977| };
|3978|3978| 
|3979|3979| 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
|3973|3973| 	if (msg.tag == this.losRangeQuery)
|3974|3974| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3975|3975| 	else if (msg.tag == this.losHealRangeQuery)
|3976|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3976|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3977|3977| };
|3978|3978| 
|3979|3979| 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
|3978|3978| 
|3979|3979| UnitAI.prototype.OnPackFinished = function(msg)
|3980|3980| {
|3981|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3981|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3982|3982| };
|3983|3983| 
|3984|3984| //// 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
|3978|3978| 
|3979|3979| UnitAI.prototype.OnPackFinished = function(msg)
|3980|3980| {
|3981|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3981|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3982|3982| };
|3983|3983| 
|3984|3984| //// 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
|3981|3981| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3982|3982| };
|3983|3983| 
|3984|    |-//// Helper functions to be called by the FSM ////
|    |3984|+// // Helper functions to be called by the FSM ////
|3985|3985| 
|3986|3986| UnitAI.prototype.GetWalkSpeed = function()
|3987|3987| {
|    | [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
|4650|4650| UnitAI.prototype.AttackEntityInZone = function(ents)
|4651|4651| {
|4652|4652| 	var target = ents.find(target =>
|4653|    |-		this.CanAttack(target)
|4654|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4653|+		this.CanAttack(target) &&
|    |4654|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4655|4655| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4656|4656| 	);
|4657|4657| 	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
|4651|4651| {
|4652|4652| 	var target = ents.find(target =>
|4653|4653| 		this.CanAttack(target)
|4654|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4655|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4654|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4655|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4656|4656| 	);
|4657|4657| 	if (!target)
|4658|4658| 		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
|4715|4715| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4716|4716| 	if (this.isGuardOf)
|4717|4717| 	{
|4718|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4718|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4719|4719| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4720|4720| 		if (cmpUnitAI && cmpAttack &&
|4721|4721| 		    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
|4719|4719| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4720|4720| 		if (cmpUnitAI && cmpAttack &&
|4721|4721| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4722|    |-				return false;
|    |4722|+			return false;
|4723|4723| 	}
|4724|4724| 
|4725|4725| 	// 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
|4757|4757| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4758|4758| 	if (this.isGuardOf)
|4759|4759| 	{
|4760|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4760|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4761|4761| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4762|4762| 		if (cmpUnitAI && cmpAttack &&
|4763|4763| 		    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
|4770|4770| 	return false;
|4771|4771| };
|4772|4772| 
|4773|    |-//// External interface functions ////
|    |4773|+// // External interface functions ////
|4774|4774| 
|4775|4775| UnitAI.prototype.SetFormationController = function(ent)
|4776|4776| {
|    | [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
|4926|4926| 	{
|4927|4927| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4928|4928| 			return;
|4929|    |-		else
|4930|    |-			this.RemoveGuard();
|    |4929|+		this.RemoveGuard();
|4931|4930| 	}
|4932|4931| 
|4933|4932| 	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
|5258|5258| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5259|5259| 	{
|5260|5260| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5261|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5261|+		if (cmpTrader.HasBothMarkets() &&
|5262|5262| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5263|5263| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5264|5264| 		{
|    | [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
|5539|5539| 				{
|5540|5540| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5541|5541| 					var targetClasses = this.order.data.targetClasses;
|5542|    |-					if (targetClasses.attack && cmpIdentity
|5543|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5542|+					if (targetClasses.attack && cmpIdentity &&
|    |5543|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5544|5544| 						continue;
|5545|5545| 					if (targetClasses.avoid && cmpIdentity
|5546|5546| 						&& 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
|5542|5542| 					if (targetClasses.attack && cmpIdentity
|5543|5543| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5544|5544| 						continue;
|5545|    |-					if (targetClasses.avoid && cmpIdentity
|5546|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5545|+					if (targetClasses.avoid && cmpIdentity &&
|    |5546|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5547|5547| 						continue;
|5548|5548| 					// Only used by the AIs to prevent some choices of targets
|5549|5549| 					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
|5565|5565| 		{
|5566|5566| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5567|5567| 			var targetClasses = this.order.data.targetClasses;
|5568|    |-			if (cmpIdentity && targetClasses.attack
|5569|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5568|+			if (cmpIdentity && targetClasses.attack &&
|    |5569|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5570|5570| 				continue;
|5571|5571| 			if (cmpIdentity && targetClasses.avoid
|5572|5572| 				&& 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
|5568|5568| 			if (cmpIdentity && targetClasses.attack
|5569|5569| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5570|5570| 				continue;
|5571|    |-			if (cmpIdentity && targetClasses.avoid
|5572|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5571|+			if (cmpIdentity && targetClasses.avoid &&
|    |5572|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5573|5573| 				continue;
|5574|5574| 			// Only used by the AIs to prevent some choices of targets
|5575|5575| 			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
|5725|5725| 
|5726|5726| UnitAI.prototype.SetHeldPosition = function(x, z)
|5727|5727| {
|5728|    |-	this.heldPosition = {"x": x, "z": z};
|    |5728|+	this.heldPosition = { "x": x, "z": z};
|5729|5729| };
|5730|5730| 
|5731|5731| 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
|5725|5725| 
|5726|5726| UnitAI.prototype.SetHeldPosition = function(x, z)
|5727|5727| {
|5728|    |-	this.heldPosition = {"x": x, "z": z};
|    |5728|+	this.heldPosition = {"x": x, "z": z };
|5729|5729| };
|5730|5730| 
|5731|5731| 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
|5752|5752| 	return false;
|5753|5753| };
|5754|5754| 
|5755|    |-//// Helper functions ////
|    |5755|+// // Helper functions ////
|5756|5756| 
|5757|5757| UnitAI.prototype.CanAttack = function(target)
|5758|5758| {
|    | [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
|5956|5956| 	return cmpPack && cmpPack.IsPacking();
|5957|5957| };
|5958|5958| 
|5959|    |-//// Formation specific functions ////
|    |5959|+// // Formation specific functions ////
|5960|5960| 
|5961|5961| UnitAI.prototype.IsAttackingAsFormation = function()
|5962|5962| {
|    | [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
|5961|5961| UnitAI.prototype.IsAttackingAsFormation = function()
|5962|5962| {
|5963|5963| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5964|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5965|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5964|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5965|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5966|5966| };
|5967|5967| 
|5968|5968| //// 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
|5965|5965| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5966|5966| };
|5967|5967| 
|5968|    |-//// Animal specific functions ////
|    |5968|+// // Animal specific functions ////
|5969|5969| 
|5970|5970| UnitAI.prototype.MoveRandomly = function(distance)
|5971|5971| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 913| »   »   »   "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
| 938| »   »   »   "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
| 988| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1051| »   »   »   »   "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
|1087| »   »   »   "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
|1119| »   »   »   »   "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
|1279| »   »   "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
|1336| »   »   »   "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
|1511| »   »   »   "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
|1533| »   »   »   "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
|1565| »   »   »   "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
|1719| »   »   »   "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
|1769| »   »   »   »   "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
|1847| »   »   »   »   "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
|2024| »   »   »   »   "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
|2140| »   »   »   »   "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
|2415| »   »   »   »   "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
|2448| »   »   »   »   "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
|2554| »   »   »   »   "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
|2620| »   »   »   »   "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
|2659| »   »   »   »   "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
|2870| »   »   »   »   "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
|3051| »   »   »   »   "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
|3790| »   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
|4637| »   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
|4652| »   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
|4698| »   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
|4721| »   »   ····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
|1979| »   »   »   »   »   »   &&·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
|3752| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

Stan added inline comments.Sep 11 2019, 5:54 PM
binaries/data/mods/public/simulation/components/UnitAI.js
249

move maybe ? else walk everywhere (No biggie)

binaries/data/mods/public/simulation/helpers/Commands.js
1685

Missing parenthesis ? (operator precedence)

Freagarach updated this revision to Diff 9734.Sep 13 2019, 9:16 AM
Freagarach marked 2 inline comments as done.
Freagarach edited the summary of this revision. (Show Details)
Freagarach edited the test plan for this revision. (Show Details)
  • Operator precedence.
  • Turrets can't move -> Turrets can't walk.

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

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

wraitii added inline comments.Sep 13 2019, 9:25 AM
binaries/data/mods/public/simulation/components/UnitAI.js
190

Even more accurately 'turrets can't be ordered to walk'

Freagarach updated this revision to Diff 9735.Sep 13 2019, 9:28 AM

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 797| 797| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 798| 798| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 799| 799| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 800|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 800|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 801| 801| 	}
| 802| 802| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 803| 803| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1630|1630| 			{
|1631|1631| 				minDist2 = dist2;
|1632|1632| 				minDistEntitySnapData = {
|1633|    |-						"x": pos.x,
|    |1633|+					"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1631|1631| 				minDist2 = dist2;
|1632|1632| 				minDistEntitySnapData = {
|1633|1633| 						"x": pos.x,
|1634|    |-						"z": pos.z,
|    |1634|+					"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|1637|1637| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1632|1632| 				minDistEntitySnapData = {
|1633|1633| 						"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|    |-						"angle": cmpPosition.GetRotation().y,
|    |1635|+					"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|1637|1637| 				};
|1638|1638| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1633|1633| 						"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|    |-						"ent": ent
|    |1636|+					"ent": ent
|1637|1637| 				};
|1638|1638| 			}
|1639|1639| 		}
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 537| 537| 			if (cmpGarrisonHolder)
| 538| 538| 			{
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541|    |-				    && player != +cmd.owner)
|    | 540|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 541|+				    player != +cmd.owner)
| 542| 542| 						continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540| 540| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541| 541| 				    && player != +cmd.owner)
| 542|    |-						continue;
|    | 542|+					continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 545| 545| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1266|1266| 		}
|1267|1267| 
|1268|1268| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1269|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1269|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1270|1270| 	}
|1271|1271| 
|1272|1272| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1330|1330| 
|1331|1331| 				if (i > 0)
|1332|1332| 				{
|1333|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1333|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1334|1334| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1335|1335| 					// TODO: ensure that cmpPreviousObstruction exists
|1336|1336| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1493|1493| 		// Check that all its members are selected
|1494|1494| 		var fid = formationIds[0];
|1495|1495| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1496|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1497|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1496|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1497|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1498|1498| 		{
|1499|1499| 			cmpFormation.DeleteTwinFormations();
|1500|1500| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1601|1601| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1602|1602| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1603|1603| 				if (matrix[i][j] < distSq)
|1604|    |-					closeClusters = [i,j];
|    |1604|+					closeClusters = [i, j];
|1605|1605| 
|1606|1606| 		// if no more close clusters found, just return all found clusters so far
|1607|1607| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1623|1623| 		}
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|    |-		clusters.splice(closeClusters[0],1);
|    |1626|+		clusters.splice(closeClusters[0], 1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|    |-		clusters.splice(closeClusters[1],1);
|    |1627|+		clusters.splice(closeClusters[1], 1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|    |-		matrix.splice(closeClusters[0],1);
|    |1628|+		matrix.splice(closeClusters[0], 1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|    |-		matrix.splice(closeClusters[1],1);
|    |1629|+		matrix.splice(closeClusters[1], 1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|    |-				matrix[i].splice(closeClusters[0],1);
|    |1633|+				matrix[i].splice(closeClusters[0], 1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|1635| 				matrix[i].splice(closeClusters[1],1);
|1636|1636| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|1633| 				matrix[i].splice(closeClusters[0],1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|    |-				matrix[i].splice(closeClusters[1],1);
|    |1635|+				matrix[i].splice(closeClusters[1], 1);
|1636|1636| 		}
|1637|1637| 		// add a new row of distances to the matrix and the new cluster
|1638|1638| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 789| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1289| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1290| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1520| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1599| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 541| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 729| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 976| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1123| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1375| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1458| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1497| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1523| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1556| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' 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
| 759| 759| 					this.FinishOrder();
| 760| 760| 					return;
| 761| 761| 				}
| 762|    |-				else
| 763|    |-				{
|    | 762|+				
| 764| 763| 					this.SetNextState("GARRISON.APPROACHING");
| 765| 764| 					return;
| 766|    |-				}
|    | 765|+				
| 767| 766| 			}
| 768| 767| 
| 769| 768| 			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
|1027|1027| 			},
|1028|1028| 		},
|1029|1029| 
|1030|    |-		"GARRISON":{
|    |1030|+		"GARRISON": {
|1031|1031| 			"enter": function() {
|1032|1032| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1033|1033| 				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
|1976|1976| 
|1977|1977| 				"Attacked": function(msg) {
|1978|1978| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1979|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1980|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1979|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1980|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1981|1981| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1982|1982| 				},
|1983|1983| 			},
|    | [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
|2704|2704| 					{
|2705|2705| 						// The building was already finished/fully repaired before we arrived;
|2706|2706| 						// let the ConstructionFinished handler handle this.
|2707|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2707|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2708|2708| 						return true;
|2709|2709| 					}
|2710|2710| 
|    | [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
|2704|2704| 					{
|2705|2705| 						// The building was already finished/fully repaired before we arrived;
|2706|2706| 						// let the ConstructionFinished handler handle this.
|2707|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2707|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2708|2708| 						return true;
|2709|2709| 					}
|2710|2710| 
|    | [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
|3217|3217| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3218|3218| 
|3219|3219| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3220|    |-							// only used for domestic animals
|    |3220|+		// only used for domestic animals
|3221|3221| 	},
|3222|3222| };
|3223|3223| 
|    | [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
|3275|3275| 
|3276|3276| UnitAI.prototype.IsAnimal = function()
|3277|3277| {
|3278|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3278|+	return (!!this.template.NaturalBehaviour);
|3279|3279| };
|3280|3280| 
|3281|3281| 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
|3405|3405| 		{
|3406|3406| 			let index = this.GetCurrentState().indexOf(".");
|3407|3407| 			if (index != -1)
|3408|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3408|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3409|3409| 			this.Stop(false);
|3410|3410| 		}
|3411|3411| 
|    | [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
|3461|3461| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3462|3462| 			continue;
|3463|3463| 		if (i == 0)
|3464|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3464|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3465|3465| 		else
|3466|3466| 			this.orderQueue.splice(i, 1);
|3467|3467| 		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
|3461|3461| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3462|3462| 			continue;
|3463|3463| 		if (i == 0)
|3464|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3464|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3465|3465| 		else
|3466|3466| 			this.orderQueue.splice(i, 1);
|3467|3467| 		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
|3545|3545| };
|3546|3546| 
|3547|3547| 
|3548|    |-//// FSM linkage functions ////
|    |3548|+// // FSM linkage functions ////
|3549|3549| 
|3550|3550| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3551|3551| 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
|3715|3715| 				continue;
|3716|3716| 			if (this.orderQueue[i].type == type)
|3717|3717| 				continue;
|3718|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3718|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3719|3719| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3720|3720| 			return;
|3721|3721| 		}
|    | [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
|3715|3715| 				continue;
|3716|3716| 			if (this.orderQueue[i].type == type)
|3717|3717| 				continue;
|3718|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3718|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3719|3719| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3720|3720| 			return;
|3721|3721| 		}
|    | [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
|3886|3886| 	if (data.timerRepeat === undefined)
|3887|3887| 		this.timer = undefined;
|3888|3888| 
|3889|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3889|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3890|3890| };
|3891|3891| 
|3892|3892| /**
|    | [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
|3886|3886| 	if (data.timerRepeat === undefined)
|3887|3887| 		this.timer = undefined;
|3888|3888| 
|3889|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3889|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3890|3890| };
|3891|3891| 
|3892|3892| /**
|    | [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
|3931|3931| 	// TODO: This is a bit inefficient since every unit listens to every
|3932|3932| 	// construction message - ideally we could scope it to only the one we're building
|3933|3933| 
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3931|3931| 	// TODO: This is a bit inefficient since every unit listens to every
|3932|3932| 	// construction message - ideally we could scope it to only the one we're building
|3933|3933| 
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3956|3956| 
|3957|3957| UnitAI.prototype.OnAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3959|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3960|3960| };
|3961|3961| 
|3962|3962| 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
|3956|3956| 
|3957|3957| UnitAI.prototype.OnAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3959|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3960|3960| };
|3961|3961| 
|3962|3962| 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
|3961|3961| 
|3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3964|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3965|3965| };
|3966|3966| 
|3967|3967| 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
|3961|3961| 
|3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3964|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3965|3965| };
|3966|3966| 
|3967|3967| 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
|3966|3966| 
|3967|3967| UnitAI.prototype.OnHealthChanged = function(msg)
|3968|3968| {
|3969|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3969|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3970|3970| };
|3971|3971| 
|3972|3972| 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
|3966|3966| 
|3967|3967| UnitAI.prototype.OnHealthChanged = function(msg)
|3968|3968| {
|3969|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3969|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3970|3970| };
|3971|3971| 
|3972|3972| 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
|3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg)
|3973|3973| {
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3975|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|    | [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
|3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg)
|3973|3973| {
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3975|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|    | [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
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|3975| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|3975| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnPackFinished = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3982|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3983|3983| };
|3984|3984| 
|3985|3985| //// 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnPackFinished = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3982|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3983|3983| };
|3984|3984| 
|3985|3985| //// 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
|3982|3982| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3983|3983| };
|3984|3984| 
|3985|    |-//// Helper functions to be called by the FSM ////
|    |3985|+// // Helper functions to be called by the FSM ////
|3986|3986| 
|3987|3987| UnitAI.prototype.GetWalkSpeed = function()
|3988|3988| {
|    | [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
|4651|4651| UnitAI.prototype.AttackEntityInZone = function(ents)
|4652|4652| {
|4653|4653| 	var target = ents.find(target =>
|4654|    |-		this.CanAttack(target)
|4655|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4654|+		this.CanAttack(target) &&
|    |4655|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4656|4656| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4657|4657| 	);
|4658|4658| 	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
|4652|4652| {
|4653|4653| 	var target = ents.find(target =>
|4654|4654| 		this.CanAttack(target)
|4655|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4656|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4655|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4656|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4657|4657| 	);
|4658|4658| 	if (!target)
|4659|4659| 		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
|4716|4716| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4717|4717| 	if (this.isGuardOf)
|4718|4718| 	{
|4719|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4719|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4720|4720| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4721|4721| 		if (cmpUnitAI && cmpAttack &&
|4722|4722| 		    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
|4720|4720| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4721|4721| 		if (cmpUnitAI && cmpAttack &&
|4722|4722| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4723|    |-				return false;
|    |4723|+			return false;
|4724|4724| 	}
|4725|4725| 
|4726|4726| 	// 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
|4758|4758| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4759|4759| 	if (this.isGuardOf)
|4760|4760| 	{
|4761|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4761|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4762|4762| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4763|4763| 		if (cmpUnitAI && cmpAttack &&
|4764|4764| 		    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
|4771|4771| 	return false;
|4772|4772| };
|4773|4773| 
|4774|    |-//// External interface functions ////
|    |4774|+// // External interface functions ////
|4775|4775| 
|4776|4776| UnitAI.prototype.SetFormationController = function(ent)
|4777|4777| {
|    | [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
|4927|4927| 	{
|4928|4928| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4929|4929| 			return;
|4930|    |-		else
|4931|    |-			this.RemoveGuard();
|    |4930|+		this.RemoveGuard();
|4932|4931| 	}
|4933|4932| 
|4934|4933| 	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
|5259|5259| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5260|5260| 	{
|5261|5261| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5262|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5262|+		if (cmpTrader.HasBothMarkets() &&
|5263|5263| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5264|5264| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5265|5265| 		{
|    | [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
|5540|5540| 				{
|5541|5541| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5542|5542| 					var targetClasses = this.order.data.targetClasses;
|5543|    |-					if (targetClasses.attack && cmpIdentity
|5544|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5543|+					if (targetClasses.attack && cmpIdentity &&
|    |5544|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5545|5545| 						continue;
|5546|5546| 					if (targetClasses.avoid && cmpIdentity
|5547|5547| 						&& 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
|5543|5543| 					if (targetClasses.attack && cmpIdentity
|5544|5544| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5545|5545| 						continue;
|5546|    |-					if (targetClasses.avoid && cmpIdentity
|5547|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5546|+					if (targetClasses.avoid && cmpIdentity &&
|    |5547|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5548|5548| 						continue;
|5549|5549| 					// Only used by the AIs to prevent some choices of targets
|5550|5550| 					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
|5566|5566| 		{
|5567|5567| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5568|5568| 			var targetClasses = this.order.data.targetClasses;
|5569|    |-			if (cmpIdentity && targetClasses.attack
|5570|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5569|+			if (cmpIdentity && targetClasses.attack &&
|    |5570|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5571|5571| 				continue;
|5572|5572| 			if (cmpIdentity && targetClasses.avoid
|5573|5573| 				&& 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
|5569|5569| 			if (cmpIdentity && targetClasses.attack
|5570|5570| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5571|5571| 				continue;
|5572|    |-			if (cmpIdentity && targetClasses.avoid
|5573|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5572|+			if (cmpIdentity && targetClasses.avoid &&
|    |5573|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5574|5574| 				continue;
|5575|5575| 			// Only used by the AIs to prevent some choices of targets
|5576|5576| 			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
|5726|5726| 
|5727|5727| UnitAI.prototype.SetHeldPosition = function(x, z)
|5728|5728| {
|5729|    |-	this.heldPosition = {"x": x, "z": z};
|    |5729|+	this.heldPosition = { "x": x, "z": z};
|5730|5730| };
|5731|5731| 
|5732|5732| 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
|5726|5726| 
|5727|5727| UnitAI.prototype.SetHeldPosition = function(x, z)
|5728|5728| {
|5729|    |-	this.heldPosition = {"x": x, "z": z};
|    |5729|+	this.heldPosition = {"x": x, "z": z };
|5730|5730| };
|5731|5731| 
|5732|5732| 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
|5753|5753| 	return false;
|5754|5754| };
|5755|5755| 
|5756|    |-//// Helper functions ////
|    |5756|+// // Helper functions ////
|5757|5757| 
|5758|5758| UnitAI.prototype.CanAttack = function(target)
|5759|5759| {
|    | [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
|5957|5957| 	return cmpPack && cmpPack.IsPacking();
|5958|5958| };
|5959|5959| 
|5960|    |-//// Formation specific functions ////
|    |5960|+// // Formation specific functions ////
|5961|5961| 
|5962|5962| UnitAI.prototype.IsAttackingAsFormation = function()
|5963|5963| {
|    | [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
|5962|5962| UnitAI.prototype.IsAttackingAsFormation = function()
|5963|5963| {
|5964|5964| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5965|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5966|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5965|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5966|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5967|5967| };
|5968|5968| 
|5969|5969| //// 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
|5966|5966| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5967|5967| };
|5968|5968| 
|5969|    |-//// Animal specific functions ////
|    |5969|+// // Animal specific functions ////
|5970|5970| 
|5971|5971| UnitAI.prototype.MoveRandomly = function(distance)
|5972|5972| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 914| »   »   »   "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
| 939| »   »   »   "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
| 989| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1052| »   »   »   »   "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
|1088| »   »   »   "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
|1120| »   »   »   »   "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
|1280| »   »   "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
|1337| »   »   »   "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
|1512| »   »   »   "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
|1534| »   »   »   "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
|1566| »   »   »   "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
|1720| »   »   »   "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
|1770| »   »   »   »   "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
|1848| »   »   »   »   "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
|2025| »   »   »   »   "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
|2141| »   »   »   »   "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
|2416| »   »   »   »   "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
|2449| »   »   »   »   "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
|2555| »   »   »   »   "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
|2621| »   »   »   »   "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
|2660| »   »   »   »   "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
|2871| »   »   »   »   "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
|3052| »   »   »   »   "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
|3791| »   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
|4638| »   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
|4653| »   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
|4699| »   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
|4722| »   »   ····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
|1980| »   »   »   »   »   »   &&·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
|3753| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 797| 797| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 798| 798| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 799| 799| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 800|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 800|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 801| 801| 	}
| 802| 802| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 803| 803| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1630|1630| 			{
|1631|1631| 				minDist2 = dist2;
|1632|1632| 				minDistEntitySnapData = {
|1633|    |-						"x": pos.x,
|    |1633|+					"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1631|1631| 				minDist2 = dist2;
|1632|1632| 				minDistEntitySnapData = {
|1633|1633| 						"x": pos.x,
|1634|    |-						"z": pos.z,
|    |1634|+					"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|1637|1637| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1632|1632| 				minDistEntitySnapData = {
|1633|1633| 						"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|    |-						"angle": cmpPosition.GetRotation().y,
|    |1635|+					"angle": cmpPosition.GetRotation().y,
|1636|1636| 						"ent": ent
|1637|1637| 				};
|1638|1638| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1633|1633| 						"x": pos.x,
|1634|1634| 						"z": pos.z,
|1635|1635| 						"angle": cmpPosition.GetRotation().y,
|1636|    |-						"ent": ent
|    |1636|+					"ent": ent
|1637|1637| 				};
|1638|1638| 			}
|1639|1639| 		}
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 537| 537| 			if (cmpGarrisonHolder)
| 538| 538| 			{
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541|    |-				    && player != +cmd.owner)
|    | 540|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 541|+				    player != +cmd.owner)
| 542| 542| 						continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540| 540| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541| 541| 				    && player != +cmd.owner)
| 542|    |-						continue;
|    | 542|+					continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 545| 545| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1158|1158| 
|1159|1159| 	// send Metadata info if any
|1160|1160| 	if (cmd.metadata)
|1161|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1161|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1162|1162| 
|1163|1163| 	// Tell the units to start building this new entity
|1164|1164| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1266|1266| 		}
|1267|1267| 
|1268|1268| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1269|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1269|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1270|1270| 	}
|1271|1271| 
|1272|1272| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1330|1330| 
|1331|1331| 				if (i > 0)
|1332|1332| 				{
|1333|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1333|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1334|1334| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1335|1335| 					// TODO: ensure that cmpPreviousObstruction exists
|1336|1336| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1493|1493| 		// Check that all its members are selected
|1494|1494| 		var fid = formationIds[0];
|1495|1495| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1496|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1497|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1496|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1497|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1498|1498| 		{
|1499|1499| 			cmpFormation.DeleteTwinFormations();
|1500|1500| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1601|1601| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1602|1602| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1603|1603| 				if (matrix[i][j] < distSq)
|1604|    |-					closeClusters = [i,j];
|    |1604|+					closeClusters = [i, j];
|1605|1605| 
|1606|1606| 		// if no more close clusters found, just return all found clusters so far
|1607|1607| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1623|1623| 		}
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|    |-		clusters.splice(closeClusters[0],1);
|    |1626|+		clusters.splice(closeClusters[0], 1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1624|1624| 		// remove the rows and columns in the matrix for the merged clusters,
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|    |-		clusters.splice(closeClusters[1],1);
|    |1627|+		clusters.splice(closeClusters[1], 1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1625|1625| 		// and the clusters themselves from the cluster list
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|    |-		matrix.splice(closeClusters[0],1);
|    |1628|+		matrix.splice(closeClusters[0], 1);
|1629|1629| 		matrix.splice(closeClusters[1],1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1626|1626| 		clusters.splice(closeClusters[0],1);
|1627|1627| 		clusters.splice(closeClusters[1],1);
|1628|1628| 		matrix.splice(closeClusters[0],1);
|1629|    |-		matrix.splice(closeClusters[1],1);
|    |1629|+		matrix.splice(closeClusters[1], 1);
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1630|1630| 		for (let i = 0; i < matrix.length; ++i)
|1631|1631| 		{
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|    |-				matrix[i].splice(closeClusters[0],1);
|    |1633|+				matrix[i].splice(closeClusters[0], 1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|1635| 				matrix[i].splice(closeClusters[1],1);
|1636|1636| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1632|1632| 			if (matrix[i].length > closeClusters[0])
|1633|1633| 				matrix[i].splice(closeClusters[0],1);
|1634|1634| 			if (matrix[i].length > closeClusters[1])
|1635|    |-				matrix[i].splice(closeClusters[1],1);
|    |1635|+				matrix[i].splice(closeClusters[1], 1);
|1636|1636| 		}
|1637|1637| 		// add a new row of distances to the matrix and the new cluster
|1638|1638| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 789| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1289| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1290| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1520| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1599| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 541| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 729| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 976| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1123| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1375| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1458| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1497| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1523| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1556| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' 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
| 759| 759| 					this.FinishOrder();
| 760| 760| 					return;
| 761| 761| 				}
| 762|    |-				else
| 763|    |-				{
|    | 762|+				
| 764| 763| 					this.SetNextState("GARRISON.APPROACHING");
| 765| 764| 					return;
| 766|    |-				}
|    | 765|+				
| 767| 766| 			}
| 768| 767| 
| 769| 768| 			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
|1027|1027| 			},
|1028|1028| 		},
|1029|1029| 
|1030|    |-		"GARRISON":{
|    |1030|+		"GARRISON": {
|1031|1031| 			"enter": function() {
|1032|1032| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1033|1033| 				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
|1976|1976| 
|1977|1977| 				"Attacked": function(msg) {
|1978|1978| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1979|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1980|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1979|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1980|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1981|1981| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1982|1982| 				},
|1983|1983| 			},
|    | [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
|2704|2704| 					{
|2705|2705| 						// The building was already finished/fully repaired before we arrived;
|2706|2706| 						// let the ConstructionFinished handler handle this.
|2707|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2707|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2708|2708| 						return true;
|2709|2709| 					}
|2710|2710| 
|    | [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
|2704|2704| 					{
|2705|2705| 						// The building was already finished/fully repaired before we arrived;
|2706|2706| 						// let the ConstructionFinished handler handle this.
|2707|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2707|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2708|2708| 						return true;
|2709|2709| 					}
|2710|2710| 
|    | [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
|3217|3217| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3218|3218| 
|3219|3219| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3220|    |-							// only used for domestic animals
|    |3220|+		// only used for domestic animals
|3221|3221| 	},
|3222|3222| };
|3223|3223| 
|    | [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
|3275|3275| 
|3276|3276| UnitAI.prototype.IsAnimal = function()
|3277|3277| {
|3278|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3278|+	return (!!this.template.NaturalBehaviour);
|3279|3279| };
|3280|3280| 
|3281|3281| 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
|3405|3405| 		{
|3406|3406| 			let index = this.GetCurrentState().indexOf(".");
|3407|3407| 			if (index != -1)
|3408|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3408|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3409|3409| 			this.Stop(false);
|3410|3410| 		}
|3411|3411| 
|    | [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
|3461|3461| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3462|3462| 			continue;
|3463|3463| 		if (i == 0)
|3464|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3464|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3465|3465| 		else
|3466|3466| 			this.orderQueue.splice(i, 1);
|3467|3467| 		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
|3461|3461| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3462|3462| 			continue;
|3463|3463| 		if (i == 0)
|3464|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3464|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3465|3465| 		else
|3466|3466| 			this.orderQueue.splice(i, 1);
|3467|3467| 		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
|3545|3545| };
|3546|3546| 
|3547|3547| 
|3548|    |-//// FSM linkage functions ////
|    |3548|+// // FSM linkage functions ////
|3549|3549| 
|3550|3550| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3551|3551| 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
|3715|3715| 				continue;
|3716|3716| 			if (this.orderQueue[i].type == type)
|3717|3717| 				continue;
|3718|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3718|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3719|3719| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3720|3720| 			return;
|3721|3721| 		}
|    | [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
|3715|3715| 				continue;
|3716|3716| 			if (this.orderQueue[i].type == type)
|3717|3717| 				continue;
|3718|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3718|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3719|3719| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3720|3720| 			return;
|3721|3721| 		}
|    | [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
|3886|3886| 	if (data.timerRepeat === undefined)
|3887|3887| 		this.timer = undefined;
|3888|3888| 
|3889|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3889|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3890|3890| };
|3891|3891| 
|3892|3892| /**
|    | [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
|3886|3886| 	if (data.timerRepeat === undefined)
|3887|3887| 		this.timer = undefined;
|3888|3888| 
|3889|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3889|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3890|3890| };
|3891|3891| 
|3892|3892| /**
|    | [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
|3931|3931| 	// TODO: This is a bit inefficient since every unit listens to every
|3932|3932| 	// construction message - ideally we could scope it to only the one we're building
|3933|3933| 
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3931|3931| 	// TODO: This is a bit inefficient since every unit listens to every
|3932|3932| 	// construction message - ideally we could scope it to only the one we're building
|3933|3933| 
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3956|3956| 
|3957|3957| UnitAI.prototype.OnAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3959|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3960|3960| };
|3961|3961| 
|3962|3962| 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
|3956|3956| 
|3957|3957| UnitAI.prototype.OnAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3959|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3960|3960| };
|3961|3961| 
|3962|3962| 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
|3961|3961| 
|3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3964|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3965|3965| };
|3966|3966| 
|3967|3967| 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
|3961|3961| 
|3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3964|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3965|3965| };
|3966|3966| 
|3967|3967| 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
|3966|3966| 
|3967|3967| UnitAI.prototype.OnHealthChanged = function(msg)
|3968|3968| {
|3969|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3969|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3970|3970| };
|3971|3971| 
|3972|3972| 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
|3966|3966| 
|3967|3967| UnitAI.prototype.OnHealthChanged = function(msg)
|3968|3968| {
|3969|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3969|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3970|3970| };
|3971|3971| 
|3972|3972| 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
|3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg)
|3973|3973| {
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3975|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|    | [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
|3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg)
|3973|3973| {
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3975|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|    | [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
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|3975| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|3975| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnPackFinished = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3982|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3983|3983| };
|3984|3984| 
|3985|3985| //// 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnPackFinished = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3982|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3983|3983| };
|3984|3984| 
|3985|3985| //// 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
|3982|3982| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3983|3983| };
|3984|3984| 
|3985|    |-//// Helper functions to be called by the FSM ////
|    |3985|+// // Helper functions to be called by the FSM ////
|3986|3986| 
|3987|3987| UnitAI.prototype.GetWalkSpeed = function()
|3988|3988| {
|    | [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
|4651|4651| UnitAI.prototype.AttackEntityInZone = function(ents)
|4652|4652| {
|4653|4653| 	var target = ents.find(target =>
|4654|    |-		this.CanAttack(target)
|4655|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4654|+		this.CanAttack(target) &&
|    |4655|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4656|4656| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4657|4657| 	);
|4658|4658| 	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
|4652|4652| {
|4653|4653| 	var target = ents.find(target =>
|4654|4654| 		this.CanAttack(target)
|4655|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4656|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4655|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4656|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4657|4657| 	);
|4658|4658| 	if (!target)
|4659|4659| 		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
|4716|4716| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4717|4717| 	if (this.isGuardOf)
|4718|4718| 	{
|4719|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4719|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4720|4720| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4721|4721| 		if (cmpUnitAI && cmpAttack &&
|4722|4722| 		    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
|4720|4720| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4721|4721| 		if (cmpUnitAI && cmpAttack &&
|4722|4722| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4723|    |-				return false;
|    |4723|+			return false;
|4724|4724| 	}
|4725|4725| 
|4726|4726| 	// 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
|4758|4758| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4759|4759| 	if (this.isGuardOf)
|4760|4760| 	{
|4761|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4761|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4762|4762| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4763|4763| 		if (cmpUnitAI && cmpAttack &&
|4764|4764| 		    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
|4771|4771| 	return false;
|4772|4772| };
|4773|4773| 
|4774|    |-//// External interface functions ////
|    |4774|+// // External interface functions ////
|4775|4775| 
|4776|4776| UnitAI.prototype.SetFormationController = function(ent)
|4777|4777| {
|    | [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
|4927|4927| 	{
|4928|4928| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4929|4929| 			return;
|4930|    |-		else
|4931|    |-			this.RemoveGuard();
|    |4930|+		this.RemoveGuard();
|4932|4931| 	}
|4933|4932| 
|4934|4933| 	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
|5259|5259| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5260|5260| 	{
|5261|5261| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5262|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5262|+		if (cmpTrader.HasBothMarkets() &&
|5263|5263| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5264|5264| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5265|5265| 		{
|    | [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
|5540|5540| 				{
|5541|5541| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5542|5542| 					var targetClasses = this.order.data.targetClasses;
|5543|    |-					if (targetClasses.attack && cmpIdentity
|5544|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5543|+					if (targetClasses.attack && cmpIdentity &&
|    |5544|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5545|5545| 						continue;
|5546|5546| 					if (targetClasses.avoid && cmpIdentity
|5547|5547| 						&& 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
|5543|5543| 					if (targetClasses.attack && cmpIdentity
|5544|5544| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5545|5545| 						continue;
|5546|    |-					if (targetClasses.avoid && cmpIdentity
|5547|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5546|+					if (targetClasses.avoid && cmpIdentity &&
|    |5547|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5548|5548| 						continue;
|5549|5549| 					// Only used by the AIs to prevent some choices of targets
|5550|5550| 					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
|5566|5566| 		{
|5567|5567| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5568|5568| 			var targetClasses = this.order.data.targetClasses;
|5569|    |-			if (cmpIdentity && targetClasses.attack
|5570|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5569|+			if (cmpIdentity && targetClasses.attack &&
|    |5570|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5571|5571| 				continue;
|5572|5572| 			if (cmpIdentity && targetClasses.avoid
|5573|5573| 				&& 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
|5569|5569| 			if (cmpIdentity && targetClasses.attack
|5570|5570| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5571|5571| 				continue;
|5572|    |-			if (cmpIdentity && targetClasses.avoid
|5573|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5572|+			if (cmpIdentity && targetClasses.avoid &&
|    |5573|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5574|5574| 				continue;
|5575|5575| 			// Only used by the AIs to prevent some choices of targets
|5576|5576| 			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
|5726|5726| 
|5727|5727| UnitAI.prototype.SetHeldPosition = function(x, z)
|5728|5728| {
|5729|    |-	this.heldPosition = {"x": x, "z": z};
|    |5729|+	this.heldPosition = { "x": x, "z": z};
|5730|5730| };
|5731|5731| 
|5732|5732| 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
|5726|5726| 
|5727|5727| UnitAI.prototype.SetHeldPosition = function(x, z)
|5728|5728| {
|5729|    |-	this.heldPosition = {"x": x, "z": z};
|    |5729|+	this.heldPosition = {"x": x, "z": z };
|5730|5730| };
|5731|5731| 
|5732|5732| 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
|5753|5753| 	return false;
|5754|5754| };
|5755|5755| 
|5756|    |-//// Helper functions ////
|    |5756|+// // Helper functions ////
|5757|5757| 
|5758|5758| UnitAI.prototype.CanAttack = function(target)
|5759|5759| {
|    | [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
|5957|5957| 	return cmpPack && cmpPack.IsPacking();
|5958|5958| };
|5959|5959| 
|5960|    |-//// Formation specific functions ////
|    |5960|+// // Formation specific functions ////
|5961|5961| 
|5962|5962| UnitAI.prototype.IsAttackingAsFormation = function()
|5963|5963| {
|    | [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
|5962|5962| UnitAI.prototype.IsAttackingAsFormation = function()
|5963|5963| {
|5964|5964| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5965|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5966|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5965|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5966|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5967|5967| };
|5968|5968| 
|5969|5969| //// 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
|5966|5966| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5967|5967| };
|5968|5968| 
|5969|    |-//// Animal specific functions ////
|    |5969|+// // Animal specific functions ////
|5970|5970| 
|5971|5971| UnitAI.prototype.MoveRandomly = function(distance)
|5972|5972| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 914| »   »   »   "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
| 939| »   »   »   "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
| 989| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1052| »   »   »   »   "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
|1088| »   »   »   "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
|1120| »   »   »   »   "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
|1280| »   »   "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
|1337| »   »   »   "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
|1512| »   »   »   "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
|1534| »   »   »   "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
|1566| »   »   »   "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
|1720| »   »   »   "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
|1770| »   »   »   »   "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
|1848| »   »   »   »   "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
|2025| »   »   »   »   "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
|2141| »   »   »   »   "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
|2416| »   »   »   »   "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
|2449| »   »   »   »   "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
|2555| »   »   »   »   "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
|2621| »   »   »   »   "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
|2660| »   »   »   »   "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
|2871| »   »   »   »   "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
|3052| »   »   »   »   "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
|3791| »   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
|4638| »   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
|4653| »   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
|4699| »   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
|4722| »   »   ····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
|1980| »   »   »   »   »   »   &&·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
|3753| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

Nescio added a subscriber: Nescio.Sep 13 2019, 1:00 PM

Shouldn't template_unit_fauna.xml have <Controllable> set to false and template_unit_fauna_herd_domestic.xml and gaia/fauna_arctic_wolf_domestic.xml true?

Freagarach marked an inline comment as done.EditedSep 16 2019, 12:04 PM

Not necessarily, when a unit is not owned it can't be moved around, this patch allows any entity that is owned to be moved around, regardless of whether it is an animal or not. (Which would mean that gaia/fauna_arctic_wolf_domestic.xml is depraced hereafter.)

Not necessarily, when a unit is not owned it can't be moved around, this patch allows any entity that is owned to be moved around, regardless of whether it is an animal or not. (Which would mean that gaia/fauna_arctic_wolf_domestic.xml is depraced hereafter.)

This was the subject of a flamewar last time. IMO it's fine to control animals one owns right now.

This is committable with the caveat inline.

binaries/data/mods/public/simulation/helpers/Commands.js
885

I would prefer to fetch the name of the entity there instead of a generic message like that.

Freagarach updated this revision to Diff 9816.Sep 17 2019, 7:54 AM
Freagarach marked an inline comment as done.

Specify the type of unit which can't be controlled.

Freagarach added inline comments.
binaries/data/mods/public/simulation/helpers/Commands.js
886

I'm not sure whether this gets translated properly, markForTranslation was not in the lesson by @elexis ;)

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 537| 537| 			if (cmpGarrisonHolder)
| 538| 538| 			{
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541|    |-				    && player != +cmd.owner)
|    | 540|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 541|+				    player != +cmd.owner)
| 542| 542| 						continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540| 540| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541| 541| 				    && player != +cmd.owner)
| 542|    |-						continue;
|    | 542|+					continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 545| 545| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1161|1161| 
|1162|1162| 	// send Metadata info if any
|1163|1163| 	if (cmd.metadata)
|1164|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1164|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1165|1165| 
|1166|1166| 	// Tell the units to start building this new entity
|1167|1167| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1161|1161| 
|1162|1162| 	// send Metadata info if any
|1163|1163| 	if (cmd.metadata)
|1164|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1164|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1165|1165| 
|1166|1166| 	// Tell the units to start building this new entity
|1167|1167| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1161|1161| 
|1162|1162| 	// send Metadata info if any
|1163|1163| 	if (cmd.metadata)
|1164|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1164|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1165|1165| 
|1166|1166| 	// Tell the units to start building this new entity
|1167|1167| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1269|1269| 		}
|1270|1270| 
|1271|1271| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1272|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1272|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1273|1273| 	}
|1274|1274| 
|1275|1275| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1333|1333| 
|1334|1334| 				if (i > 0)
|1335|1335| 				{
|1336|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1336|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1337|1337| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1338|1338| 					// TODO: ensure that cmpPreviousObstruction exists
|1339|1339| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1496|1496| 		// Check that all its members are selected
|1497|1497| 		var fid = formationIds[0];
|1498|1498| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1499|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1500|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1499|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1500|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1501|1501| 		{
|1502|1502| 			cmpFormation.DeleteTwinFormations();
|1503|1503| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1604|1604| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1605|1605| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1606|1606| 				if (matrix[i][j] < distSq)
|1607|    |-					closeClusters = [i,j];
|    |1607|+					closeClusters = [i, j];
|1608|1608| 
|1609|1609| 		// if no more close clusters found, just return all found clusters so far
|1610|1610| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1626|1626| 		}
|1627|1627| 		// remove the rows and columns in the matrix for the merged clusters,
|1628|1628| 		// and the clusters themselves from the cluster list
|1629|    |-		clusters.splice(closeClusters[0],1);
|    |1629|+		clusters.splice(closeClusters[0], 1);
|1630|1630| 		clusters.splice(closeClusters[1],1);
|1631|1631| 		matrix.splice(closeClusters[0],1);
|1632|1632| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1627|1627| 		// remove the rows and columns in the matrix for the merged clusters,
|1628|1628| 		// and the clusters themselves from the cluster list
|1629|1629| 		clusters.splice(closeClusters[0],1);
|1630|    |-		clusters.splice(closeClusters[1],1);
|    |1630|+		clusters.splice(closeClusters[1], 1);
|1631|1631| 		matrix.splice(closeClusters[0],1);
|1632|1632| 		matrix.splice(closeClusters[1],1);
|1633|1633| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1628|1628| 		// and the clusters themselves from the cluster list
|1629|1629| 		clusters.splice(closeClusters[0],1);
|1630|1630| 		clusters.splice(closeClusters[1],1);
|1631|    |-		matrix.splice(closeClusters[0],1);
|    |1631|+		matrix.splice(closeClusters[0], 1);
|1632|1632| 		matrix.splice(closeClusters[1],1);
|1633|1633| 		for (let i = 0; i < matrix.length; ++i)
|1634|1634| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1629|1629| 		clusters.splice(closeClusters[0],1);
|1630|1630| 		clusters.splice(closeClusters[1],1);
|1631|1631| 		matrix.splice(closeClusters[0],1);
|1632|    |-		matrix.splice(closeClusters[1],1);
|    |1632|+		matrix.splice(closeClusters[1], 1);
|1633|1633| 		for (let i = 0; i < matrix.length; ++i)
|1634|1634| 		{
|1635|1635| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1633|1633| 		for (let i = 0; i < matrix.length; ++i)
|1634|1634| 		{
|1635|1635| 			if (matrix[i].length > closeClusters[0])
|1636|    |-				matrix[i].splice(closeClusters[0],1);
|    |1636|+				matrix[i].splice(closeClusters[0], 1);
|1637|1637| 			if (matrix[i].length > closeClusters[1])
|1638|1638| 				matrix[i].splice(closeClusters[1],1);
|1639|1639| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1635|1635| 			if (matrix[i].length > closeClusters[0])
|1636|1636| 				matrix[i].splice(closeClusters[0],1);
|1637|1637| 			if (matrix[i].length > closeClusters[1])
|1638|    |-				matrix[i].splice(closeClusters[1],1);
|    |1638|+				matrix[i].splice(closeClusters[1], 1);
|1639|1639| 		}
|1640|1640| 		// add a new row of distances to the matrix and the new cluster
|1641|1641| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 789| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1292| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1293| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1523| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1602| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 541| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 729| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 979| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1126| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1378| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1461| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1500| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1526| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1559| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 801| 801| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 802| 802| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 803| 803| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 804|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 804|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 805| 805| 	}
| 806| 806| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 807| 807| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1634|1634| 			{
|1635|1635| 				minDist2 = dist2;
|1636|1636| 				minDistEntitySnapData = {
|1637|    |-						"x": pos.x,
|    |1637|+					"x": pos.x,
|1638|1638| 						"z": pos.z,
|1639|1639| 						"angle": cmpPosition.GetRotation().y,
|1640|1640| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1635|1635| 				minDist2 = dist2;
|1636|1636| 				minDistEntitySnapData = {
|1637|1637| 						"x": pos.x,
|1638|    |-						"z": pos.z,
|    |1638|+					"z": pos.z,
|1639|1639| 						"angle": cmpPosition.GetRotation().y,
|1640|1640| 						"ent": ent
|1641|1641| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1636|1636| 				minDistEntitySnapData = {
|1637|1637| 						"x": pos.x,
|1638|1638| 						"z": pos.z,
|1639|    |-						"angle": cmpPosition.GetRotation().y,
|    |1639|+					"angle": cmpPosition.GetRotation().y,
|1640|1640| 						"ent": ent
|1641|1641| 				};
|1642|1642| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1637|1637| 						"x": pos.x,
|1638|1638| 						"z": pos.z,
|1639|1639| 						"angle": cmpPosition.GetRotation().y,
|1640|    |-						"ent": ent
|    |1640|+					"ent": ent
|1641|1641| 				};
|1642|1642| 			}
|1643|1643| 		}
|    | [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
| 759| 759| 					this.FinishOrder();
| 760| 760| 					return;
| 761| 761| 				}
| 762|    |-				else
| 763|    |-				{
|    | 762|+				
| 764| 763| 					this.SetNextState("GARRISON.APPROACHING");
| 765| 764| 					return;
| 766|    |-				}
|    | 765|+				
| 767| 766| 			}
| 768| 767| 
| 769| 768| 			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
|1027|1027| 			},
|1028|1028| 		},
|1029|1029| 
|1030|    |-		"GARRISON":{
|    |1030|+		"GARRISON": {
|1031|1031| 			"enter": function() {
|1032|1032| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1033|1033| 				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
|1976|1976| 
|1977|1977| 				"Attacked": function(msg) {
|1978|1978| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1979|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1980|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1979|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1980|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1981|1981| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1982|1982| 				},
|1983|1983| 			},
|    | [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
|2704|2704| 					{
|2705|2705| 						// The building was already finished/fully repaired before we arrived;
|2706|2706| 						// let the ConstructionFinished handler handle this.
|2707|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2707|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2708|2708| 						return true;
|2709|2709| 					}
|2710|2710| 
|    | [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
|2704|2704| 					{
|2705|2705| 						// The building was already finished/fully repaired before we arrived;
|2706|2706| 						// let the ConstructionFinished handler handle this.
|2707|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2707|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2708|2708| 						return true;
|2709|2709| 					}
|2710|2710| 
|    | [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
|3217|3217| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3218|3218| 
|3219|3219| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3220|    |-							// only used for domestic animals
|    |3220|+		// only used for domestic animals
|3221|3221| 	},
|3222|3222| };
|3223|3223| 
|    | [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
|3275|3275| 
|3276|3276| UnitAI.prototype.IsAnimal = function()
|3277|3277| {
|3278|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3278|+	return (!!this.template.NaturalBehaviour);
|3279|3279| };
|3280|3280| 
|3281|3281| 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
|3405|3405| 		{
|3406|3406| 			let index = this.GetCurrentState().indexOf(".");
|3407|3407| 			if (index != -1)
|3408|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3408|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3409|3409| 			this.Stop(false);
|3410|3410| 		}
|3411|3411| 
|    | [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
|3461|3461| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3462|3462| 			continue;
|3463|3463| 		if (i == 0)
|3464|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3464|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3465|3465| 		else
|3466|3466| 			this.orderQueue.splice(i, 1);
|3467|3467| 		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
|3461|3461| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3462|3462| 			continue;
|3463|3463| 		if (i == 0)
|3464|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3464|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3465|3465| 		else
|3466|3466| 			this.orderQueue.splice(i, 1);
|3467|3467| 		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
|3545|3545| };
|3546|3546| 
|3547|3547| 
|3548|    |-//// FSM linkage functions ////
|    |3548|+// // FSM linkage functions ////
|3549|3549| 
|3550|3550| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3551|3551| 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
|3715|3715| 				continue;
|3716|3716| 			if (this.orderQueue[i].type == type)
|3717|3717| 				continue;
|3718|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3718|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3719|3719| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3720|3720| 			return;
|3721|3721| 		}
|    | [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
|3715|3715| 				continue;
|3716|3716| 			if (this.orderQueue[i].type == type)
|3717|3717| 				continue;
|3718|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3718|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3719|3719| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3720|3720| 			return;
|3721|3721| 		}
|    | [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
|3886|3886| 	if (data.timerRepeat === undefined)
|3887|3887| 		this.timer = undefined;
|3888|3888| 
|3889|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3889|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3890|3890| };
|3891|3891| 
|3892|3892| /**
|    | [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
|3886|3886| 	if (data.timerRepeat === undefined)
|3887|3887| 		this.timer = undefined;
|3888|3888| 
|3889|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3889|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3890|3890| };
|3891|3891| 
|3892|3892| /**
|    | [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
|3931|3931| 	// TODO: This is a bit inefficient since every unit listens to every
|3932|3932| 	// construction message - ideally we could scope it to only the one we're building
|3933|3933| 
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3931|3931| 	// TODO: This is a bit inefficient since every unit listens to every
|3932|3932| 	// construction message - ideally we could scope it to only the one we're building
|3933|3933| 
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3956|3956| 
|3957|3957| UnitAI.prototype.OnAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3959|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3960|3960| };
|3961|3961| 
|3962|3962| 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
|3956|3956| 
|3957|3957| UnitAI.prototype.OnAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3959|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3960|3960| };
|3961|3961| 
|3962|3962| 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
|3961|3961| 
|3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3964|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3965|3965| };
|3966|3966| 
|3967|3967| 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
|3961|3961| 
|3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3964|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3965|3965| };
|3966|3966| 
|3967|3967| 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
|3966|3966| 
|3967|3967| UnitAI.prototype.OnHealthChanged = function(msg)
|3968|3968| {
|3969|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3969|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3970|3970| };
|3971|3971| 
|3972|3972| 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
|3966|3966| 
|3967|3967| UnitAI.prototype.OnHealthChanged = function(msg)
|3968|3968| {
|3969|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3969|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3970|3970| };
|3971|3971| 
|3972|3972| 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
|3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg)
|3973|3973| {
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3975|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|    | [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
|3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg)
|3973|3973| {
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3975|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|    | [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
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|3975| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|3975| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnPackFinished = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3982|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3983|3983| };
|3984|3984| 
|3985|3985| //// 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnPackFinished = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3982|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3983|3983| };
|3984|3984| 
|3985|3985| //// 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
|3982|3982| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3983|3983| };
|3984|3984| 
|3985|    |-//// Helper functions to be called by the FSM ////
|    |3985|+// // Helper functions to be called by the FSM ////
|3986|3986| 
|3987|3987| UnitAI.prototype.GetWalkSpeed = function()
|3988|3988| {
|    | [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
|4651|4651| UnitAI.prototype.AttackEntityInZone = function(ents)
|4652|4652| {
|4653|4653| 	var target = ents.find(target =>
|4654|    |-		this.CanAttack(target)
|4655|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4654|+		this.CanAttack(target) &&
|    |4655|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4656|4656| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4657|4657| 	);
|4658|4658| 	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
|4652|4652| {
|4653|4653| 	var target = ents.find(target =>
|4654|4654| 		this.CanAttack(target)
|4655|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4656|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4655|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4656|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4657|4657| 	);
|4658|4658| 	if (!target)
|4659|4659| 		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
|4716|4716| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4717|4717| 	if (this.isGuardOf)
|4718|4718| 	{
|4719|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4719|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4720|4720| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4721|4721| 		if (cmpUnitAI && cmpAttack &&
|4722|4722| 		    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
|4720|4720| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4721|4721| 		if (cmpUnitAI && cmpAttack &&
|4722|4722| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4723|    |-				return false;
|    |4723|+			return false;
|4724|4724| 	}
|4725|4725| 
|4726|4726| 	// 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
|4758|4758| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4759|4759| 	if (this.isGuardOf)
|4760|4760| 	{
|4761|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4761|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4762|4762| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4763|4763| 		if (cmpUnitAI && cmpAttack &&
|4764|4764| 		    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
|4771|4771| 	return false;
|4772|4772| };
|4773|4773| 
|4774|    |-//// External interface functions ////
|    |4774|+// // External interface functions ////
|4775|4775| 
|4776|4776| UnitAI.prototype.SetFormationController = function(ent)
|4777|4777| {
|    | [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
|4927|4927| 	{
|4928|4928| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4929|4929| 			return;
|4930|    |-		else
|4931|    |-			this.RemoveGuard();
|    |4930|+		this.RemoveGuard();
|4932|4931| 	}
|4933|4932| 
|4934|4933| 	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
|5259|5259| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5260|5260| 	{
|5261|5261| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5262|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5262|+		if (cmpTrader.HasBothMarkets() &&
|5263|5263| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5264|5264| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5265|5265| 		{
|    | [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
|5540|5540| 				{
|5541|5541| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5542|5542| 					var targetClasses = this.order.data.targetClasses;
|5543|    |-					if (targetClasses.attack && cmpIdentity
|5544|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5543|+					if (targetClasses.attack && cmpIdentity &&
|    |5544|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5545|5545| 						continue;
|5546|5546| 					if (targetClasses.avoid && cmpIdentity
|5547|5547| 						&& 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
|5543|5543| 					if (targetClasses.attack && cmpIdentity
|5544|5544| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5545|5545| 						continue;
|5546|    |-					if (targetClasses.avoid && cmpIdentity
|5547|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5546|+					if (targetClasses.avoid && cmpIdentity &&
|    |5547|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5548|5548| 						continue;
|5549|5549| 					// Only used by the AIs to prevent some choices of targets
|5550|5550| 					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
|5566|5566| 		{
|5567|5567| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5568|5568| 			var targetClasses = this.order.data.targetClasses;
|5569|    |-			if (cmpIdentity && targetClasses.attack
|5570|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5569|+			if (cmpIdentity && targetClasses.attack &&
|    |5570|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5571|5571| 				continue;
|5572|5572| 			if (cmpIdentity && targetClasses.avoid
|5573|5573| 				&& 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
|5569|5569| 			if (cmpIdentity && targetClasses.attack
|5570|5570| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5571|5571| 				continue;
|5572|    |-			if (cmpIdentity && targetClasses.avoid
|5573|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5572|+			if (cmpIdentity && targetClasses.avoid &&
|    |5573|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5574|5574| 				continue;
|5575|5575| 			// Only used by the AIs to prevent some choices of targets
|5576|5576| 			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
|5726|5726| 
|5727|5727| UnitAI.prototype.SetHeldPosition = function(x, z)
|5728|5728| {
|5729|    |-	this.heldPosition = {"x": x, "z": z};
|    |5729|+	this.heldPosition = { "x": x, "z": z};
|5730|5730| };
|5731|5731| 
|5732|5732| 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
|5726|5726| 
|5727|5727| UnitAI.prototype.SetHeldPosition = function(x, z)
|5728|5728| {
|5729|    |-	this.heldPosition = {"x": x, "z": z};
|    |5729|+	this.heldPosition = {"x": x, "z": z };
|5730|5730| };
|5731|5731| 
|5732|5732| 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
|5753|5753| 	return false;
|5754|5754| };
|5755|5755| 
|5756|    |-//// Helper functions ////
|    |5756|+// // Helper functions ////
|5757|5757| 
|5758|5758| UnitAI.prototype.CanAttack = function(target)
|5759|5759| {
|    | [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
|5957|5957| 	return cmpPack && cmpPack.IsPacking();
|5958|5958| };
|5959|5959| 
|5960|    |-//// Formation specific functions ////
|    |5960|+// // Formation specific functions ////
|5961|5961| 
|5962|5962| UnitAI.prototype.IsAttackingAsFormation = function()
|5963|5963| {
|    | [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
|5962|5962| UnitAI.prototype.IsAttackingAsFormation = function()
|5963|5963| {
|5964|5964| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5965|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5966|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5965|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5966|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5967|5967| };
|5968|5968| 
|5969|5969| //// 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
|5966|5966| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5967|5967| };
|5968|5968| 
|5969|    |-//// Animal specific functions ////
|    |5969|+// // Animal specific functions ////
|5970|5970| 
|5971|5971| UnitAI.prototype.MoveRandomly = function(distance)
|5972|5972| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 914| »   »   »   "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
| 939| »   »   »   "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
| 989| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1052| »   »   »   »   "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
|1088| »   »   »   "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
|1120| »   »   »   »   "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
|1280| »   »   "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
|1337| »   »   »   "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
|1512| »   »   »   "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
|1534| »   »   »   "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
|1566| »   »   »   "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
|1720| »   »   »   "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
|1770| »   »   »   »   "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
|1848| »   »   »   »   "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
|2025| »   »   »   »   "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
|2141| »   »   »   »   "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
|2416| »   »   »   »   "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
|2449| »   »   »   »   "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
|2555| »   »   »   »   "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
|2621| »   »   »   »   "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
|2660| »   »   »   »   "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
|2871| »   »   »   »   "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
|3052| »   »   »   »   "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
|3791| »   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
|4638| »   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
|4653| »   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
|4699| »   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
|4722| »   »   ····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
|1980| »   »   »   »   »   »   &&·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
|3753| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

Freagarach updated this revision to Diff 9817.Sep 17 2019, 8:04 AM

Fix test.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetInterval' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  35|  35| 
|  36|  36| 
|  37|  37| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
|  38|    |-		SetInterval: function() { },
|    |  38|+		"SetInterval": function() { },
|  39|  39| 		SetTimeout: function() { },
|  40|  40| 	});
|  41|  41| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetTimeout' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  36|  36| 
|  37|  37| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
|  38|  38| 		SetInterval: function() { },
|  39|    |-		SetTimeout: function() { },
|    |  39|+		"SetTimeout": function() { },
|  40|  40| 	});
|  41|  41| 
|  42|  42| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CreateActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  40|  40| 	});
|  41|  41| 
|  42|  42| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
|  43|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    |  43|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
|  44|  44| 			return 1;
|  45|  45| 		},
|  46|  46| 		EnableActiveQuery: function(id) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'EnableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|  44|  44| 			return 1;
|  45|  45| 		},
|  46|    |-		EnableActiveQuery: function(id) { },
|    |  46|+		"EnableActiveQuery": function(id) { },
|  47|  47| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  48|  48| 		DisableActiveQuery: function(id) { },
|  49|  49| 		GetEntityFlagMask: function(identifier) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'ResetActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  44|  44| 			return 1;
|  45|  45| 		},
|  46|  46| 		EnableActiveQuery: function(id) { },
|  47|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  47|+		"ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; },
|  48|  48| 		DisableActiveQuery: function(id) { },
|  49|  49| 		GetEntityFlagMask: function(identifier) { },
|  50|  50| 	});
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  44|  44| 			return 1;
|  45|  45| 		},
|  46|  46| 		EnableActiveQuery: function(id) { },
|  47|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  47|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
|  48|  48| 		DisableActiveQuery: function(id) { },
|  49|  49| 		GetEntityFlagMask: function(identifier) { },
|  50|  50| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'DisableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  45|  45| 		},
|  46|  46| 		EnableActiveQuery: function(id) { },
|  47|  47| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  48|    |-		DisableActiveQuery: function(id) { },
|    |  48|+		"DisableActiveQuery": function(id) { },
|  49|  49| 		GetEntityFlagMask: function(identifier) { },
|  50|  50| 	});
|  51|  51| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEntityFlagMask' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  46|  46| 		EnableActiveQuery: function(id) { },
|  47|  47| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|  48|  48| 		DisableActiveQuery: function(id) { },
|  49|    |-		GetEntityFlagMask: function(identifier) { },
|    |  49|+		"GetEntityFlagMask": function(identifier) { },
|  50|  50| 	});
|  51|  51| 
|  52|  52| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetCurrentTemplateName' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  50|  50| 	});
|  51|  51| 
|  52|  52| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|  53|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    |  53|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
|  54|  54| 	});
|  55|  55| 
|  56|  56| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPlayerByID' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  54|  54| 	});
|  55|  55| 
|  56|  56| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|  57|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    |  57|+		"GetPlayerByID": function(id) { return playerEntity; },
|  58|  58| 		GetNumPlayers: function() { return 2; },
|  59|  59| 	});
|  60|  60| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetNumPlayers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  55|  55| 
|  56|  56| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|  57|  57| 		GetPlayerByID: function(id) { return playerEntity; },
|  58|    |-		GetNumPlayers: function() { return 2; },
|    |  58|+		"GetNumPlayers": function() { return 2; },
|  59|  59| 	});
|  60|  60| 
|  61|  61| 	AddMock(playerEntity, IID_Player, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAlly' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  59|  59| 	});
|  60|  60| 
|  61|  61| 	AddMock(playerEntity, IID_Player, {
|  62|    |-		IsAlly: function() { return false; },
|    |  62|+		"IsAlly": function() { return false; },
|  63|  63| 		IsEnemy: function() { return true; },
|  64|  64| 		GetEnemies: function() { return []; },
|  65|  65| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsEnemy' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  60|  60| 
|  61|  61| 	AddMock(playerEntity, IID_Player, {
|  62|  62| 		IsAlly: function() { return false; },
|  63|    |-		IsEnemy: function() { return true; },
|    |  63|+		"IsEnemy": function() { return true; },
|  64|  64| 		GetEnemies: function() { return []; },
|  65|  65| 	});
|  66|  66| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEnemies' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  61|  61| 	AddMock(playerEntity, IID_Player, {
|  62|  62| 		IsAlly: function() { return false; },
|  63|  63| 		IsEnemy: function() { return true; },
|  64|    |-		GetEnemies: function() { return []; },
|    |  64|+		"GetEnemies": function() { return []; },
|  65|  65| 	});
|  66|  66| 
|  67|  67| 	AddMock(SYSTEM_ENTITY, IID_ObstructionManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetClassesList' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  71|  71| 	var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive", "Controllable": "true" });
|  72|  72| 
|  73|  73| 	AddMock(unit, IID_Identity, {
|  74|    |-		GetClassesList: function() { return []; },
|    |  74|+		"GetClassesList": function() { return []; },
|  75|  75| 	});
|  76|  76| 
|  77|  77| 	AddMock(unit, IID_Ownership, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetOwner' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  75|  75| 	});
|  76|  76| 
|  77|  77| 	AddMock(unit, IID_Ownership, {
|  78|    |-		GetOwner: function() { return 1; },
|    |  78|+		"GetOwner": function() { return 1; },
|  79|  79| 	});
|  80|  80| 
|  81|  81| 	AddMock(unit, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  79|  79| 	});
|  80|  80| 
|  81|  81| 	AddMock(unit, IID_Position, {
|  82|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    |  82|+		"GetTurretParent": function() { return INVALID_ENTITY; },
|  83|  83| 		GetPosition: function() { return new Vector3D(); },
|  84|  84| 		GetPosition2D: function() { return new Vector2D(); },
|  85|  85| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  80|  80| 
|  81|  81| 	AddMock(unit, IID_Position, {
|  82|  82| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  83|    |-		GetPosition: function() { return new Vector3D(); },
|    |  83|+		"GetPosition": function() { return new Vector3D(); },
|  84|  84| 		GetPosition2D: function() { return new Vector2D(); },
|  85|  85| 		GetRotation: function() { return { "y": 0 }; },
|  86|  86| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  81|  81| 	AddMock(unit, IID_Position, {
|  82|  82| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  83|  83| 		GetPosition: function() { return new Vector3D(); },
|  84|    |-		GetPosition2D: function() { return new Vector2D(); },
|    |  84|+		"GetPosition2D": function() { return new Vector2D(); },
|  85|  85| 		GetRotation: function() { return { "y": 0 }; },
|  86|  86| 		IsInWorld: function() { return true; },
|  87|  87| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  82|  82| 		GetTurretParent: function() { return INVALID_ENTITY; },
|  83|  83| 		GetPosition: function() { return new Vector3D(); },
|  84|  84| 		GetPosition2D: function() { return new Vector2D(); },
|  85|    |-		GetRotation: function() { return { "y": 0 }; },
|    |  85|+		"GetRotation": function() { return { "y": 0 }; },
|  86|  86| 		IsInWorld: function() { return true; },
|  87|  87| 	});
|  88|  88| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  83|  83| 		GetPosition: function() { return new Vector3D(); },
|  84|  84| 		GetPosition2D: function() { return new Vector2D(); },
|  85|  85| 		GetRotation: function() { return { "y": 0 }; },
|  86|    |-		IsInWorld: function() { return true; },
|    |  86|+		"IsInWorld": function() { return true; },
|  87|  87| 	});
|  88|  88| 
|  89|  89| 	AddMock(unit, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  95|  95| 	});
|  96|  96| 
|  97|  97| 	AddMock(unit, IID_Vision, {
|  98|    |-		GetRange: function() { return 10; },
|    |  98|+		"GetRange": function() { return 10; },
|  99|  99| 	});
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  99|  99| 	});
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 102|+		"GetRange": function() { return { "max": 10, "min": 0}; },
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  99|  99| 	});
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 102|+		GetRange: function() { return { "max": 10, "min": 0 }; },
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetFullAttackRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102| 102| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 103|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 103|+		"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 100| 100| 
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102| 102| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 103|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 103|+		GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetBestAttackAgainst' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 101| 101| 	AddMock(unit, IID_Attack, {
| 102| 102| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104|    |-		GetBestAttackAgainst: function(t) { return "melee"; },
|    | 104|+		"GetBestAttackAgainst": function(t) { return "melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 107| 107| 		CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 102| 102| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 105|    |-		GetPreference: function(t) { return 0; },
|    | 105|+		"GetPreference": function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 107| 107| 		CanAttack: function(v) { return true; },
| 108| 108| 		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTimers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 103| 103| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 104| 104| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106|    |-		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 106|+		"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 107| 107| 		CanAttack: function(v) { return true; },
| 108| 108| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 109| 109| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttack' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 104| 104| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 107|    |-		CanAttack: function(v) { return true; },
|    | 107|+		"CanAttack": function(v) { return true; },
| 108| 108| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 109| 109| 	});
| 110| 110| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CompareEntitiesByPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 105| 105| 		GetPreference: function(t) { return 0; },
| 106| 106| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 107| 107| 		CanAttack: function(v) { return true; },
| 108|    |-		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 108|+		"CompareEntitiesByPreference": function(a, b) { return 0; },
| 109| 109| 	});
| 110| 110| 
| 111| 111| 	unitAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 116| 116| 	if (mode == 1)
| 117| 117| 	{
| 118| 118| 		AddMock(enemy, IID_Health, {
| 119|    |-			GetHitpoints: function() { return 10; },
|    | 119|+			"GetHitpoints": function() { return 10; },
| 120| 120| 		});
| 121| 121| 		AddMock(enemy, IID_UnitAI, {
| 122| 122| 			IsAnimal: function() { return false; }
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAnimal' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 119| 119| 			GetHitpoints: function() { return 10; },
| 120| 120| 		});
| 121| 121| 		AddMock(enemy, IID_UnitAI, {
| 122|    |-			IsAnimal: function() { return false; }
|    | 122|+			"IsAnimal": function() { return false; }
| 123| 123| 		});
| 124| 124| 	}
| 125| 125| 	else if (mode == 2)
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 124| 124| 	}
| 125| 125| 	else if (mode == 2)
| 126| 126| 		AddMock(enemy, IID_Health, {
| 127|    |-			GetHitpoints: function() { return 0; },
|    | 127|+			"GetHitpoints": function() { return 0; },
| 128| 128| 		});
| 129| 129| 
| 130| 130| 	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 127| 127| 			GetHitpoints: function() { return 0; },
| 128| 128| 		});
| 129| 129| 
| 130|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 130|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 131| 131| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive", "Controllable": "true" });
| 132| 132| 
| 133| 133| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 127| 127| 			GetHitpoints: function() { return 0; },
| 128| 128| 		});
| 129| 129| 
| 130|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 130|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 131| 131| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive", "Controllable": "true" });
| 132| 132| 
| 133| 133| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'JumpTo' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 131| 131| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive", "Controllable": "true" });
| 132| 132| 
| 133| 133| 	AddMock(controller, IID_Position, {
| 134|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 134|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 135| 135| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 132| 132| 
| 133| 133| 	AddMock(controller, IID_Position, {
| 134| 134| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 135|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 135|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 138| 138| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 133| 133| 	AddMock(controller, IID_Position, {
| 134| 134| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 135| 135| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 136|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 136|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 138| 138| 		GetRotation: function() { return { "y": 0 }; },
| 139| 139| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 134| 134| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 135| 135| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 137|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 138| 138| 		GetRotation: function() { return { "y": 0 }; },
| 139| 139| 		IsInWorld: function() { return true; },
| 140| 140| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 135| 135| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 138|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 138|+		"GetRotation": function() { return { "y": 0 }; },
| 139| 139| 		IsInWorld: function() { return true; },
| 140| 140| 	});
| 141| 141| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 136| 136| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 137| 137| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 138| 138| 		GetRotation: function() { return { "y": 0 }; },
| 139|    |-		IsInWorld: function() { return true; },
|    | 139|+		"IsInWorld": function() { return true; },
| 140| 140| 	});
| 141| 141| 
| 142| 142| 	AddMock(controller, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetInterval' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 186| 186| 	var unitAIs = [];
| 187| 187| 
| 188| 188| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 189|    |-		SetInterval: function() { },
|    | 189|+		"SetInterval": function() { },
| 190| 190| 		SetTimeout: function() { },
| 191| 191| 	});
| 192| 192| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetTimeout' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 187| 187| 
| 188| 188| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 189| 189| 		SetInterval: function() { },
| 190|    |-		SetTimeout: function() { },
|    | 190|+		"SetTimeout": function() { },
| 191| 191| 	});
| 192| 192| 
| 193| 193| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CreateActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 192| 192| 
| 193| 193| 
| 194| 194| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 195|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 195|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 196| 196| 			return 1;
| 197| 197| 		},
| 198| 198| 		EnableActiveQuery: function(id) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'EnableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 195| 195| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 196| 196| 			return 1;
| 197| 197| 		},
| 198|    |-		EnableActiveQuery: function(id) { },
|    | 198|+		"EnableActiveQuery": function(id) { },
| 199| 199| 		ResetActiveQuery: function(id) { return [enemy]; },
| 200| 200| 		DisableActiveQuery: function(id) { },
| 201| 201| 		GetEntityFlagMask: function(identifier) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'ResetActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 196| 196| 			return 1;
| 197| 197| 		},
| 198| 198| 		EnableActiveQuery: function(id) { },
| 199|    |-		ResetActiveQuery: function(id) { return [enemy]; },
|    | 199|+		"ResetActiveQuery": function(id) { return [enemy]; },
| 200| 200| 		DisableActiveQuery: function(id) { },
| 201| 201| 		GetEntityFlagMask: function(identifier) { },
| 202| 202| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'DisableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 197| 197| 		},
| 198| 198| 		EnableActiveQuery: function(id) { },
| 199| 199| 		ResetActiveQuery: function(id) { return [enemy]; },
| 200|    |-		DisableActiveQuery: function(id) { },
|    | 200|+		"DisableActiveQuery": function(id) { },
| 201| 201| 		GetEntityFlagMask: function(identifier) { },
| 202| 202| 	});
| 203| 203| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEntityFlagMask' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 198| 198| 		EnableActiveQuery: function(id) { },
| 199| 199| 		ResetActiveQuery: function(id) { return [enemy]; },
| 200| 200| 		DisableActiveQuery: function(id) { },
| 201|    |-		GetEntityFlagMask: function(identifier) { },
|    | 201|+		"GetEntityFlagMask": function(identifier) { },
| 202| 202| 	});
| 203| 203| 
| 204| 204| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetCurrentTemplateName' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 202| 202| 	});
| 203| 203| 
| 204| 204| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 205|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 205|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 206| 206| 	});
| 207| 207| 
| 208| 208| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPlayerByID' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 206| 206| 	});
| 207| 207| 
| 208| 208| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 209|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 209|+		"GetPlayerByID": function(id) { return playerEntity; },
| 210| 210| 		GetNumPlayers: function() { return 2; },
| 211| 211| 	});
| 212| 212| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetNumPlayers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 207| 207| 
| 208| 208| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 209| 209| 		GetPlayerByID: function(id) { return playerEntity; },
| 210|    |-		GetNumPlayers: function() { return 2; },
|    | 210|+		"GetNumPlayers": function() { return 2; },
| 211| 211| 	});
| 212| 212| 
| 213| 213| 	AddMock(SYSTEM_ENTITY, IID_ObstructionManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAlly' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 215| 215| 	});
| 216| 216| 
| 217| 217| 	AddMock(playerEntity, IID_Player, {
| 218|    |-		IsAlly: function() { return false; },
|    | 218|+		"IsAlly": function() { return false; },
| 219| 219| 		IsEnemy: function() { return true; },
| 220| 220| 		GetEnemies: function() { return []; },
| 221| 221| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsEnemy' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 216| 216| 
| 217| 217| 	AddMock(playerEntity, IID_Player, {
| 218| 218| 		IsAlly: function() { return false; },
| 219|    |-		IsEnemy: function() { return true; },
|    | 219|+		"IsEnemy": function() { return true; },
| 220| 220| 		GetEnemies: function() { return []; },
| 221| 221| 	});
| 222| 222| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEnemies' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 217| 217| 	AddMock(playerEntity, IID_Player, {
| 218| 218| 		IsAlly: function() { return false; },
| 219| 219| 		IsEnemy: function() { return true; },
| 220|    |-		GetEnemies: function() { return []; },
|    | 220|+		"GetEnemies": function() { return []; },
| 221| 221| 	});
| 222| 222| 
| 223| 223| 	// create units
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetClassesList' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 228| 228| 		var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive", "Controllable": "true" });
| 229| 229| 
| 230| 230| 		AddMock(unit + i, IID_Identity, {
| 231|    |-			GetClassesList: function() { return []; },
|    | 231|+			"GetClassesList": function() { return []; },
| 232| 232| 		});
| 233| 233| 
| 234| 234| 		AddMock(unit + i, IID_Ownership, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetOwner' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 232| 232| 		});
| 233| 233| 
| 234| 234| 		AddMock(unit + i, IID_Ownership, {
| 235|    |-			GetOwner: function() { return 1; },
|    | 235|+			"GetOwner": function() { return 1; },
| 236| 236| 		});
| 237| 237| 
| 238| 238| 		AddMock(unit + i, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 236| 236| 		});
| 237| 237| 
| 238| 238| 		AddMock(unit + i, IID_Position, {
| 239|    |-			GetTurretParent: function() { return INVALID_ENTITY; },
|    | 239|+			"GetTurretParent": function() { return INVALID_ENTITY; },
| 240| 240| 			GetPosition: function() { return new Vector3D(); },
| 241| 241| 			GetPosition2D: function() { return new Vector2D(); },
| 242| 242| 			GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 237| 237| 
| 238| 238| 		AddMock(unit + i, IID_Position, {
| 239| 239| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 240|    |-			GetPosition: function() { return new Vector3D(); },
|    | 240|+			"GetPosition": function() { return new Vector3D(); },
| 241| 241| 			GetPosition2D: function() { return new Vector2D(); },
| 242| 242| 			GetRotation: function() { return { "y": 0 }; },
| 243| 243| 			IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 238| 238| 		AddMock(unit + i, IID_Position, {
| 239| 239| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 240| 240| 			GetPosition: function() { return new Vector3D(); },
| 241|    |-			GetPosition2D: function() { return new Vector2D(); },
|    | 241|+			"GetPosition2D": function() { return new Vector2D(); },
| 242| 242| 			GetRotation: function() { return { "y": 0 }; },
| 243| 243| 			IsInWorld: function() { return true; },
| 244| 244| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 239| 239| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 240| 240| 			GetPosition: function() { return new Vector3D(); },
| 241| 241| 			GetPosition2D: function() { return new Vector2D(); },
| 242|    |-			GetRotation: function() { return { "y": 0 }; },
|    | 242|+			"GetRotation": function() { return { "y": 0 }; },
| 243| 243| 			IsInWorld: function() { return true; },
| 244| 244| 		});
| 245| 245| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 240| 240| 			GetPosition: function() { return new Vector3D(); },
| 241| 241| 			GetPosition2D: function() { return new Vector2D(); },
| 242| 242| 			GetRotation: function() { return { "y": 0 }; },
| 243|    |-			IsInWorld: function() { return true; },
|    | 243|+			"IsInWorld": function() { return true; },
| 244| 244| 		});
| 245| 245| 
| 246| 246| 		AddMock(unit + i, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 252| 252| 		});
| 253| 253| 
| 254| 254| 		AddMock(unit + i, IID_Vision, {
| 255|    |-			GetRange: function() { return 10; },
|    | 255|+			"GetRange": function() { return 10; },
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 259|+			"GetRange": function() { return {"max":10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 259|+			GetRange: function() { return { "max":10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'max'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 259|+			GetRange: function() { return {"max": 10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 256| 256| 		});
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 259|+			GetRange: function() { return {"max":10, "min": 0 }; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetFullAttackRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259| 259| 			GetRange: function() { return {"max":10, "min": 0}; },
| 260|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 260|+			"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 257| 257| 
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259| 259| 			GetRange: function() { return {"max":10, "min": 0}; },
| 260|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 260|+			GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetBestAttackAgainst' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 258| 258| 		AddMock(unit + i, IID_Attack, {
| 259| 259| 			GetRange: function() { return {"max":10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261|    |-			GetBestAttackAgainst: function(t) { return "melee"; },
|    | 261|+			"GetBestAttackAgainst": function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
| 264| 264| 			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTimers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 259| 259| 			GetRange: function() { return {"max":10, "min": 0}; },
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262|    |-			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 262|+			"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
| 264| 264| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 265| 265| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttack' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 260| 260| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263|    |-			CanAttack: function(v) { return true; },
|    | 263|+			"CanAttack": function(v) { return true; },
| 264| 264| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 265| 265| 		});
| 266| 266| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CompareEntitiesByPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 261| 261| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 262| 262| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 263| 263| 			CanAttack: function(v) { return true; },
| 264|    |-			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 264|+			"CompareEntitiesByPreference": function(a, b) { return 0; },
| 265| 265| 		});
| 266| 266| 
| 267| 267| 		unitAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 273| 273| 
| 274| 274| 	// create enemy
| 275| 275| 	AddMock(enemy, IID_Health, {
| 276|    |-		GetHitpoints: function() { return 40; },
|    | 276|+		"GetHitpoints": function() { return 40; },
| 277| 277| 	});
| 278| 278| 
| 279| 279| 	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 276| 276| 		GetHitpoints: function() { return 40; },
| 277| 277| 	});
| 278| 278| 
| 279|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 279|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 280| 280| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive", "Controllable": "true" });
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 276| 276| 		GetHitpoints: function() { return 40; },
| 277| 277| 	});
| 278| 278| 
| 279|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 279|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 280| 280| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive", "Controllable": "true" });
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 280| 280| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive", "Controllable": "true" });
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_Position, {
| 283|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 283|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 284| 284| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'JumpTo' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 281| 281| 
| 282| 282| 	AddMock(controller, IID_Position, {
| 283| 283| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 284|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 284|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 287| 287| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 282| 282| 	AddMock(controller, IID_Position, {
| 283| 283| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 284| 284| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 285|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 285|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 287| 287| 		GetRotation: function() { return { "y": 0 }; },
| 288| 288| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 283| 283| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 284| 284| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 286|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 287| 287| 		GetRotation: function() { return { "y": 0 }; },
| 288| 288| 		IsInWorld: function() { return true; },
| 289| 289| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 284| 284| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 287|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 287|+		"GetRotation": function() { return { "y": 0 }; },
| 288| 288| 		IsInWorld: function() { return true; },
| 289| 289| 	});
| 290| 290| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 285| 285| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 286| 286| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 287| 287| 		GetRotation: function() { return { "y": 0 }; },
| 288|    |-		IsInWorld: function() { return true; },
|    | 288|+		"IsInWorld": function() { return true; },
| 289| 289| 	});
| 290| 290| 
| 291| 291| 	AddMock(controller, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 297| 297| 	});
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 300|+		"GetRange": function() { return {"max":10, "min": 0}; },
| 301| 301| 		CanAttackAsFormation: function() { return false; },
| 302| 302| 	});
| 303| 303| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 297| 297| 	});
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 300|+		GetRange: function() { return { "max":10, "min": 0}; },
| 301| 301| 		CanAttackAsFormation: function() { return false; },
| 302| 302| 	});
| 303| 303| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'max'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 297| 297| 	});
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 300|+		GetRange: function() { return {"max": 10, "min": 0}; },
| 301| 301| 		CanAttackAsFormation: function() { return false; },
| 302| 302| 	});
| 303| 303| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 297| 297| 	});
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 300|+		GetRange: function() { return {"max":10, "min": 0 }; },
| 301| 301| 		CanAttackAsFormation: function() { return false; },
| 302| 302| 	});
| 303| 303| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttackAsFormation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 298| 298| 
| 299| 299| 	AddMock(controller, IID_Attack, {
| 300| 300| 		GetRange: function() { return {"max":10, "min": 0}; },
| 301|    |-		CanAttackAsFormation: function() { return false; },
|    | 301|+		"CanAttackAsFormation": function() { return false; },
| 302| 302| 	});
| 303| 303| 
| 304| 304| 	controllerAI.OnCreate();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 310| 310| 	for (var ent of unitAIs)
| 311| 311| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 312| 312| 
| 313|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 313|+	controllerAI.MoveIntoFormation({ "name": "Circle"});
| 314| 314| 
| 315| 315| 	// let all units be in position
| 316| 316| 	for (var ent of unitAIs)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 310| 310| 	for (var ent of unitAIs)
| 311| 311| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 312| 312| 
| 313|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 313|+	controllerAI.MoveIntoFormation({"name": "Circle" });
| 314| 314| 
| 315| 315| 	// let all units be in position
| 316| 316| 	for (var ent of unitAIs)

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  47| »   »   ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·},
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Closing curly brace appears on the same line as the subsequent block.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 224| »   for·(var·i·=·0;·i·<·unitCount;·i++)·{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 316| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 319| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 311| »   »   TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING");
|    | [NORMAL] JSHintBear:
|    | 'unitAI' used out of scope.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 320| »   »   TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING");
|    | [NORMAL] JSHintBear:
|    | 'unitAI' used out of scope.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 537| 537| 			if (cmpGarrisonHolder)
| 538| 538| 			{
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541|    |-				    && player != +cmd.owner)
|    | 540|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 541|+				    player != +cmd.owner)
| 542| 542| 						continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540| 540| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541| 541| 				    && player != +cmd.owner)
| 542|    |-						continue;
|    | 542|+					continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 545| 545| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1162|1162| 
|1163|1163| 	// send Metadata info if any
|1164|1164| 	if (cmd.metadata)
|1165|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1165|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1166|1166| 
|1167|1167| 	// Tell the units to start building this new entity
|1168|1168| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1162|1162| 
|1163|1163| 	// send Metadata info if any
|1164|1164| 	if (cmd.metadata)
|1165|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1165|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1166|1166| 
|1167|1167| 	// Tell the units to start building this new entity
|1168|1168| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1162|1162| 
|1163|1163| 	// send Metadata info if any
|1164|1164| 	if (cmd.metadata)
|1165|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1165|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1166|1166| 
|1167|1167| 	// Tell the units to start building this new entity
|1168|1168| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1270|1270| 		}
|1271|1271| 
|1272|1272| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1273|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1273|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1274|1274| 	}
|1275|1275| 
|1276|1276| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1334|1334| 
|1335|1335| 				if (i > 0)
|1336|1336| 				{
|1337|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1337|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1338|1338| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1339|1339| 					// TODO: ensure that cmpPreviousObstruction exists
|1340|1340| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1497|1497| 		// Check that all its members are selected
|1498|1498| 		var fid = formationIds[0];
|1499|1499| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1500|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1501|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1500|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1501|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1502|1502| 		{
|1503|1503| 			cmpFormation.DeleteTwinFormations();
|1504|1504| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1605|1605| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1606|1606| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1607|1607| 				if (matrix[i][j] < distSq)
|1608|    |-					closeClusters = [i,j];
|    |1608|+					closeClusters = [i, j];
|1609|1609| 
|1610|1610| 		// if no more close clusters found, just return all found clusters so far
|1611|1611| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1627|1627| 		}
|1628|1628| 		// remove the rows and columns in the matrix for the merged clusters,
|1629|1629| 		// and the clusters themselves from the cluster list
|1630|    |-		clusters.splice(closeClusters[0],1);
|    |1630|+		clusters.splice(closeClusters[0], 1);
|1631|1631| 		clusters.splice(closeClusters[1],1);
|1632|1632| 		matrix.splice(closeClusters[0],1);
|1633|1633| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1628|1628| 		// remove the rows and columns in the matrix for the merged clusters,
|1629|1629| 		// and the clusters themselves from the cluster list
|1630|1630| 		clusters.splice(closeClusters[0],1);
|1631|    |-		clusters.splice(closeClusters[1],1);
|    |1631|+		clusters.splice(closeClusters[1], 1);
|1632|1632| 		matrix.splice(closeClusters[0],1);
|1633|1633| 		matrix.splice(closeClusters[1],1);
|1634|1634| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1629|1629| 		// and the clusters themselves from the cluster list
|1630|1630| 		clusters.splice(closeClusters[0],1);
|1631|1631| 		clusters.splice(closeClusters[1],1);
|1632|    |-		matrix.splice(closeClusters[0],1);
|    |1632|+		matrix.splice(closeClusters[0], 1);
|1633|1633| 		matrix.splice(closeClusters[1],1);
|1634|1634| 		for (let i = 0; i < matrix.length; ++i)
|1635|1635| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1630|1630| 		clusters.splice(closeClusters[0],1);
|1631|1631| 		clusters.splice(closeClusters[1],1);
|1632|1632| 		matrix.splice(closeClusters[0],1);
|1633|    |-		matrix.splice(closeClusters[1],1);
|    |1633|+		matrix.splice(closeClusters[1], 1);
|1634|1634| 		for (let i = 0; i < matrix.length; ++i)
|1635|1635| 		{
|1636|1636| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1634|1634| 		for (let i = 0; i < matrix.length; ++i)
|1635|1635| 		{
|1636|1636| 			if (matrix[i].length > closeClusters[0])
|1637|    |-				matrix[i].splice(closeClusters[0],1);
|    |1637|+				matrix[i].splice(closeClusters[0], 1);
|1638|1638| 			if (matrix[i].length > closeClusters[1])
|1639|1639| 				matrix[i].splice(closeClusters[1],1);
|1640|1640| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1636|1636| 			if (matrix[i].length > closeClusters[0])
|1637|1637| 				matrix[i].splice(closeClusters[0],1);
|1638|1638| 			if (matrix[i].length > closeClusters[1])
|1639|    |-				matrix[i].splice(closeClusters[1],1);
|    |1639|+				matrix[i].splice(closeClusters[1], 1);
|1640|1640| 		}
|1641|1641| 		// add a new row of distances to the matrix and the new cluster
|1642|1642| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 789| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1293| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1294| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1524| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1603| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 541| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 729| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 980| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1127| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1379| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1462| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1501| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1527| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1560| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
| 801| 801| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 802| 802| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 803| 803| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 804|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 804|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 805| 805| 	}
| 806| 806| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 807| 807| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1634|1634| 			{
|1635|1635| 				minDist2 = dist2;
|1636|1636| 				minDistEntitySnapData = {
|1637|    |-						"x": pos.x,
|    |1637|+					"x": pos.x,
|1638|1638| 						"z": pos.z,
|1639|1639| 						"angle": cmpPosition.GetRotation().y,
|1640|1640| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1635|1635| 				minDist2 = dist2;
|1636|1636| 				minDistEntitySnapData = {
|1637|1637| 						"x": pos.x,
|1638|    |-						"z": pos.z,
|    |1638|+					"z": pos.z,
|1639|1639| 						"angle": cmpPosition.GetRotation().y,
|1640|1640| 						"ent": ent
|1641|1641| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1636|1636| 				minDistEntitySnapData = {
|1637|1637| 						"x": pos.x,
|1638|1638| 						"z": pos.z,
|1639|    |-						"angle": cmpPosition.GetRotation().y,
|    |1639|+					"angle": cmpPosition.GetRotation().y,
|1640|1640| 						"ent": ent
|1641|1641| 				};
|1642|1642| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
|1637|1637| 						"x": pos.x,
|1638|1638| 						"z": pos.z,
|1639|1639| 						"angle": cmpPosition.GetRotation().y,
|1640|    |-						"ent": ent
|    |1640|+					"ent": ent
|1641|1641| 				};
|1642|1642| 			}
|1643|1643| 		}
|    | [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
| 759| 759| 					this.FinishOrder();
| 760| 760| 					return;
| 761| 761| 				}
| 762|    |-				else
| 763|    |-				{
|    | 762|+				
| 764| 763| 					this.SetNextState("GARRISON.APPROACHING");
| 765| 764| 					return;
| 766|    |-				}
|    | 765|+				
| 767| 766| 			}
| 768| 767| 
| 769| 768| 			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
|1027|1027| 			},
|1028|1028| 		},
|1029|1029| 
|1030|    |-		"GARRISON":{
|    |1030|+		"GARRISON": {
|1031|1031| 			"enter": function() {
|1032|1032| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1033|1033| 				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
|1976|1976| 
|1977|1977| 				"Attacked": function(msg) {
|1978|1978| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1979|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1980|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1979|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1980|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1981|1981| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1982|1982| 				},
|1983|1983| 			},
|    | [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
|2704|2704| 					{
|2705|2705| 						// The building was already finished/fully repaired before we arrived;
|2706|2706| 						// let the ConstructionFinished handler handle this.
|2707|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2707|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2708|2708| 						return true;
|2709|2709| 					}
|2710|2710| 
|    | [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
|2704|2704| 					{
|2705|2705| 						// The building was already finished/fully repaired before we arrived;
|2706|2706| 						// let the ConstructionFinished handler handle this.
|2707|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2707|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2708|2708| 						return true;
|2709|2709| 					}
|2710|2710| 
|    | [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
|3217|3217| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3218|3218| 
|3219|3219| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3220|    |-							// only used for domestic animals
|    |3220|+		// only used for domestic animals
|3221|3221| 	},
|3222|3222| };
|3223|3223| 
|    | [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
|3275|3275| 
|3276|3276| UnitAI.prototype.IsAnimal = function()
|3277|3277| {
|3278|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3278|+	return (!!this.template.NaturalBehaviour);
|3279|3279| };
|3280|3280| 
|3281|3281| 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
|3405|3405| 		{
|3406|3406| 			let index = this.GetCurrentState().indexOf(".");
|3407|3407| 			if (index != -1)
|3408|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3408|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3409|3409| 			this.Stop(false);
|3410|3410| 		}
|3411|3411| 
|    | [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
|3461|3461| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3462|3462| 			continue;
|3463|3463| 		if (i == 0)
|3464|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3464|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3465|3465| 		else
|3466|3466| 			this.orderQueue.splice(i, 1);
|3467|3467| 		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
|3461|3461| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3462|3462| 			continue;
|3463|3463| 		if (i == 0)
|3464|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3464|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3465|3465| 		else
|3466|3466| 			this.orderQueue.splice(i, 1);
|3467|3467| 		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
|3545|3545| };
|3546|3546| 
|3547|3547| 
|3548|    |-//// FSM linkage functions ////
|    |3548|+// // FSM linkage functions ////
|3549|3549| 
|3550|3550| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3551|3551| 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
|3715|3715| 				continue;
|3716|3716| 			if (this.orderQueue[i].type == type)
|3717|3717| 				continue;
|3718|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3718|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3719|3719| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3720|3720| 			return;
|3721|3721| 		}
|    | [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
|3715|3715| 				continue;
|3716|3716| 			if (this.orderQueue[i].type == type)
|3717|3717| 				continue;
|3718|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3718|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3719|3719| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3720|3720| 			return;
|3721|3721| 		}
|    | [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
|3886|3886| 	if (data.timerRepeat === undefined)
|3887|3887| 		this.timer = undefined;
|3888|3888| 
|3889|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3889|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3890|3890| };
|3891|3891| 
|3892|3892| /**
|    | [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
|3886|3886| 	if (data.timerRepeat === undefined)
|3887|3887| 		this.timer = undefined;
|3888|3888| 
|3889|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3889|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3890|3890| };
|3891|3891| 
|3892|3892| /**
|    | [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
|3931|3931| 	// TODO: This is a bit inefficient since every unit listens to every
|3932|3932| 	// construction message - ideally we could scope it to only the one we're building
|3933|3933| 
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3931|3931| 	// TODO: This is a bit inefficient since every unit listens to every
|3932|3932| 	// construction message - ideally we could scope it to only the one we're building
|3933|3933| 
|3934|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3934|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3935|3935| };
|3936|3936| 
|3937|3937| 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
|3956|3956| 
|3957|3957| UnitAI.prototype.OnAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3959|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3960|3960| };
|3961|3961| 
|3962|3962| 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
|3956|3956| 
|3957|3957| UnitAI.prototype.OnAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3959|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3960|3960| };
|3961|3961| 
|3962|3962| 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
|3961|3961| 
|3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3964|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3965|3965| };
|3966|3966| 
|3967|3967| 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
|3961|3961| 
|3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3964|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3965|3965| };
|3966|3966| 
|3967|3967| 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
|3966|3966| 
|3967|3967| UnitAI.prototype.OnHealthChanged = function(msg)
|3968|3968| {
|3969|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3969|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3970|3970| };
|3971|3971| 
|3972|3972| 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
|3966|3966| 
|3967|3967| UnitAI.prototype.OnHealthChanged = function(msg)
|3968|3968| {
|3969|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3969|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3970|3970| };
|3971|3971| 
|3972|3972| 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
|3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg)
|3973|3973| {
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3975|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|    | [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
|3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg)
|3973|3973| {
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3975|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|    | [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
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|3975| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3974|3974| 	if (msg.tag == this.losRangeQuery)
|3975|3975| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3976|3976| 	else if (msg.tag == this.losHealRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnPackFinished = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3982|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3983|3983| };
|3984|3984| 
|3985|3985| //// 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnPackFinished = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3982|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3983|3983| };
|3984|3984| 
|3985|3985| //// 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
|3982|3982| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3983|3983| };
|3984|3984| 
|3985|    |-//// Helper functions to be called by the FSM ////
|    |3985|+// // Helper functions to be called by the FSM ////
|3986|3986| 
|3987|3987| UnitAI.prototype.GetWalkSpeed = function()
|3988|3988| {
|    | [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
|4651|4651| UnitAI.prototype.AttackEntityInZone = function(ents)
|4652|4652| {
|4653|4653| 	var target = ents.find(target =>
|4654|    |-		this.CanAttack(target)
|4655|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4654|+		this.CanAttack(target) &&
|    |4655|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4656|4656| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4657|4657| 	);
|4658|4658| 	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
|4652|4652| {
|4653|4653| 	var target = ents.find(target =>
|4654|4654| 		this.CanAttack(target)
|4655|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4656|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4655|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4656|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4657|4657| 	);
|4658|4658| 	if (!target)
|4659|4659| 		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
|4716|4716| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4717|4717| 	if (this.isGuardOf)
|4718|4718| 	{
|4719|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4719|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4720|4720| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4721|4721| 		if (cmpUnitAI && cmpAttack &&
|4722|4722| 		    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
|4720|4720| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4721|4721| 		if (cmpUnitAI && cmpAttack &&
|4722|4722| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4723|    |-				return false;
|    |4723|+			return false;
|4724|4724| 	}
|4725|4725| 
|4726|4726| 	// 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
|4758|4758| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4759|4759| 	if (this.isGuardOf)
|4760|4760| 	{
|4761|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4761|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4762|4762| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4763|4763| 		if (cmpUnitAI && cmpAttack &&
|4764|4764| 		    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
|4771|4771| 	return false;
|4772|4772| };
|4773|4773| 
|4774|    |-//// External interface functions ////
|    |4774|+// // External interface functions ////
|4775|4775| 
|4776|4776| UnitAI.prototype.SetFormationController = function(ent)
|4777|4777| {
|    | [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
|4927|4927| 	{
|4928|4928| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4929|4929| 			return;
|4930|    |-		else
|4931|    |-			this.RemoveGuard();
|    |4930|+		this.RemoveGuard();
|4932|4931| 	}
|4933|4932| 
|4934|4933| 	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
|5259|5259| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5260|5260| 	{
|5261|5261| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5262|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5262|+		if (cmpTrader.HasBothMarkets() &&
|5263|5263| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5264|5264| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5265|5265| 		{
|    | [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
|5540|5540| 				{
|5541|5541| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5542|5542| 					var targetClasses = this.order.data.targetClasses;
|5543|    |-					if (targetClasses.attack && cmpIdentity
|5544|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5543|+					if (targetClasses.attack && cmpIdentity &&
|    |5544|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5545|5545| 						continue;
|5546|5546| 					if (targetClasses.avoid && cmpIdentity
|5547|5547| 						&& 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
|5543|5543| 					if (targetClasses.attack && cmpIdentity
|5544|5544| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5545|5545| 						continue;
|5546|    |-					if (targetClasses.avoid && cmpIdentity
|5547|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5546|+					if (targetClasses.avoid && cmpIdentity &&
|    |5547|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5548|5548| 						continue;
|5549|5549| 					// Only used by the AIs to prevent some choices of targets
|5550|5550| 					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
|5566|5566| 		{
|5567|5567| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5568|5568| 			var targetClasses = this.order.data.targetClasses;
|5569|    |-			if (cmpIdentity && targetClasses.attack
|5570|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5569|+			if (cmpIdentity && targetClasses.attack &&
|    |5570|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5571|5571| 				continue;
|5572|5572| 			if (cmpIdentity && targetClasses.avoid
|5573|5573| 				&& 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
|5569|5569| 			if (cmpIdentity && targetClasses.attack
|5570|5570| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5571|5571| 				continue;
|5572|    |-			if (cmpIdentity && targetClasses.avoid
|5573|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5572|+			if (cmpIdentity && targetClasses.avoid &&
|    |5573|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5574|5574| 				continue;
|5575|5575| 			// Only used by the AIs to prevent some choices of targets
|5576|5576| 			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
|5726|5726| 
|5727|5727| UnitAI.prototype.SetHeldPosition = function(x, z)
|5728|5728| {
|5729|    |-	this.heldPosition = {"x": x, "z": z};
|    |5729|+	this.heldPosition = { "x": x, "z": z};
|5730|5730| };
|5731|5731| 
|5732|5732| 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
|5726|5726| 
|5727|5727| UnitAI.prototype.SetHeldPosition = function(x, z)
|5728|5728| {
|5729|    |-	this.heldPosition = {"x": x, "z": z};
|    |5729|+	this.heldPosition = {"x": x, "z": z };
|5730|5730| };
|5731|5731| 
|5732|5732| 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
|5753|5753| 	return false;
|5754|5754| };
|5755|5755| 
|5756|    |-//// Helper functions ////
|    |5756|+// // Helper functions ////
|5757|5757| 
|5758|5758| UnitAI.prototype.CanAttack = function(target)
|5759|5759| {
|    | [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
|5957|5957| 	return cmpPack && cmpPack.IsPacking();
|5958|5958| };
|5959|5959| 
|5960|    |-//// Formation specific functions ////
|    |5960|+// // Formation specific functions ////
|5961|5961| 
|5962|5962| UnitAI.prototype.IsAttackingAsFormation = function()
|5963|5963| {
|    | [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
|5962|5962| UnitAI.prototype.IsAttackingAsFormation = function()
|5963|5963| {
|5964|5964| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5965|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5966|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5965|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5966|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5967|5967| };
|5968|5968| 
|5969|5969| //// 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
|5966|5966| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5967|5967| };
|5968|5968| 
|5969|    |-//// Animal specific functions ////
|    |5969|+// // Animal specific functions ////
|5970|5970| 
|5971|5971| UnitAI.prototype.MoveRandomly = function(distance)
|5972|5972| {

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

binaries/data/mods/public/simulation/components/UnitAI.js
| 914| »   »   »   "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
| 939| »   »   »   "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
| 989| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1052| »   »   »   »   "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
|1088| »   »   »   "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
|1120| »   »   »   »   "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
|1280| »   »   "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
|1337| »   »   »   "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
|1512| »   »   »   "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
|1534| »   »   »   "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
|1566| »   »   »   "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
|1720| »   »   »   "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
|1770| »   »   »   »   "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
|1848| »   »   »   »   "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
|2025| »   »   »   »   "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
|2141| »   »   »   »   "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
|2416| »   »   »   »   "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
|2449| »   »   »   »   "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
|2555| »   »   »   »   "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
|2621| »   »   »   »   "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
|2660| »   »   »   »   "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
|2871| »   »   »   »   "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
|3052| »   »   »   »   "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
|3791| »   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
|4638| »   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
|4653| »   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
|4699| »   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
|4722| »   »   ····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
|1980| »   »   »   »   »   »   &&·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
|3753| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

Not necessarily, when a unit is not owned it can't be moved around, this patch allows any entity that is owned to be moved around, regardless of whether it is an animal or not.

So if I understand correctly, all units are now controllable? Is adding the <Controllable>true</Controllable> node then still necessary?

All units which are owned are controllable indeed, (except for the birds). This, however, also allows mods to script controllability (e.g. a demoralised unit becomes uncontrollable or some wandering townspeople that you may select but are not allowed to give orders).

In D1960#95830, @Nescio wrote:

So if I understand correctly, all units are now controllable? Is adding the <Controllable>true</Controllable> node then still necessary?

We can keep it iso with existing code by adding some <False> but I don't really see the point.

template_bird.xml is not an unit.
How about structures? Those have neither <Controllable>false</Controllable> nor <Controllable>true</Controllable>? I know structures can't move, but they still can get orders (attack, set rally point, ungarrison)?

That is why I had it in Identity at first ;)

In D1960#95838, @Nescio wrote:

template_bird.xml is not an unit.
How about structures? Those have neither <Controllable>false</Controllable> nor <Controllable>true</Controllable>? I know structures can't move, but they still can get orders (attack, set rally point, ungarrison)?

They don't have UnitAI, so they can't be ordered. Rally points aren't orders. Ungarrisoning could be close but atm it's not really implemented such.
BuildingAI explicitly doesn't allow the player to control stuff.

Thanks for the clarifications!

Stan added a comment.Sep 17 2019, 10:14 AM

I guess I may sound a bit weird, but thinking about it I think the comments should say can't move instead of can't walk, because units can run, and not all objects that are turrets can walk, (Just a semantic issue no more no less)

Good point! (e.g. “walking ships”)

Are the comments even necessary?

They don't have UnitAI, so they can't be ordered. Rally points aren't orders. Ungarrisoning could be close but atm it's not really implemented such.
BuildingAI explicitly doesn't allow the player to control stuff.

Unit creation, tech researching are also orders?

Freagarach updated this revision to Diff 9948.Mon, Sep 23, 4:46 PM
Freagarach retitled this revision from Move the controllability of an entity from "UnitAI.js" to "Commands.js" and untie it from whether the entity is an animal. to Move the controllability of an entity to a component..
Freagarach edited the summary of this revision. (Show Details)

Something like this, @wraitii?

Freagarach retitled this revision from Move the controllability of an entity to a component. to [WIP] - Move the controllability of an entity to a component..Mon, Sep 23, 4:47 PM

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/Controllability.js
|  82| »   »   »   »   »   this.ControllableByComponent[IID][orderType];
|    | [NORMAL] ESLintBear (no-unused-expressions):
|    | Expected an assignment or function call and instead saw an expression.

binaries/data/mods/public/simulation/components/Controllability.js
|  82| »   »   »   »   »   this.ControllableByComponent[IID][orderType];
|    | [NORMAL] JSHintBear:
|    | Expected an assignment or function call and instead saw an expression.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 537| 537| 			if (cmpGarrisonHolder)
| 538| 538| 			{
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541|    |-				    && player != +cmd.owner)
|    | 540|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 541|+				    player != +cmd.owner)
| 542| 542| 						continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 539| 539| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 540| 540| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 541| 541| 				    && player != +cmd.owner)
| 542|    |-						continue;
|    | 542|+					continue;
| 543| 543| 
| 544| 544| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 545| 545| 					notifyUnloadFailure(player, garrisonHolder);
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'metadata'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1143|1143| 
|1144|1144| 	// send Metadata info if any
|1145|1145| 	if (cmd.metadata)
|1146|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1146|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1147|1147| 
|1148|1148| 	// Tell the units to start building this new entity
|1149|1149| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'owner'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1143|1143| 
|1144|1144| 	// send Metadata info if any
|1145|1145| 	if (cmd.metadata)
|1146|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1146|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1147|1147| 
|1148|1148| 	// Tell the units to start building this new entity
|1149|1149| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1143|1143| 
|1144|1144| 	// send Metadata info if any
|1145|1145| 	if (cmd.metadata)
|1146|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1146|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1147|1147| 
|1148|1148| 	// Tell the units to start building this new entity
|1149|1149| 	if (cmd.autorepair)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1251|1251| 		}
|1252|1252| 
|1253|1253| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1254|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1254|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1255|1255| 	}
|1256|1256| 
|1257|1257| 	var i = 0;
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1315|1315| 
|1316|1316| 				if (i > 0)
|1317|1317| 				{
|1318|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1318|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1319|1319| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1320|1320| 					// TODO: ensure that cmpPreviousObstruction exists
|1321|1321| 					// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1478|1478| 		// Check that all its members are selected
|1479|1479| 		var fid = formationIds[0];
|1480|1480| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1481|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1482|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1481|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1482|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1483|1483| 		{
|1484|1484| 			cmpFormation.DeleteTwinFormations();
|1485|1485| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1586|1586| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1587|1587| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1588|1588| 				if (matrix[i][j] < distSq)
|1589|    |-					closeClusters = [i,j];
|    |1589|+					closeClusters = [i, j];
|1590|1590| 
|1591|1591| 		// if no more close clusters found, just return all found clusters so far
|1592|1592| 		if (!closeClusters)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1608|1608| 		}
|1609|1609| 		// remove the rows and columns in the matrix for the merged clusters,
|1610|1610| 		// and the clusters themselves from the cluster list
|1611|    |-		clusters.splice(closeClusters[0],1);
|    |1611|+		clusters.splice(closeClusters[0], 1);
|1612|1612| 		clusters.splice(closeClusters[1],1);
|1613|1613| 		matrix.splice(closeClusters[0],1);
|1614|1614| 		matrix.splice(closeClusters[1],1);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1609|1609| 		// remove the rows and columns in the matrix for the merged clusters,
|1610|1610| 		// and the clusters themselves from the cluster list
|1611|1611| 		clusters.splice(closeClusters[0],1);
|1612|    |-		clusters.splice(closeClusters[1],1);
|    |1612|+		clusters.splice(closeClusters[1], 1);
|1613|1613| 		matrix.splice(closeClusters[0],1);
|1614|1614| 		matrix.splice(closeClusters[1],1);
|1615|1615| 		for (let i = 0; i < matrix.length; ++i)
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1610|1610| 		// and the clusters themselves from the cluster list
|1611|1611| 		clusters.splice(closeClusters[0],1);
|1612|1612| 		clusters.splice(closeClusters[1],1);
|1613|    |-		matrix.splice(closeClusters[0],1);
|    |1613|+		matrix.splice(closeClusters[0], 1);
|1614|1614| 		matrix.splice(closeClusters[1],1);
|1615|1615| 		for (let i = 0; i < matrix.length; ++i)
|1616|1616| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1611|1611| 		clusters.splice(closeClusters[0],1);
|1612|1612| 		clusters.splice(closeClusters[1],1);
|1613|1613| 		matrix.splice(closeClusters[0],1);
|1614|    |-		matrix.splice(closeClusters[1],1);
|    |1614|+		matrix.splice(closeClusters[1], 1);
|1615|1615| 		for (let i = 0; i < matrix.length; ++i)
|1616|1616| 		{
|1617|1617| 			if (matrix[i].length > closeClusters[0])
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1615|1615| 		for (let i = 0; i < matrix.length; ++i)
|1616|1616| 		{
|1617|1617| 			if (matrix[i].length > closeClusters[0])
|1618|    |-				matrix[i].splice(closeClusters[0],1);
|    |1618|+				matrix[i].splice(closeClusters[0], 1);
|1619|1619| 			if (matrix[i].length > closeClusters[1])
|1620|1620| 				matrix[i].splice(closeClusters[1],1);
|1621|1621| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1617|1617| 			if (matrix[i].length > closeClusters[0])
|1618|1618| 				matrix[i].splice(closeClusters[0],1);
|1619|1619| 			if (matrix[i].length > closeClusters[1])
|1620|    |-				matrix[i].splice(closeClusters[1],1);
|    |1620|+				matrix[i].splice(closeClusters[1], 1);
|1621|1621| 		}
|1622|1622| 		// add a new row of distances to the matrix and the new cluster
|1623|1623| 		clusters.push(newCluster);

binaries/data/mods/public/simulation/helpers/Commands.js
|  43| »   if·(g_Commands[cmd.type])
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|  47| »   »   g_Commands[cmd.type](player,·cmd,·data);
|    | [MAJOR] ESLintBear (no-use-before-define):
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 789| »   »   let·ent·=·pickRandom(cmpRangeManager.GetEntitiesByPlayer(cmd.player).filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Commands.js
|1274| ····»   »   »   error("[TryConstructWall]·Expected·last·tower·control·group·to·be·available,·none·found·(1st·pass,·iteration·"·+·i·+·")");
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1275| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1505| »   »   »   »   var·lastFormationTemplate·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastFormationTemplate' to undefined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1584| »   »   var·closeClusters·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 541| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 729| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 961| »   »   var·count·=·0;
|    | [NORMAL] JSHintBear:
|    | 'count' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1108| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGuiInterface' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1360| »   »   var·piece·=·pieces[j];
|    | [NORMAL] JSHintBear:
|    | 'piece' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1443| »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1482| »   »   »   &&·cmpFormation.GetMemberCount()·==·formation.entities.length)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
|1508| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

binaries/data/mods/public/simulation/helpers/Commands.js
|1541| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
Executing section cli...

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

TBH I think you've over-engineered it. What's 'Order', what's 'Main' ?
I think you don't need to make something so generic. Just have 'deletable' and 'orderable' for now and handle everything from there.

Freagarach updated this revision to Diff 9986.Fri, Sep 27, 9:45 PM
Freagarach retitled this revision from [WIP] - Move the controllability of an entity to a component. to Move the controllability of an entity to a component..
Freagarach edited the summary of this revision. (Show Details)
Freagarach edited the test plan for this revision. (Show Details)
  • Simplification.
  • Use cases.

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

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

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

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

Freagarach added inline comments.Fri, Sep 27, 10:31 PM
binaries/data/mods/public/simulation/components/Capturable.js
165–172

This sounds expensive, too expensive.
We only need to change if the cp crosses a point.

Nescio removed a subscriber: Nescio.Fri, Sep 27, 10:34 PM