Page MenuHomeWildfire Games

Move the controllability of an entity to cmpIdentity.
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.
Yet this ensures people can still not move animals, although under their control, for that is a rather controversial change.

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.

Here "controllable" is defined as being able to receive *any* order from the player, not the ability to execute any one specific order.

Fixes the concern not raised at rP22446#42637.

Test Plan

Verify by playing games that normal behaviour is maintained.
If one switches to GAIA and tries to order an entity it gives a warning about not being able to controll that entity.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
SeverityLocationCodeMessage
Errorbinaries/data/mods/public/simulation/helpers/Commands.js:43ESLintBear (no-use-before-define)ESLintBear (no-use-before-define)
Errorbinaries/data/mods/public/simulation/helpers/Commands.js:47ESLintBear (no-use-before-define)ESLintBear (no-use-before-define)
Warningbinaries/data/mods/public/gui/session/unit_actions.js:548ESLintBear (key-spacing)ESLintBear (key-spacing)
Warningbinaries/data/mods/public/gui/session/unit_actions.js:593ESLintBear (semi)ESLintBear (semi)
Warningbinaries/data/mods/public/gui/session/unit_actions.js:593JSHintBearJSHintBear
Warningbinaries/data/mods/public/gui/session/unit_actions.js:635ESLintBear (default-case)ESLintBear (default-case)
Warningbinaries/data/mods/public/gui/session/unit_actions.js:1124ESLintBear (indent)ESLintBear (indent)
Warningbinaries/data/mods/public/gui/session/unit_actions.js:1641ESLintBear (indent)ESLintBear (indent)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:514ESLintBear (operator-linebreak)ESLintBear (operator-linebreak)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:515ESLintBear (indent)ESLintBear (indent)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:771ESLintBear (no-shadow)ESLintBear (no-shadow)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1149ESLintBear (key-spacing)ESLintBear (key-spacing)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1149ESLintBear (key-spacing)ESLintBear (key-spacing)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1149ESLintBear (space-in-parens)ESLintBear (space-in-parens)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1257ESLintBear (spaced-comment)ESLintBear (spaced-comment)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1277ESLintBear (no-mixed-spaces-and-tabs)ESLintBear (no-mixed-spaces-and-tabs)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1278ESLintBear (no-mixed-spaces-and-tabs)ESLintBear (no-mixed-spaces-and-tabs)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1321ESLintBear (spaced-comment)ESLintBear (spaced-comment)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1485ESLintBear (operator-linebreak)ESLintBear (operator-linebreak)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1508ESLintBear (no-undef-init)ESLintBear (no-undef-init)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1587ESLintBear (no-undef-init)ESLintBear (no-undef-init)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1592ESLintBear (comma-spacing)ESLintBear (comma-spacing)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1616ESLintBear (comma-spacing)ESLintBear (comma-spacing)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1617ESLintBear (comma-spacing)ESLintBear (comma-spacing)
Warningbinaries/data/mods/public/simulation/helpers/Commands.js:1618ESLintBear (comma-spacing)ESLintBear (comma-spacing)
Unit
No Unit Test Coverage
Build Status
Buildable 12997
Build 25623: Vulcan BuildJenkins
Build 25622: Vulcan Build (macOS)Jenkins
Build 25621: Vulcan Build (Windows)Jenkins
Build 25620: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Stan added inline comments.Jun 6 2020, 12:42 PM
binaries/data/mods/public/simulation/components/UnitAI.js
254

We don't need to check anymore?

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

I guess that sends the message you removed above?

Freagarach marked an inline comment as done.Jun 6 2020, 1:04 PM
Freagarach added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
254

Nope, since orders are caught higher up in the chain now.

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

It actualy sends it also when g_debug is false.

wraitii added inline comments.Jun 6 2020, 1:08 PM
binaries/data/mods/public/simulation/components/UnitAI.js
254

It's arguably the "feature" here, making it possible for triggers to give animals orders.

Freagarach updated this revision to Diff 12240.Jun 10 2020, 8:32 AM
Freagarach marked an inline comment as done.

Look a tad more uncontrollable.

Freagarach added inline comments.Jun 10 2020, 8:33 AM
binaries/data/mods/public/gui/session/unit_actions.js
1634

This prevents restricting the move order,,,

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
| 513| 513| 			if (cmpGarrisonHolder)
| 514| 514| 			{
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517|    |-				    && player != +cmd.owner)
|    | 516|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 517|+				    player != +cmd.owner)
| 518| 518| 						continue;
| 519| 519| 
| 520| 520| 				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
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516| 516| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517| 517| 				    && player != +cmd.owner)
| 518|    |-						continue;
|    | 518|+					continue;
| 519| 519| 
| 520| 520| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 521| 521| 					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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1257|1257| 		}
|1258|1258| 
|1259|1259| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1260|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1260|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1261|1261| 	}
|1262|1262| 
|1263|1263| 	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
|1321|1321| 
|1322|1322| 				if (i > 0)
|1323|1323| 				{
|1324|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1324|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1325|1325| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1326|1326| 					// TODO: ensure that cmpPreviousObstruction exists
|1327|1327| 					// 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
|1484|1484| 		// Check that all its members are selected
|1485|1485| 		var fid = formationIds[0];
|1486|1486| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1487|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1488|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1487|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1488|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1489|1489| 		{
|1490|1490| 			cmpFormation.DeleteTwinFormations();
|1491|1491| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1587|1587| 	while (clusters.length > 1)
|1588|1588| 	{
|1589|1589| 		// search two clusters that are closer than the required distance
|1590|    |-		let closeClusters = undefined;
|    |1590|+		let closeClusters;
|1591|1591| 
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|    | [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
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|1594|1594| 				if (matrix[i][j] < distSq)
|1595|    |-					closeClusters = [i,j];
|    |1595|+					closeClusters = [i, j];
|1596|1596| 
|1597|1597| 		// if no more close clusters found, just return all found clusters so far
|1598|1598| 		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
|1616|1616| 		}
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|    |-		clusters.splice(closeClusters[0],1);
|    |1619|+		clusters.splice(closeClusters[0], 1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		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
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|    |-		clusters.splice(closeClusters[1],1);
|    |1620|+		clusters.splice(closeClusters[1], 1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		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
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|    |-		matrix.splice(closeClusters[0],1);
|    |1621|+		matrix.splice(closeClusters[0], 1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|    | [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
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|    |-		matrix.splice(closeClusters[1],1);
|    |1622|+		matrix.splice(closeClusters[1], 1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			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
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			if (matrix[i].length > closeClusters[0])
|1626|    |-				matrix[i].splice(closeClusters[0],1);
|    |1626|+				matrix[i].splice(closeClusters[0], 1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|1628| 				matrix[i].splice(closeClusters[1],1);
|1629|1629| 		}
|    | [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| 			if (matrix[i].length > closeClusters[0])
|1626|1626| 				matrix[i].splice(closeClusters[0],1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|    |-				matrix[i].splice(closeClusters[1],1);
|    |1628|+				matrix[i].splice(closeClusters[1], 1);
|1629|1629| 		}
|1630|1630| 		// add a new row of distances to the matrix and the new cluster
|1631|1631| 		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
| 774| »   »   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
|1280| ····»   »   »   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
|1281| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1511| »   »   »   »   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
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 517| »   »   »   »   ····&&·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
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1488| »   »   »   &&·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
|1514| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1590| »   »   let·closeClusters·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'closeClusters' to 'undefined'.
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'execute'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 532| 532| 
| 533| 533| 	"cancel-setup-trade-route":
| 534| 534| 	{
| 535|    |-		"execute":function(target, action, selection, queued)
|    | 535|+		"execute": function(target, action, selection, queued)
| 536| 536| 		{
| 537| 537| 			Engine.PostNetworkCommand({
| 538| 538| 				"type": "cancel-setup-trade-route",
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 580| 580| 				"cursor": "action-cancel-setup-trade-route",
| 581| 581| 				"tooltip": actionInfo.tooltip,
| 582| 582| 				"target": target
| 583|    |-			}
|    | 583|+			};
| 584| 584| 		},
| 585| 585| 		"specificness": 2,
| 586| 586| 	},

binaries/data/mods/public/gui/session/unit_actions.js
| 628| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
| 583| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1046|1046| 			},
|1047|1047| 		},
|1048|1048| 
|1049|    |-		"GARRISON":{
|    |1049|+		"GARRISON": {
|1050|1050| 			"APPROACHING": {
|1051|1051| 				"enter": function() {
|1052|1052| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [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
|2175|2175| 					"MovementUpdate": function(msg) {
|2176|2176| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2177|2177| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2178|    |-						if (msg.likelyFailure || 
|    |2178|+						if (msg.likelyFailure ||
|2179|2179| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2180|2180| 							!msg.obstructed && this.CheckRange(this.order.data))
|2181|2181| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2478|2478| 
|2479|2479| 								return type.specific == resourceType.specific &&
|2480|2480| 								    (type.specific != "meat" || resourceTemplate == template);
|2481|    |-						});
|    |2481|+							});
|2482|2482| 
|2483|2483| 						if (nearbyResource)
|2484|2484| 						{
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				this.StopTimer();
|3101|3101| 				this.ResetAnimation();
|3102|3102| 				if (this.formationAnimationVariant)
|3103|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3103|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3104|3104| 				else
|3105|3105| 					this.SetDefaultAnimationVariant();
|3106|3106| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3326|3326| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3327|3327| 
|3328|3328| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3329|    |-							// only used for domestic animals
|    |3329|+		// only used for domestic animals
|3330|3330| 
|3331|3331| 		// Reuse the same garrison behaviour for animals.
|3332|3332| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3378|3378| 
|3379|3379| UnitAI.prototype.IsAnimal = function()
|3380|3380| {
|3381|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3381|+	return (!!this.template.NaturalBehaviour);
|3382|3382| };
|3383|3383| 
|3384|3384| 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
|3518|3518| 		{
|3519|3519| 			let index = this.GetCurrentState().indexOf(".");
|3520|3520| 			if (index != -1)
|3521|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3521|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3522|3522| 			this.Stop(false);
|3523|3523| 		}
|3524|3524| 
|    | [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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3661|3661| };
|3662|3662| 
|3663|3663| 
|3664|    |-//// FSM linkage functions ////
|    |3664|+// // FSM linkage functions ////
|3665|3665| 
|3666|3666| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3667|3667| 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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4184|4184| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|    |-//// Helper functions to be called by the FSM ////
|    |4187|+// // Helper functions to be called by the FSM ////
|4188|4188| 
|4189|4189| UnitAI.prototype.GetWalkSpeed = function()
|4190|4190| {
|    | [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
|4914|4914| UnitAI.prototype.AttackEntityInZone = function(ents)
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|    |-		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4917|+		this.CanAttack(target) &&
|    |4918|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|4919| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	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
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|4917| 		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4918|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4919|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	if (!target)
|4922|4922| 		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
|4981|4981| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4982|4982| 	if (this.isGuardOf)
|4983|4983| 	{
|4984|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4984|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    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
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4988|    |-				return false;
|    |4988|+			return false;
|4989|4989| 	}
|4990|4990| 
|4991|4991| 	// 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
|5023|5023| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    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
|5036|5036| 	return false;
|5037|5037| };
|5038|5038| 
|5039|    |-//// External interface functions ////
|    |5039|+// // External interface functions ////
|5040|5040| 
|5041|5041| UnitAI.prototype.SetFormationController = function(ent)
|5042|5042| {
|    | [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
|5192|5192| 	{
|5193|5193| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5194|5194| 			return;
|5195|    |-		else
|5196|    |-			this.RemoveGuard();
|    |5195|+		this.RemoveGuard();
|5197|5196| 	}
|5198|5197| 
|5199|5198| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5526|5526| 
|5527|5527| 	if (this.IsFormationController())
|5528|5528| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5529|    |-}
|    |5529|+};
|5530|5530| /**
|5531|5531|  * Adds trade order to the queue. Either walk to the first market, or
|5532|5532|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5547|5547| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5548|5548| 	{
|5549|5549| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5550|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5550|+		if (cmpTrader.HasBothMarkets() &&
|5551|5551| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5552|5552| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5553|5553| 		{
|    | [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
|5828|5828| 				{
|5829|5829| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5830|5830| 					var targetClasses = this.order.data.targetClasses;
|5831|    |-					if (targetClasses.attack && cmpIdentity
|5832|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5831|+					if (targetClasses.attack && cmpIdentity &&
|    |5832|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|5834| 					if (targetClasses.avoid && cmpIdentity
|5835|5835| 						&& 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
|5831|5831| 					if (targetClasses.attack && cmpIdentity
|5832|5832| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|    |-					if (targetClasses.avoid && cmpIdentity
|5835|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5834|+					if (targetClasses.avoid && cmpIdentity &&
|    |5835|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5836|5836| 						continue;
|5837|5837| 					// Only used by the AIs to prevent some choices of targets
|5838|5838| 					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
|5854|5854| 		{
|5855|5855| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5856|5856| 			var targetClasses = this.order.data.targetClasses;
|5857|    |-			if (cmpIdentity && targetClasses.attack
|5858|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5857|+			if (cmpIdentity && targetClasses.attack &&
|    |5858|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|5860| 			if (cmpIdentity && targetClasses.avoid
|5861|5861| 				&& 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
|5857|5857| 			if (cmpIdentity && targetClasses.attack
|5858|5858| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|    |-			if (cmpIdentity && targetClasses.avoid
|5861|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5860|+			if (cmpIdentity && targetClasses.avoid &&
|    |5861|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5862|5862| 				continue;
|5863|5863| 			// Only used by the AIs to prevent some choices of targets
|5864|5864| 			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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = { "x": x, "z": z};
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = {"x": x, "z": z };
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6044|6044| 	return false;
|6045|6045| };
|6046|6046| 
|6047|    |-//// Helper functions ////
|    |6047|+// // Helper functions ////
|6048|6048| 
|6049|6049| /**
|6050|6050|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6063|6063| 		return undefined;
|6064|6064| 
|6065|6065| 	return component.GetRange(type);
|6066|    |-}
|    |6066|+};
|6067|6067| 
|6068|6068| UnitAI.prototype.CanAttack = function(target)
|6069|6069| {
|    | [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
|6239|6239| 	return cmpPack && cmpPack.IsPacking();
|6240|6240| };
|6241|6241| 
|6242|    |-//// Formation specific functions ////
|    |6242|+// // Formation specific functions ////
|6243|6243| 
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|    | [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
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|6246|6246| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6247|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6248|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6247|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6248|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|6251| //// 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
|6248|6248| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|    |-//// Animal specific functions ////
|    |6251|+// // Animal specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.MoveRandomly = function(distance)
|6254|6254| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3979| »   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
|4901| »   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
|4916| »   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
|4964| »   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
|4987| »   »   ····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
|2020| »   »   »   »   »   »   &&·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
|3103| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

Freagarach marked an inline comment as done.Jun 10 2020, 6:26 PM
Freagarach added inline comments.
binaries/data/mods/public/simulation/components/Identity.js
201

We could do something like garrisonable does, namely keeping track of who set us to uncontrollable?

wraitii added inline comments.Jun 11 2020, 6:04 PM
binaries/data/mods/public/gui/session/unit_actions.js
1634

It seems to me you could just put the controllable check in this function. Then you don't have to add it everywhere, and you can still restrict the move order.

Freagarach added inline comments.Jun 11 2020, 6:34 PM
binaries/data/mods/public/gui/session/unit_actions.js
1634

Filter the entities which cannot be controlled?

wraitii added inline comments.Jun 11 2020, 6:40 PM
binaries/data/mods/public/gui/session/unit_actions.js
1634

Yeah that would probably do the trick. I can't foresee a good reason why it wouldn't work, but maybe there's one

Freagarach added inline comments.Jun 11 2020, 7:45 PM
binaries/data/mods/public/gui/session/unit_actions.js
1634

Well, there is quite a performance impact,,, (50 - 300 µs per tick.)

wraitii added inline comments.Jun 12 2020, 8:43 AM
binaries/data/mods/public/gui/session/unit_actions.js
1634

How is that different when doing it in the orders? We're still iterating over all entities in the loop below.

It's fine if you have to repeat the code a few times for different code paths.

Freagarach updated this revision to Diff 12254.Jun 12 2020, 8:47 AM

Filter uncontrollable entities.

binaries/data/mods/public/gui/session/unit_actions.js
1634

It is different because one has to do it twice now ^^

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
| 513| 513| 			if (cmpGarrisonHolder)
| 514| 514| 			{
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517|    |-				    && player != +cmd.owner)
|    | 516|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 517|+				    player != +cmd.owner)
| 518| 518| 						continue;
| 519| 519| 
| 520| 520| 				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
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516| 516| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517| 517| 				    && player != +cmd.owner)
| 518|    |-						continue;
|    | 518|+					continue;
| 519| 519| 
| 520| 520| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 521| 521| 					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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1257|1257| 		}
|1258|1258| 
|1259|1259| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1260|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1260|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1261|1261| 	}
|1262|1262| 
|1263|1263| 	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
|1321|1321| 
|1322|1322| 				if (i > 0)
|1323|1323| 				{
|1324|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1324|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1325|1325| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1326|1326| 					// TODO: ensure that cmpPreviousObstruction exists
|1327|1327| 					// 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
|1484|1484| 		// Check that all its members are selected
|1485|1485| 		var fid = formationIds[0];
|1486|1486| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1487|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1488|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1487|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1488|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1489|1489| 		{
|1490|1490| 			cmpFormation.DeleteTwinFormations();
|1491|1491| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1587|1587| 	while (clusters.length > 1)
|1588|1588| 	{
|1589|1589| 		// search two clusters that are closer than the required distance
|1590|    |-		let closeClusters = undefined;
|    |1590|+		let closeClusters;
|1591|1591| 
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|    | [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
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|1594|1594| 				if (matrix[i][j] < distSq)
|1595|    |-					closeClusters = [i,j];
|    |1595|+					closeClusters = [i, j];
|1596|1596| 
|1597|1597| 		// if no more close clusters found, just return all found clusters so far
|1598|1598| 		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
|1616|1616| 		}
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|    |-		clusters.splice(closeClusters[0],1);
|    |1619|+		clusters.splice(closeClusters[0], 1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		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
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|    |-		clusters.splice(closeClusters[1],1);
|    |1620|+		clusters.splice(closeClusters[1], 1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		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
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|    |-		matrix.splice(closeClusters[0],1);
|    |1621|+		matrix.splice(closeClusters[0], 1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|    | [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
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|    |-		matrix.splice(closeClusters[1],1);
|    |1622|+		matrix.splice(closeClusters[1], 1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			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
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			if (matrix[i].length > closeClusters[0])
|1626|    |-				matrix[i].splice(closeClusters[0],1);
|    |1626|+				matrix[i].splice(closeClusters[0], 1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|1628| 				matrix[i].splice(closeClusters[1],1);
|1629|1629| 		}
|    | [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| 			if (matrix[i].length > closeClusters[0])
|1626|1626| 				matrix[i].splice(closeClusters[0],1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|    |-				matrix[i].splice(closeClusters[1],1);
|    |1628|+				matrix[i].splice(closeClusters[1], 1);
|1629|1629| 		}
|1630|1630| 		// add a new row of distances to the matrix and the new cluster
|1631|1631| 		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
| 774| »   »   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
|1280| ····»   »   »   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
|1281| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1511| »   »   »   »   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
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 517| »   »   »   »   ····&&·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
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1488| »   »   »   &&·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
|1514| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1590| »   »   let·closeClusters·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'closeClusters' to 'undefined'.
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'execute'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 530| 530| 
| 531| 531| 	"cancel-setup-trade-route":
| 532| 532| 	{
| 533|    |-		"execute":function(target, action, selection, queued)
|    | 533|+		"execute": function(target, action, selection, queued)
| 534| 534| 		{
| 535| 535| 			Engine.PostNetworkCommand({
| 536| 536| 				"type": "cancel-setup-trade-route",
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 575| 575| 				"cursor": "action-cancel-setup-trade-route",
| 576| 576| 				"tooltip": actionInfo.tooltip,
| 577| 577| 				"target": target
| 578|    |-			}
|    | 578|+			};
| 579| 579| 		},
| 580| 580| 		"specificness": 2,
| 581| 581| 	},

binaries/data/mods/public/gui/session/unit_actions.js
| 620| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
| 578| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1046|1046| 			},
|1047|1047| 		},
|1048|1048| 
|1049|    |-		"GARRISON":{
|    |1049|+		"GARRISON": {
|1050|1050| 			"APPROACHING": {
|1051|1051| 				"enter": function() {
|1052|1052| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [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
|2175|2175| 					"MovementUpdate": function(msg) {
|2176|2176| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2177|2177| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2178|    |-						if (msg.likelyFailure || 
|    |2178|+						if (msg.likelyFailure ||
|2179|2179| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2180|2180| 							!msg.obstructed && this.CheckRange(this.order.data))
|2181|2181| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2478|2478| 
|2479|2479| 								return type.specific == resourceType.specific &&
|2480|2480| 								    (type.specific != "meat" || resourceTemplate == template);
|2481|    |-						});
|    |2481|+							});
|2482|2482| 
|2483|2483| 						if (nearbyResource)
|2484|2484| 						{
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				this.StopTimer();
|3101|3101| 				this.ResetAnimation();
|3102|3102| 				if (this.formationAnimationVariant)
|3103|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3103|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3104|3104| 				else
|3105|3105| 					this.SetDefaultAnimationVariant();
|3106|3106| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3326|3326| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3327|3327| 
|3328|3328| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3329|    |-							// only used for domestic animals
|    |3329|+		// only used for domestic animals
|3330|3330| 
|3331|3331| 		// Reuse the same garrison behaviour for animals.
|3332|3332| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3378|3378| 
|3379|3379| UnitAI.prototype.IsAnimal = function()
|3380|3380| {
|3381|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3381|+	return (!!this.template.NaturalBehaviour);
|3382|3382| };
|3383|3383| 
|3384|3384| 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
|3518|3518| 		{
|3519|3519| 			let index = this.GetCurrentState().indexOf(".");
|3520|3520| 			if (index != -1)
|3521|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3521|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3522|3522| 			this.Stop(false);
|3523|3523| 		}
|3524|3524| 
|    | [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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3661|3661| };
|3662|3662| 
|3663|3663| 
|3664|    |-//// FSM linkage functions ////
|    |3664|+// // FSM linkage functions ////
|3665|3665| 
|3666|3666| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3667|3667| 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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4184|4184| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|    |-//// Helper functions to be called by the FSM ////
|    |4187|+// // Helper functions to be called by the FSM ////
|4188|4188| 
|4189|4189| UnitAI.prototype.GetWalkSpeed = function()
|4190|4190| {
|    | [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
|4914|4914| UnitAI.prototype.AttackEntityInZone = function(ents)
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|    |-		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4917|+		this.CanAttack(target) &&
|    |4918|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|4919| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	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
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|4917| 		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4918|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4919|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	if (!target)
|4922|4922| 		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
|4981|4981| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4982|4982| 	if (this.isGuardOf)
|4983|4983| 	{
|4984|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4984|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    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
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4988|    |-				return false;
|    |4988|+			return false;
|4989|4989| 	}
|4990|4990| 
|4991|4991| 	// 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
|5023|5023| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    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
|5036|5036| 	return false;
|5037|5037| };
|5038|5038| 
|5039|    |-//// External interface functions ////
|    |5039|+// // External interface functions ////
|5040|5040| 
|5041|5041| UnitAI.prototype.SetFormationController = function(ent)
|5042|5042| {
|    | [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
|5192|5192| 	{
|5193|5193| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5194|5194| 			return;
|5195|    |-		else
|5196|    |-			this.RemoveGuard();
|    |5195|+		this.RemoveGuard();
|5197|5196| 	}
|5198|5197| 
|5199|5198| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5526|5526| 
|5527|5527| 	if (this.IsFormationController())
|5528|5528| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5529|    |-}
|    |5529|+};
|5530|5530| /**
|5531|5531|  * Adds trade order to the queue. Either walk to the first market, or
|5532|5532|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5547|5547| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5548|5548| 	{
|5549|5549| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5550|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5550|+		if (cmpTrader.HasBothMarkets() &&
|5551|5551| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5552|5552| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5553|5553| 		{
|    | [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
|5828|5828| 				{
|5829|5829| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5830|5830| 					var targetClasses = this.order.data.targetClasses;
|5831|    |-					if (targetClasses.attack && cmpIdentity
|5832|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5831|+					if (targetClasses.attack && cmpIdentity &&
|    |5832|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|5834| 					if (targetClasses.avoid && cmpIdentity
|5835|5835| 						&& 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
|5831|5831| 					if (targetClasses.attack && cmpIdentity
|5832|5832| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|    |-					if (targetClasses.avoid && cmpIdentity
|5835|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5834|+					if (targetClasses.avoid && cmpIdentity &&
|    |5835|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5836|5836| 						continue;
|5837|5837| 					// Only used by the AIs to prevent some choices of targets
|5838|5838| 					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
|5854|5854| 		{
|5855|5855| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5856|5856| 			var targetClasses = this.order.data.targetClasses;
|5857|    |-			if (cmpIdentity && targetClasses.attack
|5858|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5857|+			if (cmpIdentity && targetClasses.attack &&
|    |5858|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|5860| 			if (cmpIdentity && targetClasses.avoid
|5861|5861| 				&& 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
|5857|5857| 			if (cmpIdentity && targetClasses.attack
|5858|5858| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|    |-			if (cmpIdentity && targetClasses.avoid
|5861|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5860|+			if (cmpIdentity && targetClasses.avoid &&
|    |5861|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5862|5862| 				continue;
|5863|5863| 			// Only used by the AIs to prevent some choices of targets
|5864|5864| 			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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = { "x": x, "z": z};
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = {"x": x, "z": z };
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6044|6044| 	return false;
|6045|6045| };
|6046|6046| 
|6047|    |-//// Helper functions ////
|    |6047|+// // Helper functions ////
|6048|6048| 
|6049|6049| /**
|6050|6050|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6063|6063| 		return undefined;
|6064|6064| 
|6065|6065| 	return component.GetRange(type);
|6066|    |-}
|    |6066|+};
|6067|6067| 
|6068|6068| UnitAI.prototype.CanAttack = function(target)
|6069|6069| {
|    | [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
|6239|6239| 	return cmpPack && cmpPack.IsPacking();
|6240|6240| };
|6241|6241| 
|6242|    |-//// Formation specific functions ////
|    |6242|+// // Formation specific functions ////
|6243|6243| 
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|    | [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
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|6246|6246| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6247|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6248|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6247|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6248|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|6251| //// 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
|6248|6248| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|    |-//// Animal specific functions ////
|    |6251|+// // Animal specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.MoveRandomly = function(distance)
|6254|6254| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3979| »   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
|4901| »   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
|4916| »   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
|4964| »   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
|4987| »   »   ····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
|2020| »   »   »   »   »   »   &&·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
|3103| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

Freagarach updated this revision to Diff 12256.Jun 12 2020, 9:52 AM

Check only at necessary places to avoid double looping.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'execute'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 530| 530| 
| 531| 531| 	"cancel-setup-trade-route":
| 532| 532| 	{
| 533|    |-		"execute":function(target, action, selection, queued)
|    | 533|+		"execute": function(target, action, selection, queued)
| 534| 534| 		{
| 535| 535| 			Engine.PostNetworkCommand({
| 536| 536| 				"type": "cancel-setup-trade-route",
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 575| 575| 				"cursor": "action-cancel-setup-trade-route",
| 576| 576| 				"tooltip": actionInfo.tooltip,
| 577| 577| 				"target": target
| 578|    |-			}
|    | 578|+			};
| 579| 579| 		},
| 580| 580| 		"specificness": 2,
| 581| 581| 	},

binaries/data/mods/public/gui/session/unit_actions.js
| 620| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
| 578| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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
| 513| 513| 			if (cmpGarrisonHolder)
| 514| 514| 			{
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517|    |-				    && player != +cmd.owner)
|    | 516|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 517|+				    player != +cmd.owner)
| 518| 518| 						continue;
| 519| 519| 
| 520| 520| 				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
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516| 516| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517| 517| 				    && player != +cmd.owner)
| 518|    |-						continue;
|    | 518|+					continue;
| 519| 519| 
| 520| 520| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 521| 521| 					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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1257|1257| 		}
|1258|1258| 
|1259|1259| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1260|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1260|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1261|1261| 	}
|1262|1262| 
|1263|1263| 	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
|1321|1321| 
|1322|1322| 				if (i > 0)
|1323|1323| 				{
|1324|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1324|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1325|1325| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1326|1326| 					// TODO: ensure that cmpPreviousObstruction exists
|1327|1327| 					// 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
|1484|1484| 		// Check that all its members are selected
|1485|1485| 		var fid = formationIds[0];
|1486|1486| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1487|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1488|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1487|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1488|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1489|1489| 		{
|1490|1490| 			cmpFormation.DeleteTwinFormations();
|1491|1491| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1587|1587| 	while (clusters.length > 1)
|1588|1588| 	{
|1589|1589| 		// search two clusters that are closer than the required distance
|1590|    |-		let closeClusters = undefined;
|    |1590|+		let closeClusters;
|1591|1591| 
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|    | [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
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|1594|1594| 				if (matrix[i][j] < distSq)
|1595|    |-					closeClusters = [i,j];
|    |1595|+					closeClusters = [i, j];
|1596|1596| 
|1597|1597| 		// if no more close clusters found, just return all found clusters so far
|1598|1598| 		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
|1616|1616| 		}
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|    |-		clusters.splice(closeClusters[0],1);
|    |1619|+		clusters.splice(closeClusters[0], 1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		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
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|    |-		clusters.splice(closeClusters[1],1);
|    |1620|+		clusters.splice(closeClusters[1], 1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		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
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|    |-		matrix.splice(closeClusters[0],1);
|    |1621|+		matrix.splice(closeClusters[0], 1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|    | [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
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|    |-		matrix.splice(closeClusters[1],1);
|    |1622|+		matrix.splice(closeClusters[1], 1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			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
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			if (matrix[i].length > closeClusters[0])
|1626|    |-				matrix[i].splice(closeClusters[0],1);
|    |1626|+				matrix[i].splice(closeClusters[0], 1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|1628| 				matrix[i].splice(closeClusters[1],1);
|1629|1629| 		}
|    | [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| 			if (matrix[i].length > closeClusters[0])
|1626|1626| 				matrix[i].splice(closeClusters[0],1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|    |-				matrix[i].splice(closeClusters[1],1);
|    |1628|+				matrix[i].splice(closeClusters[1], 1);
|1629|1629| 		}
|1630|1630| 		// add a new row of distances to the matrix and the new cluster
|1631|1631| 		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
| 774| »   »   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
|1280| ····»   »   »   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
|1281| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1511| »   »   »   »   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
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 517| »   »   »   »   ····&&·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
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1488| »   »   »   &&·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
|1514| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1590| »   »   let·closeClusters·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'closeClusters' to 'undefined'.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1046|1046| 			},
|1047|1047| 		},
|1048|1048| 
|1049|    |-		"GARRISON":{
|    |1049|+		"GARRISON": {
|1050|1050| 			"APPROACHING": {
|1051|1051| 				"enter": function() {
|1052|1052| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [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
|2175|2175| 					"MovementUpdate": function(msg) {
|2176|2176| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2177|2177| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2178|    |-						if (msg.likelyFailure || 
|    |2178|+						if (msg.likelyFailure ||
|2179|2179| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2180|2180| 							!msg.obstructed && this.CheckRange(this.order.data))
|2181|2181| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2478|2478| 
|2479|2479| 								return type.specific == resourceType.specific &&
|2480|2480| 								    (type.specific != "meat" || resourceTemplate == template);
|2481|    |-						});
|    |2481|+							});
|2482|2482| 
|2483|2483| 						if (nearbyResource)
|2484|2484| 						{
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				this.StopTimer();
|3101|3101| 				this.ResetAnimation();
|3102|3102| 				if (this.formationAnimationVariant)
|3103|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3103|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3104|3104| 				else
|3105|3105| 					this.SetDefaultAnimationVariant();
|3106|3106| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3326|3326| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3327|3327| 
|3328|3328| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3329|    |-							// only used for domestic animals
|    |3329|+		// only used for domestic animals
|3330|3330| 
|3331|3331| 		// Reuse the same garrison behaviour for animals.
|3332|3332| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3378|3378| 
|3379|3379| UnitAI.prototype.IsAnimal = function()
|3380|3380| {
|3381|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3381|+	return (!!this.template.NaturalBehaviour);
|3382|3382| };
|3383|3383| 
|3384|3384| 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
|3518|3518| 		{
|3519|3519| 			let index = this.GetCurrentState().indexOf(".");
|3520|3520| 			if (index != -1)
|3521|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3521|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3522|3522| 			this.Stop(false);
|3523|3523| 		}
|3524|3524| 
|    | [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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3661|3661| };
|3662|3662| 
|3663|3663| 
|3664|    |-//// FSM linkage functions ////
|    |3664|+// // FSM linkage functions ////
|3665|3665| 
|3666|3666| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3667|3667| 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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4184|4184| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|    |-//// Helper functions to be called by the FSM ////
|    |4187|+// // Helper functions to be called by the FSM ////
|4188|4188| 
|4189|4189| UnitAI.prototype.GetWalkSpeed = function()
|4190|4190| {
|    | [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
|4914|4914| UnitAI.prototype.AttackEntityInZone = function(ents)
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|    |-		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4917|+		this.CanAttack(target) &&
|    |4918|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|4919| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	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
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|4917| 		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4918|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4919|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	if (!target)
|4922|4922| 		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
|4981|4981| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4982|4982| 	if (this.isGuardOf)
|4983|4983| 	{
|4984|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4984|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    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
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4988|    |-				return false;
|    |4988|+			return false;
|4989|4989| 	}
|4990|4990| 
|4991|4991| 	// 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
|5023|5023| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    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
|5036|5036| 	return false;
|5037|5037| };
|5038|5038| 
|5039|    |-//// External interface functions ////
|    |5039|+// // External interface functions ////
|5040|5040| 
|5041|5041| UnitAI.prototype.SetFormationController = function(ent)
|5042|5042| {
|    | [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
|5192|5192| 	{
|5193|5193| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5194|5194| 			return;
|5195|    |-		else
|5196|    |-			this.RemoveGuard();
|    |5195|+		this.RemoveGuard();
|5197|5196| 	}
|5198|5197| 
|5199|5198| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5526|5526| 
|5527|5527| 	if (this.IsFormationController())
|5528|5528| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5529|    |-}
|    |5529|+};
|5530|5530| /**
|5531|5531|  * Adds trade order to the queue. Either walk to the first market, or
|5532|5532|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5547|5547| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5548|5548| 	{
|5549|5549| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5550|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5550|+		if (cmpTrader.HasBothMarkets() &&
|5551|5551| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5552|5552| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5553|5553| 		{
|    | [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
|5828|5828| 				{
|5829|5829| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5830|5830| 					var targetClasses = this.order.data.targetClasses;
|5831|    |-					if (targetClasses.attack && cmpIdentity
|5832|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5831|+					if (targetClasses.attack && cmpIdentity &&
|    |5832|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|5834| 					if (targetClasses.avoid && cmpIdentity
|5835|5835| 						&& 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
|5831|5831| 					if (targetClasses.attack && cmpIdentity
|5832|5832| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|    |-					if (targetClasses.avoid && cmpIdentity
|5835|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5834|+					if (targetClasses.avoid && cmpIdentity &&
|    |5835|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5836|5836| 						continue;
|5837|5837| 					// Only used by the AIs to prevent some choices of targets
|5838|5838| 					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
|5854|5854| 		{
|5855|5855| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5856|5856| 			var targetClasses = this.order.data.targetClasses;
|5857|    |-			if (cmpIdentity && targetClasses.attack
|5858|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5857|+			if (cmpIdentity && targetClasses.attack &&
|    |5858|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|5860| 			if (cmpIdentity && targetClasses.avoid
|5861|5861| 				&& 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
|5857|5857| 			if (cmpIdentity && targetClasses.attack
|5858|5858| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|    |-			if (cmpIdentity && targetClasses.avoid
|5861|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5860|+			if (cmpIdentity && targetClasses.avoid &&
|    |5861|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5862|5862| 				continue;
|5863|5863| 			// Only used by the AIs to prevent some choices of targets
|5864|5864| 			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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = { "x": x, "z": z};
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = {"x": x, "z": z };
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6044|6044| 	return false;
|6045|6045| };
|6046|6046| 
|6047|    |-//// Helper functions ////
|    |6047|+// // Helper functions ////
|6048|6048| 
|6049|6049| /**
|6050|6050|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6063|6063| 		return undefined;
|6064|6064| 
|6065|6065| 	return component.GetRange(type);
|6066|    |-}
|    |6066|+};
|6067|6067| 
|6068|6068| UnitAI.prototype.CanAttack = function(target)
|6069|6069| {
|    | [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
|6239|6239| 	return cmpPack && cmpPack.IsPacking();
|6240|6240| };
|6241|6241| 
|6242|    |-//// Formation specific functions ////
|    |6242|+// // Formation specific functions ////
|6243|6243| 
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|    | [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
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|6246|6246| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6247|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6248|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6247|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6248|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|6251| //// 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
|6248|6248| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|    |-//// Animal specific functions ////
|    |6251|+// // Animal specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.MoveRandomly = function(distance)
|6254|6254| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3979| »   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
|4901| »   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
|4916| »   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
|4964| »   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
|4987| »   »   ····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
|2020| »   »   »   »   »   »   &&·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
|3103| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

Stan added inline comments.Jun 12 2020, 10:06 AM
binaries/data/mods/public/gui/session/unit_actions.js
1680

I wonder if we could compute only if we need it.

something like;

let simState = null;
if (selection.some(s => 
{
  if (!entState || !entState.identity.controllable)
   return false;

  return (g_UnitActions[action] && g_UnitActions[action].getActionInfo);
}))
    let simState = GetSimState();

But that requires going through the loop twice. Maybe it's faster than getting the simstate dunno.

wraitii requested changes to this revision.Jun 12 2020, 10:17 AM

Mh, now you don't get the warning that the entities can't be controlled :p

You _might_ want to add something to the GUI, like a "no" cursor type, and maybe a tooltip. Still it's a better solution than what we had before imo.
(you do need to keep the checks in commands.js for MP cheats reasons)

binaries/data/mods/public/gui/session/unit_actions.js
1680

It's quite likely that we'll have at least one entity with a GetActionInfo, particularly if we have man entities, so I think it's a pessimisation in general.

This revision now requires changes to proceed.Jun 12 2020, 10:17 AM
Freagarach marked 4 inline comments as done.

Verify whether selection exists, while at at.

binaries/data/mods/public/gui/session/unit_actions.js
1680

Simstate costs between 1 and 5 microseconds.

Freagarach marked an inline comment as done.Jun 12 2020, 10:18 AM

But if you have a bunch of units of which one is not controllable, you won't see the cursor anyways?

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'execute'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 530| 530| 
| 531| 531| 	"cancel-setup-trade-route":
| 532| 532| 	{
| 533|    |-		"execute":function(target, action, selection, queued)
|    | 533|+		"execute": function(target, action, selection, queued)
| 534| 534| 		{
| 535| 535| 			Engine.PostNetworkCommand({
| 536| 536| 				"type": "cancel-setup-trade-route",
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 575| 575| 				"cursor": "action-cancel-setup-trade-route",
| 576| 576| 				"tooltip": actionInfo.tooltip,
| 577| 577| 				"target": target
| 578|    |-			}
|    | 578|+			};
| 579| 579| 		},
| 580| 580| 		"specificness": 2,
| 581| 581| 	},

binaries/data/mods/public/gui/session/unit_actions.js
| 620| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
| 578| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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
| 513| 513| 			if (cmpGarrisonHolder)
| 514| 514| 			{
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517|    |-				    && player != +cmd.owner)
|    | 516|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 517|+				    player != +cmd.owner)
| 518| 518| 						continue;
| 519| 519| 
| 520| 520| 				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
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516| 516| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517| 517| 				    && player != +cmd.owner)
| 518|    |-						continue;
|    | 518|+					continue;
| 519| 519| 
| 520| 520| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 521| 521| 					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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1257|1257| 		}
|1258|1258| 
|1259|1259| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1260|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1260|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1261|1261| 	}
|1262|1262| 
|1263|1263| 	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
|1321|1321| 
|1322|1322| 				if (i > 0)
|1323|1323| 				{
|1324|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1324|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1325|1325| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1326|1326| 					// TODO: ensure that cmpPreviousObstruction exists
|1327|1327| 					// 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
|1484|1484| 		// Check that all its members are selected
|1485|1485| 		var fid = formationIds[0];
|1486|1486| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1487|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1488|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1487|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1488|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1489|1489| 		{
|1490|1490| 			cmpFormation.DeleteTwinFormations();
|1491|1491| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1587|1587| 	while (clusters.length > 1)
|1588|1588| 	{
|1589|1589| 		// search two clusters that are closer than the required distance
|1590|    |-		let closeClusters = undefined;
|    |1590|+		let closeClusters;
|1591|1591| 
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|    | [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
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|1594|1594| 				if (matrix[i][j] < distSq)
|1595|    |-					closeClusters = [i,j];
|    |1595|+					closeClusters = [i, j];
|1596|1596| 
|1597|1597| 		// if no more close clusters found, just return all found clusters so far
|1598|1598| 		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
|1616|1616| 		}
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|    |-		clusters.splice(closeClusters[0],1);
|    |1619|+		clusters.splice(closeClusters[0], 1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		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
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|    |-		clusters.splice(closeClusters[1],1);
|    |1620|+		clusters.splice(closeClusters[1], 1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		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
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|    |-		matrix.splice(closeClusters[0],1);
|    |1621|+		matrix.splice(closeClusters[0], 1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|    | [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
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|    |-		matrix.splice(closeClusters[1],1);
|    |1622|+		matrix.splice(closeClusters[1], 1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			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
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			if (matrix[i].length > closeClusters[0])
|1626|    |-				matrix[i].splice(closeClusters[0],1);
|    |1626|+				matrix[i].splice(closeClusters[0], 1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|1628| 				matrix[i].splice(closeClusters[1],1);
|1629|1629| 		}
|    | [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| 			if (matrix[i].length > closeClusters[0])
|1626|1626| 				matrix[i].splice(closeClusters[0],1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|    |-				matrix[i].splice(closeClusters[1],1);
|    |1628|+				matrix[i].splice(closeClusters[1], 1);
|1629|1629| 		}
|1630|1630| 		// add a new row of distances to the matrix and the new cluster
|1631|1631| 		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
| 774| »   »   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
|1280| ····»   »   »   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
|1281| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1511| »   »   »   »   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
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 517| »   »   »   »   ····&&·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
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1488| »   »   »   &&·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
|1514| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1590| »   »   let·closeClusters·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'closeClusters' to 'undefined'.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1046|1046| 			},
|1047|1047| 		},
|1048|1048| 
|1049|    |-		"GARRISON":{
|    |1049|+		"GARRISON": {
|1050|1050| 			"APPROACHING": {
|1051|1051| 				"enter": function() {
|1052|1052| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [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
|2175|2175| 					"MovementUpdate": function(msg) {
|2176|2176| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2177|2177| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2178|    |-						if (msg.likelyFailure || 
|    |2178|+						if (msg.likelyFailure ||
|2179|2179| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2180|2180| 							!msg.obstructed && this.CheckRange(this.order.data))
|2181|2181| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2478|2478| 
|2479|2479| 								return type.specific == resourceType.specific &&
|2480|2480| 								    (type.specific != "meat" || resourceTemplate == template);
|2481|    |-						});
|    |2481|+							});
|2482|2482| 
|2483|2483| 						if (nearbyResource)
|2484|2484| 						{
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				this.StopTimer();
|3101|3101| 				this.ResetAnimation();
|3102|3102| 				if (this.formationAnimationVariant)
|3103|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3103|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3104|3104| 				else
|3105|3105| 					this.SetDefaultAnimationVariant();
|3106|3106| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3326|3326| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3327|3327| 
|3328|3328| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3329|    |-							// only used for domestic animals
|    |3329|+		// only used for domestic animals
|3330|3330| 
|3331|3331| 		// Reuse the same garrison behaviour for animals.
|3332|3332| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3378|3378| 
|3379|3379| UnitAI.prototype.IsAnimal = function()
|3380|3380| {
|3381|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3381|+	return (!!this.template.NaturalBehaviour);
|3382|3382| };
|3383|3383| 
|3384|3384| 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
|3518|3518| 		{
|3519|3519| 			let index = this.GetCurrentState().indexOf(".");
|3520|3520| 			if (index != -1)
|3521|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3521|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3522|3522| 			this.Stop(false);
|3523|3523| 		}
|3524|3524| 
|    | [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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3661|3661| };
|3662|3662| 
|3663|3663| 
|3664|    |-//// FSM linkage functions ////
|    |3664|+// // FSM linkage functions ////
|3665|3665| 
|3666|3666| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3667|3667| 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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4184|4184| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|    |-//// Helper functions to be called by the FSM ////
|    |4187|+// // Helper functions to be called by the FSM ////
|4188|4188| 
|4189|4189| UnitAI.prototype.GetWalkSpeed = function()
|4190|4190| {
|    | [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
|4914|4914| UnitAI.prototype.AttackEntityInZone = function(ents)
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|    |-		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4917|+		this.CanAttack(target) &&
|    |4918|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|4919| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	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
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|4917| 		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4918|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4919|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	if (!target)
|4922|4922| 		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
|4981|4981| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4982|4982| 	if (this.isGuardOf)
|4983|4983| 	{
|4984|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4984|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    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
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4988|    |-				return false;
|    |4988|+			return false;
|4989|4989| 	}
|4990|4990| 
|4991|4991| 	// 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
|5023|5023| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    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
|5036|5036| 	return false;
|5037|5037| };
|5038|5038| 
|5039|    |-//// External interface functions ////
|    |5039|+// // External interface functions ////
|5040|5040| 
|5041|5041| UnitAI.prototype.SetFormationController = function(ent)
|5042|5042| {
|    | [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
|5192|5192| 	{
|5193|5193| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5194|5194| 			return;
|5195|    |-		else
|5196|    |-			this.RemoveGuard();
|    |5195|+		this.RemoveGuard();
|5197|5196| 	}
|5198|5197| 
|5199|5198| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5526|5526| 
|5527|5527| 	if (this.IsFormationController())
|5528|5528| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5529|    |-}
|    |5529|+};
|5530|5530| /**
|5531|5531|  * Adds trade order to the queue. Either walk to the first market, or
|5532|5532|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5547|5547| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5548|5548| 	{
|5549|5549| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5550|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5550|+		if (cmpTrader.HasBothMarkets() &&
|5551|5551| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5552|5552| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5553|5553| 		{
|    | [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
|5828|5828| 				{
|5829|5829| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5830|5830| 					var targetClasses = this.order.data.targetClasses;
|5831|    |-					if (targetClasses.attack && cmpIdentity
|5832|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5831|+					if (targetClasses.attack && cmpIdentity &&
|    |5832|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|5834| 					if (targetClasses.avoid && cmpIdentity
|5835|5835| 						&& 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
|5831|5831| 					if (targetClasses.attack && cmpIdentity
|5832|5832| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|    |-					if (targetClasses.avoid && cmpIdentity
|5835|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5834|+					if (targetClasses.avoid && cmpIdentity &&
|    |5835|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5836|5836| 						continue;
|5837|5837| 					// Only used by the AIs to prevent some choices of targets
|5838|5838| 					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
|5854|5854| 		{
|5855|5855| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5856|5856| 			var targetClasses = this.order.data.targetClasses;
|5857|    |-			if (cmpIdentity && targetClasses.attack
|5858|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5857|+			if (cmpIdentity && targetClasses.attack &&
|    |5858|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|5860| 			if (cmpIdentity && targetClasses.avoid
|5861|5861| 				&& 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
|5857|5857| 			if (cmpIdentity && targetClasses.attack
|5858|5858| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|    |-			if (cmpIdentity && targetClasses.avoid
|5861|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5860|+			if (cmpIdentity && targetClasses.avoid &&
|    |5861|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5862|5862| 				continue;
|5863|5863| 			// Only used by the AIs to prevent some choices of targets
|5864|5864| 			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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = { "x": x, "z": z};
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = {"x": x, "z": z };
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6044|6044| 	return false;
|6045|6045| };
|6046|6046| 
|6047|    |-//// Helper functions ////
|    |6047|+// // Helper functions ////
|6048|6048| 
|6049|6049| /**
|6050|6050|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6063|6063| 		return undefined;
|6064|6064| 
|6065|6065| 	return component.GetRange(type);
|6066|    |-}
|    |6066|+};
|6067|6067| 
|6068|6068| UnitAI.prototype.CanAttack = function(target)
|6069|6069| {
|    | [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
|6239|6239| 	return cmpPack && cmpPack.IsPacking();
|6240|6240| };
|6241|6241| 
|6242|    |-//// Formation specific functions ////
|    |6242|+// // Formation specific functions ////
|6243|6243| 
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|    | [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
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|6246|6246| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6247|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6248|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6247|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6248|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|6251| //// 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
|6248|6248| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|    |-//// Animal specific functions ////
|    |6251|+// // Animal specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.MoveRandomly = function(distance)
|6254|6254| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3979| »   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
|4901| »   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
|4916| »   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
|4964| »   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
|4987| »   »   ····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
|2020| »   »   »   »   »   »   &&·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
|3103| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

Freagarach planned changes to this revision.Jun 12 2020, 10:28 AM

Also the control all cheat doesn't work anymore.

But if you have a bunch of units of which one is not controllable, you won't see the cursor anyways?

no but then you'll have the warnings from Commands.js

No, since that is filtered ^^

No, since that is filtered ^^

Ah, then perhaps filtering out is not the correct pattern and you need to return something

There are two types of not being able to respond to a particular command:

  • The *entity* can't "physically" do that, e.g. a champion gathering, which is checked in the g_UnitActions.
  • The *player* is not allowed to issue the order to that entity. In case of an observer, nothing happens, which is to be expected. In case of an uncontrollable entity the player may still think the entity is under their control so that is not expected.

I'm not sure how to properly handle this so I'm leaving it alone for a while I guess.

Freagarach edited the summary of this revision. (Show Details)Jun 12 2020, 11:26 AM
wraitii requested changes to this revision.Jun 12 2020, 11:27 AM

I think the correct spot for the filtering is actually inpu.js:determineAction, sorry about the earlier indication.

I'm wondering if the simplest solution isn't to fallback explicitly to an uncontrollable action. Maybe there's a slightly less hacky way of handling that.

wraitii updated this revision to Diff 12258.Jun 12 2020, 12:05 PM

Here is a proposition with a 'fake' uncontrollable action for explicitness.
It works quite well in the few cases I've tested.

I'm wondering if the Warning 'some entities can't be controlled' is really useful -> in general when some entities in a selection can't do a specifi order we don't really give a warning.

Also I've changed my mind and I think the controllability check should be done in each order, it's cleaner.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'execute'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 530| 530| 
| 531| 531| 	"cancel-setup-trade-route":
| 532| 532| 	{
| 533|    |-		"execute":function(target, action, selection, queued)
|    | 533|+		"execute": function(target, action, selection, queued)
| 534| 534| 		{
| 535| 535| 			Engine.PostNetworkCommand({
| 536| 536| 				"type": "cancel-setup-trade-route",
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 575| 575| 				"cursor": "action-cancel-setup-trade-route",
| 576| 576| 				"tooltip": actionInfo.tooltip,
| 577| 577| 				"target": target
| 578|    |-			}
|    | 578|+			};
| 579| 579| 		},
| 580| 580| 		"specificness": 2,
| 581| 581| 	},

binaries/data/mods/public/gui/session/unit_actions.js
| 620| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
| 578| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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
| 513| 513| 			if (cmpGarrisonHolder)
| 514| 514| 			{
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517|    |-				    && player != +cmd.owner)
|    | 516|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 517|+				    player != +cmd.owner)
| 518| 518| 						continue;
| 519| 519| 
| 520| 520| 				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
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516| 516| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517| 517| 				    && player != +cmd.owner)
| 518|    |-						continue;
|    | 518|+					continue;
| 519| 519| 
| 520| 520| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 521| 521| 					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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1257|1257| 		}
|1258|1258| 
|1259|1259| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1260|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1260|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1261|1261| 	}
|1262|1262| 
|1263|1263| 	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
|1321|1321| 
|1322|1322| 				if (i > 0)
|1323|1323| 				{
|1324|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1324|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1325|1325| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1326|1326| 					// TODO: ensure that cmpPreviousObstruction exists
|1327|1327| 					// 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
|1484|1484| 		// Check that all its members are selected
|1485|1485| 		var fid = formationIds[0];
|1486|1486| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1487|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1488|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1487|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1488|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1489|1489| 		{
|1490|1490| 			cmpFormation.DeleteTwinFormations();
|1491|1491| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1587|1587| 	while (clusters.length > 1)
|1588|1588| 	{
|1589|1589| 		// search two clusters that are closer than the required distance
|1590|    |-		let closeClusters = undefined;
|    |1590|+		let closeClusters;
|1591|1591| 
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|    | [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
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|1594|1594| 				if (matrix[i][j] < distSq)
|1595|    |-					closeClusters = [i,j];
|    |1595|+					closeClusters = [i, j];
|1596|1596| 
|1597|1597| 		// if no more close clusters found, just return all found clusters so far
|1598|1598| 		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
|1616|1616| 		}
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|    |-		clusters.splice(closeClusters[0],1);
|    |1619|+		clusters.splice(closeClusters[0], 1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		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
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|    |-		clusters.splice(closeClusters[1],1);
|    |1620|+		clusters.splice(closeClusters[1], 1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		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
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|    |-		matrix.splice(closeClusters[0],1);
|    |1621|+		matrix.splice(closeClusters[0], 1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|    | [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
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|    |-		matrix.splice(closeClusters[1],1);
|    |1622|+		matrix.splice(closeClusters[1], 1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			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
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			if (matrix[i].length > closeClusters[0])
|1626|    |-				matrix[i].splice(closeClusters[0],1);
|    |1626|+				matrix[i].splice(closeClusters[0], 1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|1628| 				matrix[i].splice(closeClusters[1],1);
|1629|1629| 		}
|    | [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| 			if (matrix[i].length > closeClusters[0])
|1626|1626| 				matrix[i].splice(closeClusters[0],1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|    |-				matrix[i].splice(closeClusters[1],1);
|    |1628|+				matrix[i].splice(closeClusters[1], 1);
|1629|1629| 		}
|1630|1630| 		// add a new row of distances to the matrix and the new cluster
|1631|1631| 		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
| 774| »   »   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
|1280| ····»   »   »   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
|1281| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1511| »   »   »   »   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
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 517| »   »   »   »   ····&&·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
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1488| »   »   »   &&·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
|1514| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1590| »   »   let·closeClusters·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'closeClusters' to 'undefined'.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1046|1046| 			},
|1047|1047| 		},
|1048|1048| 
|1049|    |-		"GARRISON":{
|    |1049|+		"GARRISON": {
|1050|1050| 			"APPROACHING": {
|1051|1051| 				"enter": function() {
|1052|1052| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [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
|2175|2175| 					"MovementUpdate": function(msg) {
|2176|2176| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2177|2177| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2178|    |-						if (msg.likelyFailure || 
|    |2178|+						if (msg.likelyFailure ||
|2179|2179| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2180|2180| 							!msg.obstructed && this.CheckRange(this.order.data))
|2181|2181| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2478|2478| 
|2479|2479| 								return type.specific == resourceType.specific &&
|2480|2480| 								    (type.specific != "meat" || resourceTemplate == template);
|2481|    |-						});
|    |2481|+							});
|2482|2482| 
|2483|2483| 						if (nearbyResource)
|2484|2484| 						{
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				this.StopTimer();
|3101|3101| 				this.ResetAnimation();
|3102|3102| 				if (this.formationAnimationVariant)
|3103|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3103|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3104|3104| 				else
|3105|3105| 					this.SetDefaultAnimationVariant();
|3106|3106| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3326|3326| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3327|3327| 
|3328|3328| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3329|    |-							// only used for domestic animals
|    |3329|+		// only used for domestic animals
|3330|3330| 
|3331|3331| 		// Reuse the same garrison behaviour for animals.
|3332|3332| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3378|3378| 
|3379|3379| UnitAI.prototype.IsAnimal = function()
|3380|3380| {
|3381|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3381|+	return (!!this.template.NaturalBehaviour);
|3382|3382| };
|3383|3383| 
|3384|3384| 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
|3518|3518| 		{
|3519|3519| 			let index = this.GetCurrentState().indexOf(".");
|3520|3520| 			if (index != -1)
|3521|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3521|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3522|3522| 			this.Stop(false);
|3523|3523| 		}
|3524|3524| 
|    | [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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3661|3661| };
|3662|3662| 
|3663|3663| 
|3664|    |-//// FSM linkage functions ////
|    |3664|+// // FSM linkage functions ////
|3665|3665| 
|3666|3666| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3667|3667| 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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4184|4184| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|    |-//// Helper functions to be called by the FSM ////
|    |4187|+// // Helper functions to be called by the FSM ////
|4188|4188| 
|4189|4189| UnitAI.prototype.GetWalkSpeed = function()
|4190|4190| {
|    | [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
|4914|4914| UnitAI.prototype.AttackEntityInZone = function(ents)
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|    |-		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4917|+		this.CanAttack(target) &&
|    |4918|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|4919| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	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
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|4917| 		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4918|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4919|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	if (!target)
|4922|4922| 		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
|4981|4981| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4982|4982| 	if (this.isGuardOf)
|4983|4983| 	{
|4984|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4984|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    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
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4988|    |-				return false;
|    |4988|+			return false;
|4989|4989| 	}
|4990|4990| 
|4991|4991| 	// 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
|5023|5023| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    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
|5036|5036| 	return false;
|5037|5037| };
|5038|5038| 
|5039|    |-//// External interface functions ////
|    |5039|+// // External interface functions ////
|5040|5040| 
|5041|5041| UnitAI.prototype.SetFormationController = function(ent)
|5042|5042| {
|    | [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
|5192|5192| 	{
|5193|5193| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5194|5194| 			return;
|5195|    |-		else
|5196|    |-			this.RemoveGuard();
|    |5195|+		this.RemoveGuard();
|5197|5196| 	}
|5198|5197| 
|5199|5198| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5526|5526| 
|5527|5527| 	if (this.IsFormationController())
|5528|5528| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5529|    |-}
|    |5529|+};
|5530|5530| /**
|5531|5531|  * Adds trade order to the queue. Either walk to the first market, or
|5532|5532|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5547|5547| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5548|5548| 	{
|5549|5549| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5550|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5550|+		if (cmpTrader.HasBothMarkets() &&
|5551|5551| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5552|5552| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5553|5553| 		{
|    | [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
|5828|5828| 				{
|5829|5829| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5830|5830| 					var targetClasses = this.order.data.targetClasses;
|5831|    |-					if (targetClasses.attack && cmpIdentity
|5832|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5831|+					if (targetClasses.attack && cmpIdentity &&
|    |5832|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|5834| 					if (targetClasses.avoid && cmpIdentity
|5835|5835| 						&& 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
|5831|5831| 					if (targetClasses.attack && cmpIdentity
|5832|5832| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|    |-					if (targetClasses.avoid && cmpIdentity
|5835|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5834|+					if (targetClasses.avoid && cmpIdentity &&
|    |5835|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5836|5836| 						continue;
|5837|5837| 					// Only used by the AIs to prevent some choices of targets
|5838|5838| 					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
|5854|5854| 		{
|5855|5855| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5856|5856| 			var targetClasses = this.order.data.targetClasses;
|5857|    |-			if (cmpIdentity && targetClasses.attack
|5858|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5857|+			if (cmpIdentity && targetClasses.attack &&
|    |5858|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|5860| 			if (cmpIdentity && targetClasses.avoid
|5861|5861| 				&& 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
|5857|5857| 			if (cmpIdentity && targetClasses.attack
|5858|5858| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|    |-			if (cmpIdentity && targetClasses.avoid
|5861|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5860|+			if (cmpIdentity && targetClasses.avoid &&
|    |5861|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5862|5862| 				continue;
|5863|5863| 			// Only used by the AIs to prevent some choices of targets
|5864|5864| 			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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = { "x": x, "z": z};
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = {"x": x, "z": z };
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6044|6044| 	return false;
|6045|6045| };
|6046|6046| 
|6047|    |-//// Helper functions ////
|    |6047|+// // Helper functions ////
|6048|6048| 
|6049|6049| /**
|6050|6050|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6063|6063| 		return undefined;
|6064|6064| 
|6065|6065| 	return component.GetRange(type);
|6066|    |-}
|    |6066|+};
|6067|6067| 
|6068|6068| UnitAI.prototype.CanAttack = function(target)
|6069|6069| {
|    | [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
|6239|6239| 	return cmpPack && cmpPack.IsPacking();
|6240|6240| };
|6241|6241| 
|6242|    |-//// Formation specific functions ////
|    |6242|+// // Formation specific functions ////
|6243|6243| 
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|    | [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
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|6246|6246| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6247|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6248|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6247|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6248|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|6251| //// 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
|6248|6248| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|    |-//// Animal specific functions ////
|    |6251|+// // Animal specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.MoveRandomly = function(distance)
|6254|6254| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3979| »   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
|4901| »   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
|4916| »   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
|4964| »   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
|4987| »   »   ····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
|2020| »   »   »   »   »   »   &&·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
|3103| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

wraitii updated this revision to Diff 12260.Jun 12 2020, 4:32 PM

Check for controllability in Identity.js so that the ControlAll cheat works.

i've changed my mind again about where to check for controllable, and it's just so much simpler to do the check in GetActioInfo that I'll leave it here. Perhaps with some refactoring we could clean up this code a little, it's a bit of a mess.

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
| 513| 513| 			if (cmpGarrisonHolder)
| 514| 514| 			{
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517|    |-				    && player != +cmd.owner)
|    | 516|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 517|+				    player != +cmd.owner)
| 518| 518| 						continue;
| 519| 519| 
| 520| 520| 				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
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516| 516| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517| 517| 				    && player != +cmd.owner)
| 518|    |-						continue;
|    | 518|+					continue;
| 519| 519| 
| 520| 520| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 521| 521| 					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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1257|1257| 		}
|1258|1258| 
|1259|1259| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1260|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1260|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1261|1261| 	}
|1262|1262| 
|1263|1263| 	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
|1321|1321| 
|1322|1322| 				if (i > 0)
|1323|1323| 				{
|1324|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1324|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1325|1325| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1326|1326| 					// TODO: ensure that cmpPreviousObstruction exists
|1327|1327| 					// 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
|1484|1484| 		// Check that all its members are selected
|1485|1485| 		var fid = formationIds[0];
|1486|1486| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1487|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1488|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1487|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1488|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1489|1489| 		{
|1490|1490| 			cmpFormation.DeleteTwinFormations();
|1491|1491| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1587|1587| 	while (clusters.length > 1)
|1588|1588| 	{
|1589|1589| 		// search two clusters that are closer than the required distance
|1590|    |-		let closeClusters = undefined;
|    |1590|+		let closeClusters;
|1591|1591| 
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|    | [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
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|1594|1594| 				if (matrix[i][j] < distSq)
|1595|    |-					closeClusters = [i,j];
|    |1595|+					closeClusters = [i, j];
|1596|1596| 
|1597|1597| 		// if no more close clusters found, just return all found clusters so far
|1598|1598| 		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
|1616|1616| 		}
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|    |-		clusters.splice(closeClusters[0],1);
|    |1619|+		clusters.splice(closeClusters[0], 1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		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
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|    |-		clusters.splice(closeClusters[1],1);
|    |1620|+		clusters.splice(closeClusters[1], 1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		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
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|    |-		matrix.splice(closeClusters[0],1);
|    |1621|+		matrix.splice(closeClusters[0], 1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|    | [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
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|    |-		matrix.splice(closeClusters[1],1);
|    |1622|+		matrix.splice(closeClusters[1], 1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			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
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			if (matrix[i].length > closeClusters[0])
|1626|    |-				matrix[i].splice(closeClusters[0],1);
|    |1626|+				matrix[i].splice(closeClusters[0], 1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|1628| 				matrix[i].splice(closeClusters[1],1);
|1629|1629| 		}
|    | [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| 			if (matrix[i].length > closeClusters[0])
|1626|1626| 				matrix[i].splice(closeClusters[0],1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|    |-				matrix[i].splice(closeClusters[1],1);
|    |1628|+				matrix[i].splice(closeClusters[1], 1);
|1629|1629| 		}
|1630|1630| 		// add a new row of distances to the matrix and the new cluster
|1631|1631| 		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
| 774| »   »   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
|1280| ····»   »   »   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
|1281| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1511| »   »   »   »   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
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 517| »   »   »   »   ····&&·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
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1488| »   »   »   &&·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
|1514| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1590| »   »   let·closeClusters·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'closeClusters' to 'undefined'.
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'execute'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 530| 530| 
| 531| 531| 	"cancel-setup-trade-route":
| 532| 532| 	{
| 533|    |-		"execute":function(target, action, selection, queued)
|    | 533|+		"execute": function(target, action, selection, queued)
| 534| 534| 		{
| 535| 535| 			Engine.PostNetworkCommand({
| 536| 536| 				"type": "cancel-setup-trade-route",
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 575| 575| 				"cursor": "action-cancel-setup-trade-route",
| 576| 576| 				"tooltip": actionInfo.tooltip,
| 577| 577| 				"target": target
| 578|    |-			}
|    | 578|+			};
| 579| 579| 		},
| 580| 580| 		"specificness": 2,
| 581| 581| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1106|1106| 
|1107|1107| 			// Only show this action if some entities are marked uncontrollable.
|1108|1108| 			if (!selection.some(ent => {
|1109|    |-					let state = GetEntityState(ent);
|    |1109|+				let state = GetEntityState(ent);
|1110|1110| 					return state && state.identity && !state.identity.controllable;
|1111|1111| 				}))
|1112|1112| 				return false;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1107|1107| 			// Only show this action if some entities are marked uncontrollable.
|1108|1108| 			if (!selection.some(ent => {
|1109|1109| 					let state = GetEntityState(ent);
|1110|    |-					return state && state.identity && !state.identity.controllable;
|    |1110|+				return state && state.identity && !state.identity.controllable;
|1111|1111| 				}))
|1112|1112| 				return false;
|1113|1113| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1108|1108| 			if (!selection.some(ent => {
|1109|1109| 					let state = GetEntityState(ent);
|1110|1110| 					return state && state.identity && !state.identity.controllable;
|1111|    |-				}))
|    |1111|+			}))
|1112|1112| 				return false;
|1113|1113| 
|1114|1114| 			return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1646|1646| 
|1647|1647| 		// Ensure one entity at least is controllable.
|1648|1648| 		if (!selection.some(ent => {
|1649|    |-				let state = GetEntityState(ent);
|    |1649|+			let state = GetEntityState(ent);
|1650|1650| 				return state && state.identity && state.identity.controllable;
|1651|1651| 			}))
|1652|1652| 			return { "possible": false };
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1647|1647| 		// Ensure one entity at least is controllable.
|1648|1648| 		if (!selection.some(ent => {
|1649|1649| 				let state = GetEntityState(ent);
|1650|    |-				return state && state.identity && state.identity.controllable;
|    |1650|+			return state && state.identity && state.identity.controllable;
|1651|1651| 			}))
|1652|1652| 			return { "possible": false };
|1653|1653| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1648|1648| 		if (!selection.some(ent => {
|1649|1649| 				let state = GetEntityState(ent);
|1650|1650| 				return state && state.identity && state.identity.controllable;
|1651|    |-			}))
|    |1651|+		}))
|1652|1652| 			return { "possible": false };
|1653|1653| 
|1654|1654| 		return {

binaries/data/mods/public/gui/session/unit_actions.js
| 620| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
| 578| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1046|1046| 			},
|1047|1047| 		},
|1048|1048| 
|1049|    |-		"GARRISON":{
|    |1049|+		"GARRISON": {
|1050|1050| 			"APPROACHING": {
|1051|1051| 				"enter": function() {
|1052|1052| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [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
|2175|2175| 					"MovementUpdate": function(msg) {
|2176|2176| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2177|2177| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2178|    |-						if (msg.likelyFailure || 
|    |2178|+						if (msg.likelyFailure ||
|2179|2179| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2180|2180| 							!msg.obstructed && this.CheckRange(this.order.data))
|2181|2181| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2478|2478| 
|2479|2479| 								return type.specific == resourceType.specific &&
|2480|2480| 								    (type.specific != "meat" || resourceTemplate == template);
|2481|    |-						});
|    |2481|+							});
|2482|2482| 
|2483|2483| 						if (nearbyResource)
|2484|2484| 						{
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				this.StopTimer();
|3101|3101| 				this.ResetAnimation();
|3102|3102| 				if (this.formationAnimationVariant)
|3103|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3103|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3104|3104| 				else
|3105|3105| 					this.SetDefaultAnimationVariant();
|3106|3106| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3326|3326| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3327|3327| 
|3328|3328| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3329|    |-							// only used for domestic animals
|    |3329|+		// only used for domestic animals
|3330|3330| 
|3331|3331| 		// Reuse the same garrison behaviour for animals.
|3332|3332| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3378|3378| 
|3379|3379| UnitAI.prototype.IsAnimal = function()
|3380|3380| {
|3381|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3381|+	return (!!this.template.NaturalBehaviour);
|3382|3382| };
|3383|3383| 
|3384|3384| 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
|3518|3518| 		{
|3519|3519| 			let index = this.GetCurrentState().indexOf(".");
|3520|3520| 			if (index != -1)
|3521|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3521|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3522|3522| 			this.Stop(false);
|3523|3523| 		}
|3524|3524| 
|    | [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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3661|3661| };
|3662|3662| 
|3663|3663| 
|3664|    |-//// FSM linkage functions ////
|    |3664|+// // FSM linkage functions ////
|3665|3665| 
|3666|3666| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3667|3667| 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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4184|4184| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|    |-//// Helper functions to be called by the FSM ////
|    |4187|+// // Helper functions to be called by the FSM ////
|4188|4188| 
|4189|4189| UnitAI.prototype.GetWalkSpeed = function()
|4190|4190| {
|    | [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
|4914|4914| UnitAI.prototype.AttackEntityInZone = function(ents)
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|    |-		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4917|+		this.CanAttack(target) &&
|    |4918|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|4919| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	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
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|4917| 		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4918|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4919|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	if (!target)
|4922|4922| 		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
|4981|4981| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4982|4982| 	if (this.isGuardOf)
|4983|4983| 	{
|4984|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4984|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    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
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4988|    |-				return false;
|    |4988|+			return false;
|4989|4989| 	}
|4990|4990| 
|4991|4991| 	// 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
|5023|5023| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    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
|5036|5036| 	return false;
|5037|5037| };
|5038|5038| 
|5039|    |-//// External interface functions ////
|    |5039|+// // External interface functions ////
|5040|5040| 
|5041|5041| UnitAI.prototype.SetFormationController = function(ent)
|5042|5042| {
|    | [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
|5192|5192| 	{
|5193|5193| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5194|5194| 			return;
|5195|    |-		else
|5196|    |-			this.RemoveGuard();
|    |5195|+		this.RemoveGuard();
|5197|5196| 	}
|5198|5197| 
|5199|5198| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5526|5526| 
|5527|5527| 	if (this.IsFormationController())
|5528|5528| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5529|    |-}
|    |5529|+};
|5530|5530| /**
|5531|5531|  * Adds trade order to the queue. Either walk to the first market, or
|5532|5532|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5547|5547| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5548|5548| 	{
|5549|5549| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5550|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5550|+		if (cmpTrader.HasBothMarkets() &&
|5551|5551| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5552|5552| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5553|5553| 		{
|    | [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
|5828|5828| 				{
|5829|5829| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5830|5830| 					var targetClasses = this.order.data.targetClasses;
|5831|    |-					if (targetClasses.attack && cmpIdentity
|5832|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5831|+					if (targetClasses.attack && cmpIdentity &&
|    |5832|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|5834| 					if (targetClasses.avoid && cmpIdentity
|5835|5835| 						&& 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
|5831|5831| 					if (targetClasses.attack && cmpIdentity
|5832|5832| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|    |-					if (targetClasses.avoid && cmpIdentity
|5835|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5834|+					if (targetClasses.avoid && cmpIdentity &&
|    |5835|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5836|5836| 						continue;
|5837|5837| 					// Only used by the AIs to prevent some choices of targets
|5838|5838| 					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
|5854|5854| 		{
|5855|5855| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5856|5856| 			var targetClasses = this.order.data.targetClasses;
|5857|    |-			if (cmpIdentity && targetClasses.attack
|5858|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5857|+			if (cmpIdentity && targetClasses.attack &&
|    |5858|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|5860| 			if (cmpIdentity && targetClasses.avoid
|5861|5861| 				&& 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
|5857|5857| 			if (cmpIdentity && targetClasses.attack
|5858|5858| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|    |-			if (cmpIdentity && targetClasses.avoid
|5861|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5860|+			if (cmpIdentity && targetClasses.avoid &&
|    |5861|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5862|5862| 				continue;
|5863|5863| 			// Only used by the AIs to prevent some choices of targets
|5864|5864| 			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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = { "x": x, "z": z};
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = {"x": x, "z": z };
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6044|6044| 	return false;
|6045|6045| };
|6046|6046| 
|6047|    |-//// Helper functions ////
|    |6047|+// // Helper functions ////
|6048|6048| 
|6049|6049| /**
|6050|6050|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6063|6063| 		return undefined;
|6064|6064| 
|6065|6065| 	return component.GetRange(type);
|6066|    |-}
|    |6066|+};
|6067|6067| 
|6068|6068| UnitAI.prototype.CanAttack = function(target)
|6069|6069| {
|    | [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
|6239|6239| 	return cmpPack && cmpPack.IsPacking();
|6240|6240| };
|6241|6241| 
|6242|    |-//// Formation specific functions ////
|    |6242|+// // Formation specific functions ////
|6243|6243| 
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|    | [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
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|6246|6246| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6247|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6248|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6247|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6248|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|6251| //// 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
|6248|6248| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|    |-//// Animal specific functions ////
|    |6251|+// // Animal specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.MoveRandomly = function(distance)
|6254|6254| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3979| »   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
|4901| »   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
|4916| »   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
|4964| »   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
|4987| »   »   ····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
|2020| »   »   »   »   »   »   &&·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
|3103| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

Freagarach updated this revision to Diff 12321.Jun 15 2020, 8:46 AM
Freagarach marked 2 inline comments as done.
  • Plural translation.
  • Also buildings may be uncontrollable.
  • Remove debug uncontrollability female citizens.
  • bool -> controllability.

ToDo:

  • Controll all and allied entities.
Freagarach planned changes to this revision.Jun 15 2020, 8:50 AM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'execute'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 530| 530| 
| 531| 531| 	"cancel-setup-trade-route":
| 532| 532| 	{
| 533|    |-		"execute":function(target, action, selection, queued)
|    | 533|+		"execute": function(target, action, selection, queued)
| 534| 534| 		{
| 535| 535| 			Engine.PostNetworkCommand({
| 536| 536| 				"type": "cancel-setup-trade-route",
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 575| 575| 				"cursor": "action-cancel-setup-trade-route",
| 576| 576| 				"tooltip": actionInfo.tooltip,
| 577| 577| 				"target": target
| 578|    |-			}
|    | 578|+			};
| 579| 579| 		},
| 580| 580| 		"specificness": 2,
| 581| 581| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1103|1103| 		{
|1104|1104| 			// Only show this action if all entities are marked uncontrollable.
|1105|1105| 			if (!selection.some(ent => {
|1106|    |-					let state = GetEntityState(ent);
|    |1106|+				let state = GetEntityState(ent);
|1107|1107| 					return state && state.identity && !state.identity.controllable;
|1108|1108| 				}))
|1109|1109| 				return false;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1104|1104| 			// Only show this action if all entities are marked uncontrollable.
|1105|1105| 			if (!selection.some(ent => {
|1106|1106| 					let state = GetEntityState(ent);
|1107|    |-					return state && state.identity && !state.identity.controllable;
|    |1107|+				return state && state.identity && !state.identity.controllable;
|1108|1108| 				}))
|1109|1109| 				return false;
|1110|1110| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1105|1105| 			if (!selection.some(ent => {
|1106|1106| 					let state = GetEntityState(ent);
|1107|1107| 					return state && state.identity && !state.identity.controllable;
|1108|    |-				}))
|    |1108|+			}))
|1109|1109| 				return false;
|1110|1110| 
|1111|1111| 			return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1619|1619| 	{
|1620|1620| 		// Ensure one entity at least is controllable.
|1621|1621| 		if (!selection.some(ent => {
|1622|    |-				let state = GetEntityState(ent);
|    |1622|+			let state = GetEntityState(ent);
|1623|1623| 				return state && state.identity && state.identity.controllable;
|1624|1624| 			}))
|1625|1625| 			return { "possible": false };
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1620|1620| 		// Ensure one entity at least is controllable.
|1621|1621| 		if (!selection.some(ent => {
|1622|1622| 				let state = GetEntityState(ent);
|1623|    |-				return state && state.identity && state.identity.controllable;
|    |1623|+			return state && state.identity && state.identity.controllable;
|1624|1624| 			}))
|1625|1625| 			return { "possible": false };
|1626|1626| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1621|1621| 		if (!selection.some(ent => {
|1622|1622| 				let state = GetEntityState(ent);
|1623|1623| 				return state && state.identity && state.identity.controllable;
|1624|    |-			}))
|    |1624|+		}))
|1625|1625| 			return { "possible": false };
|1626|1626| 
|1627|1627| 		if (action == "set-rallypoint")

binaries/data/mods/public/gui/session/unit_actions.js
| 620| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
| 578| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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
| 513| 513| 			if (cmpGarrisonHolder)
| 514| 514| 			{
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517|    |-				    && player != +cmd.owner)
|    | 516|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 517|+				    player != +cmd.owner)
| 518| 518| 						continue;
| 519| 519| 
| 520| 520| 				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
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516| 516| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517| 517| 				    && player != +cmd.owner)
| 518|    |-						continue;
|    | 518|+					continue;
| 519| 519| 
| 520| 520| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 521| 521| 					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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1257|1257| 		}
|1258|1258| 
|1259|1259| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1260|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1260|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1261|1261| 	}
|1262|1262| 
|1263|1263| 	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
|1321|1321| 
|1322|1322| 				if (i > 0)
|1323|1323| 				{
|1324|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1324|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1325|1325| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1326|1326| 					// TODO: ensure that cmpPreviousObstruction exists
|1327|1327| 					// 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
|1484|1484| 		// Check that all its members are selected
|1485|1485| 		var fid = formationIds[0];
|1486|1486| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1487|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1488|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1487|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1488|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1489|1489| 		{
|1490|1490| 			cmpFormation.DeleteTwinFormations();
|1491|1491| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1587|1587| 	while (clusters.length > 1)
|1588|1588| 	{
|1589|1589| 		// search two clusters that are closer than the required distance
|1590|    |-		let closeClusters = undefined;
|    |1590|+		let closeClusters;
|1591|1591| 
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|    | [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
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|1594|1594| 				if (matrix[i][j] < distSq)
|1595|    |-					closeClusters = [i,j];
|    |1595|+					closeClusters = [i, j];
|1596|1596| 
|1597|1597| 		// if no more close clusters found, just return all found clusters so far
|1598|1598| 		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
|1616|1616| 		}
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|    |-		clusters.splice(closeClusters[0],1);
|    |1619|+		clusters.splice(closeClusters[0], 1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		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
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|    |-		clusters.splice(closeClusters[1],1);
|    |1620|+		clusters.splice(closeClusters[1], 1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		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
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|    |-		matrix.splice(closeClusters[0],1);
|    |1621|+		matrix.splice(closeClusters[0], 1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|    | [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
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|    |-		matrix.splice(closeClusters[1],1);
|    |1622|+		matrix.splice(closeClusters[1], 1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			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
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			if (matrix[i].length > closeClusters[0])
|1626|    |-				matrix[i].splice(closeClusters[0],1);
|    |1626|+				matrix[i].splice(closeClusters[0], 1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|1628| 				matrix[i].splice(closeClusters[1],1);
|1629|1629| 		}
|    | [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| 			if (matrix[i].length > closeClusters[0])
|1626|1626| 				matrix[i].splice(closeClusters[0],1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|    |-				matrix[i].splice(closeClusters[1],1);
|    |1628|+				matrix[i].splice(closeClusters[1], 1);
|1629|1629| 		}
|1630|1630| 		// add a new row of distances to the matrix and the new cluster
|1631|1631| 		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
| 774| »   »   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
|1280| ····»   »   »   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
|1281| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1511| »   »   »   »   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
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 517| »   »   »   »   ····&&·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
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1488| »   »   »   &&·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
|1514| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1590| »   »   let·closeClusters·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'closeClusters' to 'undefined'.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1046|1046| 			},
|1047|1047| 		},
|1048|1048| 
|1049|    |-		"GARRISON":{
|    |1049|+		"GARRISON": {
|1050|1050| 			"APPROACHING": {
|1051|1051| 				"enter": function() {
|1052|1052| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [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
|2175|2175| 					"MovementUpdate": function(msg) {
|2176|2176| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2177|2177| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2178|    |-						if (msg.likelyFailure || 
|    |2178|+						if (msg.likelyFailure ||
|2179|2179| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2180|2180| 							!msg.obstructed && this.CheckRange(this.order.data))
|2181|2181| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2478|2478| 
|2479|2479| 								return type.specific == resourceType.specific &&
|2480|2480| 								    (type.specific != "meat" || resourceTemplate == template);
|2481|    |-						});
|    |2481|+							});
|2482|2482| 
|2483|2483| 						if (nearbyResource)
|2484|2484| 						{
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				this.StopTimer();
|3101|3101| 				this.ResetAnimation();
|3102|3102| 				if (this.formationAnimationVariant)
|3103|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3103|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3104|3104| 				else
|3105|3105| 					this.SetDefaultAnimationVariant();
|3106|3106| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3326|3326| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3327|3327| 
|3328|3328| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3329|    |-							// only used for domestic animals
|    |3329|+		// only used for domestic animals
|3330|3330| 
|3331|3331| 		// Reuse the same garrison behaviour for animals.
|3332|3332| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3378|3378| 
|3379|3379| UnitAI.prototype.IsAnimal = function()
|3380|3380| {
|3381|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3381|+	return (!!this.template.NaturalBehaviour);
|3382|3382| };
|3383|3383| 
|3384|3384| 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
|3518|3518| 		{
|3519|3519| 			let index = this.GetCurrentState().indexOf(".");
|3520|3520| 			if (index != -1)
|3521|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3521|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3522|3522| 			this.Stop(false);
|3523|3523| 		}
|3524|3524| 
|    | [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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3661|3661| };
|3662|3662| 
|3663|3663| 
|3664|    |-//// FSM linkage functions ////
|    |3664|+// // FSM linkage functions ////
|3665|3665| 
|3666|3666| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3667|3667| 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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4184|4184| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|    |-//// Helper functions to be called by the FSM ////
|    |4187|+// // Helper functions to be called by the FSM ////
|4188|4188| 
|4189|4189| UnitAI.prototype.GetWalkSpeed = function()
|4190|4190| {
|    | [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
|4914|4914| UnitAI.prototype.AttackEntityInZone = function(ents)
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|    |-		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4917|+		this.CanAttack(target) &&
|    |4918|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|4919| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	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
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|4917| 		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4918|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4919|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	if (!target)
|4922|4922| 		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
|4981|4981| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4982|4982| 	if (this.isGuardOf)
|4983|4983| 	{
|4984|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4984|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    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
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4988|    |-				return false;
|    |4988|+			return false;
|4989|4989| 	}
|4990|4990| 
|4991|4991| 	// 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
|5023|5023| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    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
|5036|5036| 	return false;
|5037|5037| };
|5038|5038| 
|5039|    |-//// External interface functions ////
|    |5039|+// // External interface functions ////
|5040|5040| 
|5041|5041| UnitAI.prototype.SetFormationController = function(ent)
|5042|5042| {
|    | [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
|5192|5192| 	{
|5193|5193| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5194|5194| 			return;
|5195|    |-		else
|5196|    |-			this.RemoveGuard();
|    |5195|+		this.RemoveGuard();
|5197|5196| 	}
|5198|5197| 
|5199|5198| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5526|5526| 
|5527|5527| 	if (this.IsFormationController())
|5528|5528| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5529|    |-}
|    |5529|+};
|5530|5530| /**
|5531|5531|  * Adds trade order to the queue. Either walk to the first market, or
|5532|5532|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5547|5547| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5548|5548| 	{
|5549|5549| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5550|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5550|+		if (cmpTrader.HasBothMarkets() &&
|5551|5551| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5552|5552| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5553|5553| 		{
|    | [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
|5828|5828| 				{
|5829|5829| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5830|5830| 					var targetClasses = this.order.data.targetClasses;
|5831|    |-					if (targetClasses.attack && cmpIdentity
|5832|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5831|+					if (targetClasses.attack && cmpIdentity &&
|    |5832|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|5834| 					if (targetClasses.avoid && cmpIdentity
|5835|5835| 						&& 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
|5831|5831| 					if (targetClasses.attack && cmpIdentity
|5832|5832| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|    |-					if (targetClasses.avoid && cmpIdentity
|5835|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5834|+					if (targetClasses.avoid && cmpIdentity &&
|    |5835|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5836|5836| 						continue;
|5837|5837| 					// Only used by the AIs to prevent some choices of targets
|5838|5838| 					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
|5854|5854| 		{
|5855|5855| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5856|5856| 			var targetClasses = this.order.data.targetClasses;
|5857|    |-			if (cmpIdentity && targetClasses.attack
|5858|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5857|+			if (cmpIdentity && targetClasses.attack &&
|    |5858|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|5860| 			if (cmpIdentity && targetClasses.avoid
|5861|5861| 				&& 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
|5857|5857| 			if (cmpIdentity && targetClasses.attack
|5858|5858| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|    |-			if (cmpIdentity && targetClasses.avoid
|5861|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5860|+			if (cmpIdentity && targetClasses.avoid &&
|    |5861|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5862|5862| 				continue;
|5863|5863| 			// Only used by the AIs to prevent some choices of targets
|5864|5864| 			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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = { "x": x, "z": z};
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = {"x": x, "z": z };
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6044|6044| 	return false;
|6045|6045| };
|6046|6046| 
|6047|    |-//// Helper functions ////
|    |6047|+// // Helper functions ////
|6048|6048| 
|6049|6049| /**
|6050|6050|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6063|6063| 		return undefined;
|6064|6064| 
|6065|6065| 	return component.GetRange(type);
|6066|    |-}
|    |6066|+};
|6067|6067| 
|6068|6068| UnitAI.prototype.CanAttack = function(target)
|6069|6069| {
|    | [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
|6239|6239| 	return cmpPack && cmpPack.IsPacking();
|6240|6240| };
|6241|6241| 
|6242|    |-//// Formation specific functions ////
|    |6242|+// // Formation specific functions ////
|6243|6243| 
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|    | [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
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|6246|6246| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6247|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6248|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6247|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6248|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|6251| //// 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
|6248|6248| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|    |-//// Animal specific functions ////
|    |6251|+// // Animal specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.MoveRandomly = function(distance)
|6254|6254| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3979| »   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
|4901| »   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
|4916| »   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
|4964| »   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
|4987| »   »   ····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
|2020| »   »   »   »   »   »   &&·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
|3103| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

Freagarach added inline comments.Jun 15 2020, 5:11 PM
binaries/data/mods/public/simulation/components/Identity.js
199

This can not be used when selecting entities owned by another player and one has the ControlAllUnits on.

wraitii added inline comments.Jun 15 2020, 5:13 PM
binaries/data/mods/public/simulation/components/Identity.js
199

Hmm, indeed, that's GUI-dependent.

Probably needs a special check on the GUI-side too (or as an alternative)

Freagarach updated this revision to Diff 12340.EditedJun 16 2020, 6:04 PM

Check for controll all in GUI.

This has proven to be non-trivial, so care ought to be taken to double check as many scenario's as possible.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'execute'.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 530| 530| 
| 531| 531| 	"cancel-setup-trade-route":
| 532| 532| 	{
| 533|    |-		"execute":function(target, action, selection, queued)
|    | 533|+		"execute": function(target, action, selection, queued)
| 534| 534| 		{
| 535| 535| 			Engine.PostNetworkCommand({
| 536| 536| 				"type": "cancel-setup-trade-route",
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
| 575| 575| 				"cursor": "action-cancel-setup-trade-route",
| 576| 576| 				"tooltip": actionInfo.tooltip,
| 577| 577| 				"target": target
| 578|    |-			}
|    | 578|+			};
| 579| 579| 		},
| 580| 580| 		"specificness": 2,
| 581| 581| 	},
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1104|1104| 			// Only show this action if all entities are marked uncontrollable.
|1105|1105| 			let playerState = g_SimState.players[g_ViewedPlayer];
|1106|1106| 			if (playerState && playerState.controlsAll && selection.some(ent => {
|1107|    |-					let entState = GetEntityState(ent);
|    |1107|+				let entState = GetEntityState(ent);
|1108|1108| 					return entState && entState.identity && entState.identity.controllable;
|1109|1109| 				}))
|1110|1110| 				return false;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1105|1105| 			let playerState = g_SimState.players[g_ViewedPlayer];
|1106|1106| 			if (playerState && playerState.controlsAll && selection.some(ent => {
|1107|1107| 					let entState = GetEntityState(ent);
|1108|    |-					return entState && entState.identity && entState.identity.controllable;
|    |1108|+				return entState && entState.identity && entState.identity.controllable;
|1109|1109| 				}))
|1110|1110| 				return false;
|1111|1111| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1106|1106| 			if (playerState && playerState.controlsAll && selection.some(ent => {
|1107|1107| 					let entState = GetEntityState(ent);
|1108|1108| 					return entState && entState.identity && entState.identity.controllable;
|1109|    |-				}))
|    |1109|+			}))
|1110|1110| 				return false;
|1111|1111| 
|1112|1112| 			return {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1621|1621| 		// Ensure one entity at least is controllable.
|1622|1622| 		let playerState = g_SimState.players[g_ViewedPlayer];
|1623|1623| 		if (playerState && !playerState.controlsAll && !selection.some(ent => {
|1624|    |-				let entState = GetEntityState(ent);
|    |1624|+			let entState = GetEntityState(ent);
|1625|1625| 				return entState && entState.identity && entState.identity.controllable;
|1626|1626| 			}))
|1627|1627| 			return { "possible": false };
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1622|1622| 		let playerState = g_SimState.players[g_ViewedPlayer];
|1623|1623| 		if (playerState && !playerState.controlsAll && !selection.some(ent => {
|1624|1624| 				let entState = GetEntityState(ent);
|1625|    |-				return entState && entState.identity && entState.identity.controllable;
|    |1625|+			return entState && entState.identity && entState.identity.controllable;
|1626|1626| 			}))
|1627|1627| 			return { "possible": false };
|1628|1628| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/unit_actions.js
|1623|1623| 		if (playerState && !playerState.controlsAll && !selection.some(ent => {
|1624|1624| 				let entState = GetEntityState(ent);
|1625|1625| 				return entState && entState.identity && entState.identity.controllable;
|1626|    |-			}))
|    |1626|+		}))
|1627|1627| 			return { "possible": false };
|1628|1628| 
|1629|1629| 		if (action == "set-rallypoint")

binaries/data/mods/public/gui/session/unit_actions.js
| 620| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/unit_actions.js
| 578| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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
| 513| 513| 			if (cmpGarrisonHolder)
| 514| 514| 			{
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517|    |-				    && player != +cmd.owner)
|    | 516|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 517|+				    player != +cmd.owner)
| 518| 518| 						continue;
| 519| 519| 
| 520| 520| 				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
| 515| 515| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 516| 516| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 517| 517| 				    && player != +cmd.owner)
| 518|    |-						continue;
|    | 518|+					continue;
| 519| 519| 
| 520| 520| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 521| 521| 					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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1149|1149| 
|1150|1150| 	// send Metadata info if any
|1151|1151| 	if (cmd.metadata)
|1152|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1152|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1153|1153| 
|1154|1154| 	// Tell the units to start building this new entity
|1155|1155| 	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
|1257|1257| 		}
|1258|1258| 
|1259|1259| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1260|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1260|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1261|1261| 	}
|1262|1262| 
|1263|1263| 	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
|1321|1321| 
|1322|1322| 				if (i > 0)
|1323|1323| 				{
|1324|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1324|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1325|1325| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1326|1326| 					// TODO: ensure that cmpPreviousObstruction exists
|1327|1327| 					// 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
|1484|1484| 		// Check that all its members are selected
|1485|1485| 		var fid = formationIds[0];
|1486|1486| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1487|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1488|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1487|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1488|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1489|1489| 		{
|1490|1490| 			cmpFormation.DeleteTwinFormations();
|1491|1491| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'closeClusters' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1587|1587| 	while (clusters.length > 1)
|1588|1588| 	{
|1589|1589| 		// search two clusters that are closer than the required distance
|1590|    |-		let closeClusters = undefined;
|    |1590|+		let closeClusters;
|1591|1591| 
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|    | [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
|1592|1592| 		for (let i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1593|1593| 			for (let j = i - 1; j >= 0 && !closeClusters; --j)
|1594|1594| 				if (matrix[i][j] < distSq)
|1595|    |-					closeClusters = [i,j];
|    |1595|+					closeClusters = [i, j];
|1596|1596| 
|1597|1597| 		// if no more close clusters found, just return all found clusters so far
|1598|1598| 		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
|1616|1616| 		}
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|    |-		clusters.splice(closeClusters[0],1);
|    |1619|+		clusters.splice(closeClusters[0], 1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		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
|1617|1617| 		// remove the rows and columns in the matrix for the merged clusters,
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|    |-		clusters.splice(closeClusters[1],1);
|    |1620|+		clusters.splice(closeClusters[1], 1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		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
|1618|1618| 		// and the clusters themselves from the cluster list
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|    |-		matrix.splice(closeClusters[0],1);
|    |1621|+		matrix.splice(closeClusters[0], 1);
|1622|1622| 		matrix.splice(closeClusters[1],1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|    | [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
|1619|1619| 		clusters.splice(closeClusters[0],1);
|1620|1620| 		clusters.splice(closeClusters[1],1);
|1621|1621| 		matrix.splice(closeClusters[0],1);
|1622|    |-		matrix.splice(closeClusters[1],1);
|    |1622|+		matrix.splice(closeClusters[1], 1);
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			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
|1623|1623| 		for (let i = 0; i < matrix.length; ++i)
|1624|1624| 		{
|1625|1625| 			if (matrix[i].length > closeClusters[0])
|1626|    |-				matrix[i].splice(closeClusters[0],1);
|    |1626|+				matrix[i].splice(closeClusters[0], 1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|1628| 				matrix[i].splice(closeClusters[1],1);
|1629|1629| 		}
|    | [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| 			if (matrix[i].length > closeClusters[0])
|1626|1626| 				matrix[i].splice(closeClusters[0],1);
|1627|1627| 			if (matrix[i].length > closeClusters[1])
|1628|    |-				matrix[i].splice(closeClusters[1],1);
|    |1628|+				matrix[i].splice(closeClusters[1], 1);
|1629|1629| 		}
|1630|1630| 		// add a new row of distances to the matrix and the new cluster
|1631|1631| 		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
| 774| »   »   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
|1280| ····»   »   »   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
|1281| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/helpers/Commands.js
|1511| »   »   »   »   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
|  53| var·g_Commands·=·{
|    | [NORMAL] JSHintBear:
|    | 'g_Commands' was used before it was defined.

binaries/data/mods/public/simulation/helpers/Commands.js
| 517| »   »   »   »   ····&&·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
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1488| »   »   »   &&·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
|1514| »   »   »   »   »   var·cmpUnitAI·=·Engine.QueryInterface(ent,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'cmpUnitAI' is already defined.

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1590| »   »   let·closeClusters·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'closeClusters' to 'undefined'.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1046|1046| 			},
|1047|1047| 		},
|1048|1048| 
|1049|    |-		"GARRISON":{
|    |1049|+		"GARRISON": {
|1050|1050| 			"APPROACHING": {
|1051|1051| 				"enter": function() {
|1052|1052| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [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
|2175|2175| 					"MovementUpdate": function(msg) {
|2176|2176| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2177|2177| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2178|    |-						if (msg.likelyFailure || 
|    |2178|+						if (msg.likelyFailure ||
|2179|2179| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2180|2180| 							!msg.obstructed && this.CheckRange(this.order.data))
|2181|2181| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 6.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2478|2478| 
|2479|2479| 								return type.specific == resourceType.specific &&
|2480|2480| 								    (type.specific != "meat" || resourceTemplate == template);
|2481|    |-						});
|    |2481|+							});
|2482|2482| 
|2483|2483| 						if (nearbyResource)
|2484|2484| 						{
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [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
|2810|2810| 					{
|2811|2811| 						// The building was already finished/fully repaired before we arrived;
|2812|2812| 						// let the ConstructionFinished handler handle this.
|2813|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2813|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2814|2814| 						return true;
|2815|2815| 					}
|2816|2816| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 				this.StopTimer();
|3101|3101| 				this.ResetAnimation();
|3102|3102| 				if (this.formationAnimationVariant)
|3103|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3103|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3104|3104| 				else
|3105|3105| 					this.SetDefaultAnimationVariant();
|3106|3106| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3326|3326| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3327|3327| 
|3328|3328| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3329|    |-							// only used for domestic animals
|    |3329|+		// only used for domestic animals
|3330|3330| 
|3331|3331| 		// Reuse the same garrison behaviour for animals.
|3332|3332| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3378|3378| 
|3379|3379| UnitAI.prototype.IsAnimal = function()
|3380|3380| {
|3381|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3381|+	return (!!this.template.NaturalBehaviour);
|3382|3382| };
|3383|3383| 
|3384|3384| 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
|3518|3518| 		{
|3519|3519| 			let index = this.GetCurrentState().indexOf(".");
|3520|3520| 			if (index != -1)
|3521|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3521|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3522|3522| 			this.Stop(false);
|3523|3523| 		}
|3524|3524| 
|    | [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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3574|3574| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3575|3575| 			continue;
|3576|3576| 		if (i == 0)
|3577|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3577|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3578|3578| 		else
|3579|3579| 			this.orderQueue.splice(i, 1);
|3580|3580| 		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
|3661|3661| };
|3662|3662| 
|3663|3663| 
|3664|    |-//// FSM linkage functions ////
|    |3664|+// // FSM linkage functions ////
|3665|3665| 
|3666|3666| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3667|3667| 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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|3833|3833| 				continue;
|3834|3834| 			if (this.orderQueue[i].type == type)
|3835|3835| 				continue;
|3836|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3836|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3837|3837| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3838|3838| 			return;
|3839|3839| 		}
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4074|4074| 	if (data.timerRepeat === undefined)
|4075|4075| 		this.timer = undefined;
|4076|4076| 
|4077|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4077|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4078|4078| };
|4079|4079| 
|4080|4080| /**
|    | [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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4119|4119| 	// TODO: This is a bit inefficient since every unit listens to every
|4120|4120| 	// construction message - ideally we could scope it to only the one we're building
|4121|4121| 
|4122|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4122|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4123|4123| };
|4124|4124| 
|4125|4125| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4158|4158| 	if (msg.fromStatusEffect)
|4159|4159| 		return;
|4160|4160| 
|4161|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4161|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4162|4162| };
|4163|4163| 
|4164|4164| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4163|4163| 
|4164|4164| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4165|4165| {
|4166|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4166|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4167|4167| };
|4168|4168| 
|4169|4169| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4168|4168| 
|4169|4169| UnitAI.prototype.OnHealthChanged = function(msg)
|4170|4170| {
|4171|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4171|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4172|4172| };
|4173|4173| 
|4174|4174| 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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4174|4174| UnitAI.prototype.OnRangeUpdate = function(msg)
|4175|4175| {
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4177|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|4179| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|    | [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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4176|4176| 	if (msg.tag == this.losRangeQuery)
|4177|4177| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4178|4178| 	else if (msg.tag == this.losHealRangeQuery)
|4179|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4179|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4181|4181| 
|4182|4182| UnitAI.prototype.OnPackFinished = function(msg)
|4183|4183| {
|4184|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4184|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4185|4185| };
|4186|4186| 
|4187|4187| //// 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
|4184|4184| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4185|4185| };
|4186|4186| 
|4187|    |-//// Helper functions to be called by the FSM ////
|    |4187|+// // Helper functions to be called by the FSM ////
|4188|4188| 
|4189|4189| UnitAI.prototype.GetWalkSpeed = function()
|4190|4190| {
|    | [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
|4914|4914| UnitAI.prototype.AttackEntityInZone = function(ents)
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|    |-		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4917|+		this.CanAttack(target) &&
|    |4918|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|4919| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	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
|4915|4915| {
|4916|4916| 	var target = ents.find(target =>
|4917|4917| 		this.CanAttack(target)
|4918|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4919|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4918|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4919|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4920|4920| 	);
|4921|4921| 	if (!target)
|4922|4922| 		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
|4981|4981| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4982|4982| 	if (this.isGuardOf)
|4983|4983| 	{
|4984|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4984|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    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
|4985|4985| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4986|4986| 		if (cmpUnitAI && cmpAttack &&
|4987|4987| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4988|    |-				return false;
|    |4988|+			return false;
|4989|4989| 	}
|4990|4990| 
|4991|4991| 	// 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
|5023|5023| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    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
|5036|5036| 	return false;
|5037|5037| };
|5038|5038| 
|5039|    |-//// External interface functions ////
|    |5039|+// // External interface functions ////
|5040|5040| 
|5041|5041| UnitAI.prototype.SetFormationController = function(ent)
|5042|5042| {
|    | [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
|5192|5192| 	{
|5193|5193| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5194|5194| 			return;
|5195|    |-		else
|5196|    |-			this.RemoveGuard();
|    |5195|+		this.RemoveGuard();
|5197|5196| 	}
|5198|5197| 
|5199|5198| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5526|5526| 
|5527|5527| 	if (this.IsFormationController())
|5528|5528| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5529|    |-}
|    |5529|+};
|5530|5530| /**
|5531|5531|  * Adds trade order to the queue. Either walk to the first market, or
|5532|5532|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5547|5547| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5548|5548| 	{
|5549|5549| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5550|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5550|+		if (cmpTrader.HasBothMarkets() &&
|5551|5551| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5552|5552| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5553|5553| 		{
|    | [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
|5828|5828| 				{
|5829|5829| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5830|5830| 					var targetClasses = this.order.data.targetClasses;
|5831|    |-					if (targetClasses.attack && cmpIdentity
|5832|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5831|+					if (targetClasses.attack && cmpIdentity &&
|    |5832|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|5834| 					if (targetClasses.avoid && cmpIdentity
|5835|5835| 						&& 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
|5831|5831| 					if (targetClasses.attack && cmpIdentity
|5832|5832| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5833|5833| 						continue;
|5834|    |-					if (targetClasses.avoid && cmpIdentity
|5835|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5834|+					if (targetClasses.avoid && cmpIdentity &&
|    |5835|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5836|5836| 						continue;
|5837|5837| 					// Only used by the AIs to prevent some choices of targets
|5838|5838| 					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
|5854|5854| 		{
|5855|5855| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5856|5856| 			var targetClasses = this.order.data.targetClasses;
|5857|    |-			if (cmpIdentity && targetClasses.attack
|5858|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5857|+			if (cmpIdentity && targetClasses.attack &&
|    |5858|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|5860| 			if (cmpIdentity && targetClasses.avoid
|5861|5861| 				&& 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
|5857|5857| 			if (cmpIdentity && targetClasses.attack
|5858|5858| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5859|5859| 				continue;
|5860|    |-			if (cmpIdentity && targetClasses.avoid
|5861|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5860|+			if (cmpIdentity && targetClasses.avoid &&
|    |5861|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5862|5862| 				continue;
|5863|5863| 			// Only used by the AIs to prevent some choices of targets
|5864|5864| 			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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = { "x": x, "z": z};
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6017|6017| 
|6018|6018| UnitAI.prototype.SetHeldPosition = function(x, z)
|6019|6019| {
|6020|    |-	this.heldPosition = {"x": x, "z": z};
|    |6020|+	this.heldPosition = {"x": x, "z": z };
|6021|6021| };
|6022|6022| 
|6023|6023| 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
|6044|6044| 	return false;
|6045|6045| };
|6046|6046| 
|6047|    |-//// Helper functions ////
|    |6047|+// // Helper functions ////
|6048|6048| 
|6049|6049| /**
|6050|6050|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6063|6063| 		return undefined;
|6064|6064| 
|6065|6065| 	return component.GetRange(type);
|6066|    |-}
|    |6066|+};
|6067|6067| 
|6068|6068| UnitAI.prototype.CanAttack = function(target)
|6069|6069| {
|    | [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
|6239|6239| 	return cmpPack && cmpPack.IsPacking();
|6240|6240| };
|6241|6241| 
|6242|    |-//// Formation specific functions ////
|    |6242|+// // Formation specific functions ////
|6243|6243| 
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|    | [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
|6244|6244| UnitAI.prototype.IsAttackingAsFormation = function()
|6245|6245| {
|6246|6246| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6247|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6248|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6247|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6248|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|6251| //// 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
|6248|6248| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6249|6249| };
|6250|6250| 
|6251|    |-//// Animal specific functions ////
|    |6251|+// // Animal specific functions ////
|6252|6252| 
|6253|6253| UnitAI.prototype.MoveRandomly = function(distance)
|6254|6254| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3979| »   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
|4901| »   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
|4916| »   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
|4964| »   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
|4987| »   »   ····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
|2020| »   »   »   »   »   »   &&·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
|3103| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

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

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

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

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

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

I can't find a fault in this version:

  • GUI works for controllable/uncontrollable entities of the player, and of other players
  • Activating the control-all cheat does allow one to control all uncontrollable entities
  • Controllable entities still work, obviously

See inline, otherwise seems fine in general to me.

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

Why did you delete these two?

Freagarach added inline comments.Aug 21 2020, 10:08 AM
binaries/data/mods/public/simulation/helpers/Commands.js
371

Because it is checked earlier now, so we won't be able to arrive here, IIRC.

bb added a subscriber: bb.Aug 26 2020, 8:50 PM

Open question: do we need to put this in the unit viewer/tooltip? Maybe not since the tooltip will say it quickly.

binaries/data/mods/public/gui/session/unit_actions.js
1122–1124

linter complaining about indent

binaries/data/mods/public/simulation/components/Identity.js
111
binaries/data/mods/public/simulation/components/UnitAI.js
216

cmpUnitAI.IsDomestic looks like unused after this patch

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

However that is in unit_actions.js, hence in the gui, which is only ran for one client. NOT for all clients. Hence we run into similar stuff like D2810, we should check the controlability here too.
refs #880

865

Why is this in the sim? IMO the player should be notified immediately from the gui, not a few turn later (in MP) when the order is tried being processed.

1711–1712

so I can control a unit owned by ally which is not controllable?

wraitii added inline comments.Aug 27 2020, 9:32 AM
binaries/data/mods/public/simulation/helpers/Commands.js
865

There is an instant notification in the GUI -> the icons don't appear / something tells you it's not working.

This is a fallback for the case where something unexpected happens, such as a player selecting controllable and uncontrollable units and ordering them to move.

I'm not sure with our current design that we can really improve a ton on this.

Freagarach marked 6 inline comments as done.
  • Rebased.
  • Some linter issues.
  • Remove IsDomestic function from UnitAI.
  • Fix allied entities.
Freagarach added inline comments.Aug 27 2020, 10:18 AM
binaries/data/mods/public/simulation/helpers/Commands.js
17

The entities are filtered here. (Introduced in rP13367 where the warnings below were not removed.)

371

I should have more explicit that I meant not that it was changed in this diff.
If you want I can move this to a separate diff?

1711–1712

Ah yes, this function is not used how it should when reading its name ^^

Stan added a comment.Aug 27 2020, 10:20 AM

Can we play a sound when the unit refuses to move ?

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

builderr-debug-macos.txt
In file included from ../../../source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp:23:
In file included from ../../../source/tools/atlas/AtlasObject/JSONSpiritInclude.h:32:
In file included from ../../../source/third_party/jsonspirit/json_spirit_writer_template.h:13:
../../../source/third_party/jsonspirit/json_spirit_value.h:586:24: warning: 'static' function 'value_type_to_string' declared in header file should be declared 'static inline' [-Wunneeded-internal-declaration]
    static std::string value_type_to_string( const Value_type vtype )
                       ^
In file included from ../../../source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp:23:
In file included from ../../../source/tools/atlas/AtlasObject/JSONSpiritInclude.h:32:
../../../source/third_party/jsonspirit/json_spirit_writer_template.h:37:50: warning: unused typedef 'Char_type' [-Wunused-local-typedef]
        typedef typename String_type::value_type Char_type;
                                                 ^
2 warnings generated.
ld: warning: direct access in function 'wxNavigationEnabled<wxWindow>::wxNavigationEnabled()' from file 'obj/AtlasUI_Debug/ActorEditor.o' to global weak symbol 'wxNavigationEnabled<wxWindow>::OnChildFocus(wxChildFocusEvent&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_filedlg.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxNavigationEnabled<wxWindow>::wxNavigationEnabled()' from file 'obj/AtlasUI_Debug/ActorEditor.o' to global weak symbol 'wxNavigationEnabled<wxWindow>::OnFocus(wxFocusEvent&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_filedlg.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxNavigationEnabled<wxWindow>::wxNavigationEnabled()' from file 'obj/AtlasUI_Debug/ActorEditor.o' to global weak symbol 'wxNavigationEnabled<wxWindow>::OnNavigationKey(wxNavigationKeyEvent&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_filedlg.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxStringToStringHashMap_wxImplementation_HashTable::clear()' from file 'obj/AtlasUI_Debug/ActorEditor.o' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxStringToNumHashMap_wxImplementation_HashTable::clear()' from file 'obj/AtlasUI_Debug/ActorEditor.o' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxAnyButton::DoSetBitmap(wxBitmap const&, wxAnyButtonBase::State)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_anybutton_osx.o)' to global weak symbol 'typeinfo for wxButtonImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_button.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::GetComboPeer() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::GetCount() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::GetCount() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::DoDeleteOneItem(unsigned int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::DoDeleteOneItem(unsigned int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::DoClear()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::DoClear()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::GetSelection() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::GetSelection() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::SetSelection(int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::SetSelection(int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::FindString(wxString const&, bool) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::GetString(unsigned int) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::SetString(unsigned int, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::SetString(unsigned int, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::Popup()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::Popup()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::Dismiss()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::Dismiss()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::Create(wxWindow*, int, wxPoint const&, wxSize const&, int, wxString const*, long, wxValidator const&, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::GetListPeer() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::~wxListBox()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::FreeData()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoSetFirstItem(int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::EnsureVisible(int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoDeleteOneItem(unsigned int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoClear()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxListBox::DoClear()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoSetSelection(int, bool)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::IsSelected(int) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::GetSelections(wxArrayInt&) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::GetSelection() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxListBox::GetSelection() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoListHitTest(wxPoint const&) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::SetString(unsigned int, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxStringToStringHashMap_wxImplementation_HashTable::CreateNode(wxStringToStringHashMap_wxImplementation_Pair const&, unsigned long)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_containr.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::GetBucketForNode(wxStringToStringHashMap_wxImplementation_HashTable*, wxStringToStringHashMap_wxImplementation_HashTable::Node*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::ExtraData::ExtraData()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_filefn.o)' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLog::CallDoLogNow(unsigned long, wxString const&, wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLog::CallDoLogNow(unsigned long, wxString const&, wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::Copy(wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::Copy(wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::GetBucketForNode(wxStringToStringHashMap_wxImplementation_HashTable*, wxStringToStringHashMap_wxImplementation_HashTable::Node*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::Copy(wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::GetBucketForNode(wxStringToStringHashMap_wxImplementation_HashTable*, wxStringToStringHashMap_wxImplementation_HashTable::Node*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxScopedPtr<wxMsgCatalog>::~wxScopedPtr()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxTranslations::~wxTranslations()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxTranslations::GetBestTranslation(wxString const&, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxTranslations::GetBestTranslation(wxString const&, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxMsgCatalog::wxMsgCatalog(wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxExecute(char**, int, wxProcess*, wxExecuteEnv const*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_utilsunx.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxExecute(char**, int, wxProcess*, wxExecuteEnv const*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_utilsunx.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
builderr-release-macos.txt
In file included from ../../../source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp:23:
In file included from ../../../source/tools/atlas/AtlasObject/JSONSpiritInclude.h:32:
In file included from ../../../source/third_party/jsonspirit/json_spirit_writer_template.h:13:
../../../source/third_party/jsonspirit/json_spirit_value.h:586:24: warning: 'static' function 'value_type_to_string' declared in header file should be declared 'static inline' [-Wunneeded-internal-declaration]
    static std::string value_type_to_string( const Value_type vtype )
                       ^
In file included from ../../../source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Map/Map.cpp:23:
In file included from ../../../source/tools/atlas/AtlasObject/JSONSpiritInclude.h:32:
../../../source/third_party/jsonspirit/json_spirit_writer_template.h:37:50: warning: unused typedef 'Char_type' [-Wunused-local-typedef]
        typedef typename String_type::value_type Char_type;
                                                 ^
2 warnings generated.
ld: warning: direct access in function 'wxLogger::~wxLogger()' from file 'obj/AtlasUI_Release/ActorEditor.o' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogger::~wxLogger()' from file 'obj/AtlasUI_Release/ActorEditor.o' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxNavigationEnabled<wxWindow>::wxNavigationEnabled()' from file 'obj/AtlasUI_Release/ActorEditor.o' to global weak symbol 'wxNavigationEnabled<wxWindow>::OnChildFocus(wxChildFocusEvent&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_filedlg.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxNavigationEnabled<wxWindow>::wxNavigationEnabled()' from file 'obj/AtlasUI_Release/ActorEditor.o' to global weak symbol 'wxNavigationEnabled<wxWindow>::OnFocus(wxFocusEvent&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_filedlg.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxNavigationEnabled<wxWindow>::wxNavigationEnabled()' from file 'obj/AtlasUI_Release/ActorEditor.o' to global weak symbol 'wxNavigationEnabled<wxWindow>::OnNavigationKey(wxNavigationKeyEvent&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_filedlg.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxAnyButton::DoSetBitmap(wxBitmap const&, wxAnyButtonBase::State)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_anybutton_osx.o)' to global weak symbol 'typeinfo for wxButtonImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_button.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::GetComboPeer() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::GetCount() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::GetCount() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::DoDeleteOneItem(unsigned int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::DoDeleteOneItem(unsigned int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::DoClear()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::DoClear()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::GetSelection() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::GetSelection() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::SetSelection(int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::SetSelection(int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::FindString(wxString const&, bool) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::GetString(unsigned int) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::SetString(unsigned int, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::SetString(unsigned int, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::Popup()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::Popup()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxComboBox::Dismiss()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxComboBox::Dismiss()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_combobox_osx.o)' to global weak symbol 'typeinfo for wxComboWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_combobox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::Create(wxWindow*, int, wxPoint const&, wxSize const&, int, wxString const*, long, wxValidator const&, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::GetListPeer() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::~wxListBox()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::FreeData()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoSetFirstItem(int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::EnsureVisible(int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoDeleteOneItem(unsigned int)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoClear()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxListBox::DoClear()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoSetSelection(int, bool)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::IsSelected(int) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::GetSelections(wxArrayInt&) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::GetSelection() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'non-virtual thunk to wxListBox::GetSelection() const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoListHitTest(wxPoint const&) const' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::DoInsertItems(wxArrayStringsAdapter const&, unsigned int, void**, wxClientDataType)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxListBox::SetString(unsigned int, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_listbox_osx.o)' to global weak symbol 'typeinfo for wxListWidgetImpl' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_listbox.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxStringToStringHashMap::~wxStringToStringHashMap()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_carbon_font.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxStringToStringHashMap_wxImplementation_HashTable::CreateNode(wxStringToStringHashMap_wxImplementation_Pair const&, unsigned long)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_containr.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::GetBucketForNode(wxStringToStringHashMap_wxImplementation_HashTable*, wxStringToStringHashMap_wxImplementation_HashTable::Node*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::ExtraData::ExtraData()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_filefn.o)' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::~wxLogRecordInfo()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::~wxLogRecordInfo()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLog::CallDoLogNow(unsigned long, wxString const&, wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLog::CallDoLogNow(unsigned long, wxString const&, wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxStringToNumHashMap::~wxStringToNumHashMap()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::Copy(wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToNumHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::Copy(wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::GetBucketForNode(wxStringToStringHashMap_wxImplementation_HashTable*, wxStringToStringHashMap_wxImplementation_HashTable::Node*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxLogRecordInfo::Copy(wxLogRecordInfo const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_log.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::GetBucketForNode(wxStringToStringHashMap_wxImplementation_HashTable*, wxStringToStringHashMap_wxImplementation_HashTable::Node*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxScopedPtr<wxMsgCatalog>::~wxScopedPtr()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxTranslations::~wxTranslations()' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxTranslations::GetBestTranslation(wxString const&, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxTranslations::GetBestTranslation(wxString const&, wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxMsgCatalog::wxMsgCatalog(wxString const&)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_translation.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxExecute(char**, int, wxProcess*, wxExecuteEnv const*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_utilsunx.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in function 'wxExecute(char**, int, wxProcess*, wxExecuteEnv const*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_baseu-3.0.a(baselib_utilsunx.o)' to global weak symbol 'wxStringToStringHashMap_wxImplementation_HashTable::DeleteNode(_wxHashTable_NodeBase*)' from file '/Users/wfg/Jenkins/workspace/macos-differential/libraries/osx/wxwidgets/lib/libwx_osx_cocoau_core-3.0.a(corelib_osx_cocoa_window.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.

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

Stan added a comment.Aug 27 2020, 10:34 AM

The good thing is playsound just does nothing if there is no soundgroup in the template so you can add it with little extra code.