Page MenuHomeWildfire Games

Patch "Missing cmpTechnologyManager check in Commands.js"ºº
ClosedPublic

Authored by Ampaex on Feb 13 2020, 12:45 AM.

Details

Test Plan

When upgrade command is passed on a player which does not have cmpTechnologyManager, like gaia, it checks it and should display a warn.
I'm doing my best trying to learn this workflow and understanding this project. Let me know if it's something wrong :D

Diff Detail

Event Timeline

Ampaex created this revision.Feb 13 2020, 12:45 AM
Owners added a subscriber: Restricted Owners Package.Feb 13 2020, 12:45 AM

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
| 527| 527| 			if (cmpGarrisonHolder)
| 528| 528| 			{
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531|    |-				    && player != +cmd.owner)
|    | 530|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 531|+				    player != +cmd.owner)
| 532| 532| 						continue;
| 533| 533| 
| 534| 534| 				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
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530| 530| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531| 531| 				    && player != +cmd.owner)
| 532|    |-						continue;
|    | 532|+					continue;
| 533| 533| 
| 534| 534| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 535| 535| 					notifyUnloadFailure(player, garrisonHolder);
|    | [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
| 735| 735| 
| 736| 736| 			var cmpTechnologyManager = QueryOwnerInterface(ent, IID_TechnologyManager);
| 737| 737| 
| 738|    |-			//Check if the player has cmpTecnologyManager
|    | 738|+			// Check if the player has cmpTecnologyManager
| 739| 739| 			if(cmpTechnologyManager == null){
| 740| 740| 				if (g_DebugCommands)
| 741| 741| 					warn("Invalid command: the selected player's technology cannot be upgraded: " + uneval(cmd));
|    | [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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1249|1249| 		}
|1250|1250| 
|1251|1251| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1252|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1252|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1253|1253| 	}
|1254|1254| 
|1255|1255| 	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
|1313|1313| 
|1314|1314| 				if (i > 0)
|1315|1315| 				{
|1316|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1316|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1317|1317| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1318|1318| 					// TODO: ensure that cmpPreviousObstruction exists
|1319|1319| 					// 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
|1476|1476| 		// Check that all its members are selected
|1477|1477| 		var fid = formationIds[0];
|1478|1478| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1479|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1480|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1479|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1480|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1481|1481| 		{
|1482|1482| 			cmpFormation.DeleteTwinFormations();
|1483|1483| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1584|1584| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1585|1585| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1586|1586| 				if (matrix[i][j] < distSq)
|1587|    |-					closeClusters = [i,j];
|    |1587|+					closeClusters = [i, j];
|1588|1588| 
|1589|1589| 		// if no more close clusters found, just return all found clusters so far
|1590|1590| 		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
|1606|1606| 		}
|1607|1607| 		// remove the rows and columns in the matrix for the merged clusters,
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|    |-		clusters.splice(closeClusters[0],1);
|    |1609|+		clusters.splice(closeClusters[0], 1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|1612| 		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
|1607|1607| 		// remove the rows and columns in the matrix for the merged clusters,
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|    |-		clusters.splice(closeClusters[1],1);
|    |1610|+		clusters.splice(closeClusters[1], 1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|1612| 		matrix.splice(closeClusters[1],1);
|1613|1613| 		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
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|    |-		matrix.splice(closeClusters[0],1);
|    |1611|+		matrix.splice(closeClusters[0], 1);
|1612|1612| 		matrix.splice(closeClusters[1],1);
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|    |-		matrix.splice(closeClusters[1],1);
|    |1612|+		matrix.splice(closeClusters[1], 1);
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|1615|1615| 			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
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|1615|1615| 			if (matrix[i].length > closeClusters[0])
|1616|    |-				matrix[i].splice(closeClusters[0],1);
|    |1616|+				matrix[i].splice(closeClusters[0], 1);
|1617|1617| 			if (matrix[i].length > closeClusters[1])
|1618|1618| 				matrix[i].splice(closeClusters[1],1);
|1619|1619| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1615|1615| 			if (matrix[i].length > closeClusters[0])
|1616|1616| 				matrix[i].splice(closeClusters[0],1);
|1617|1617| 			if (matrix[i].length > closeClusters[1])
|1618|    |-				matrix[i].splice(closeClusters[1],1);
|    |1618|+				matrix[i].splice(closeClusters[1], 1);
|1619|1619| 		}
|1620|1620| 		// add a new row of distances to the matrix and the new cluster
|1621|1621| 		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
| 739| »   »   »   if(cmpTechnologyManager·==·null){
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/helpers/Commands.js
| 787| »   »   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
|1272| ····»   »   »   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
|1273| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

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

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

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

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

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

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

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

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

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

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

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

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

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

Ampaex edited the test plan for this revision. (Show Details)Feb 13 2020, 12:53 AM
Ampaex edited the test plan for this revision. (Show Details)Feb 13 2020, 12:55 AM
Ampaex edited the test plan for this revision. (Show Details)Feb 13 2020, 12:58 AM
Silier requested changes to this revision.EditedFeb 13 2020, 5:31 AM

Thank you for working on this.
However it has small isssue, checking for technology component needs to be done only if upgrade requires some technology to be reaearched L737.

Thats because when entity does not require any technology to be researched, player without technology manager should be allowed to upgrade it.

For the checking. The prefered way is to check with '!'

see (https://trac.wildfiregames.com/wiki/Coding_Conventions)

This revision now requires changes to proceed.Feb 13 2020, 5:31 AM
Ampaex updated this revision to Diff 11339.EditedFeb 13 2020, 1:04 PM

Changes were made as indicated by Angen.

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
| 527| 527| 			if (cmpGarrisonHolder)
| 528| 528| 			{
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531|    |-				    && player != +cmd.owner)
|    | 530|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 531|+				    player != +cmd.owner)
| 532| 532| 						continue;
| 533| 533| 
| 534| 534| 				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
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530| 530| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531| 531| 				    && player != +cmd.owner)
| 532|    |-						continue;
|    | 532|+					continue;
| 533| 533| 
| 534| 534| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 535| 535| 					notifyUnloadFailure(player, garrisonHolder);
|    | [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
| 735| 735| 
| 736| 736| 			var cmpTechnologyManager = QueryOwnerInterface(ent, IID_TechnologyManager);
| 737| 737| 
| 738|    |-			//Check if the player has cmpTecnologyManager
|    | 738|+			// Check if the player has cmpTecnologyManager
| 739| 739| 			if(!cmpTechnologyManager && !cmpTechnologyManager.IsTechnologyResearched(cmpUpgrade.GetRequiredTechnology(cmd.template))){
| 740| 740| 				if (g_DebugCommands)
| 741| 741| 					warn("Invalid command: the selected player's technology cannot be upgraded: " + uneval(cmd));
|    | [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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1249|1249| 		}
|1250|1250| 
|1251|1251| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1252|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1252|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1253|1253| 	}
|1254|1254| 
|1255|1255| 	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
|1313|1313| 
|1314|1314| 				if (i > 0)
|1315|1315| 				{
|1316|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1316|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1317|1317| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1318|1318| 					// TODO: ensure that cmpPreviousObstruction exists
|1319|1319| 					// 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
|1476|1476| 		// Check that all its members are selected
|1477|1477| 		var fid = formationIds[0];
|1478|1478| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1479|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1480|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1479|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1480|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1481|1481| 		{
|1482|1482| 			cmpFormation.DeleteTwinFormations();
|1483|1483| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1584|1584| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1585|1585| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1586|1586| 				if (matrix[i][j] < distSq)
|1587|    |-					closeClusters = [i,j];
|    |1587|+					closeClusters = [i, j];
|1588|1588| 
|1589|1589| 		// if no more close clusters found, just return all found clusters so far
|1590|1590| 		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
|1606|1606| 		}
|1607|1607| 		// remove the rows and columns in the matrix for the merged clusters,
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|    |-		clusters.splice(closeClusters[0],1);
|    |1609|+		clusters.splice(closeClusters[0], 1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|1612| 		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
|1607|1607| 		// remove the rows and columns in the matrix for the merged clusters,
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|    |-		clusters.splice(closeClusters[1],1);
|    |1610|+		clusters.splice(closeClusters[1], 1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|1612| 		matrix.splice(closeClusters[1],1);
|1613|1613| 		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
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|    |-		matrix.splice(closeClusters[0],1);
|    |1611|+		matrix.splice(closeClusters[0], 1);
|1612|1612| 		matrix.splice(closeClusters[1],1);
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|    |-		matrix.splice(closeClusters[1],1);
|    |1612|+		matrix.splice(closeClusters[1], 1);
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|1615|1615| 			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
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|1615|1615| 			if (matrix[i].length > closeClusters[0])
|1616|    |-				matrix[i].splice(closeClusters[0],1);
|    |1616|+				matrix[i].splice(closeClusters[0], 1);
|1617|1617| 			if (matrix[i].length > closeClusters[1])
|1618|1618| 				matrix[i].splice(closeClusters[1],1);
|1619|1619| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1615|1615| 			if (matrix[i].length > closeClusters[0])
|1616|1616| 				matrix[i].splice(closeClusters[0],1);
|1617|1617| 			if (matrix[i].length > closeClusters[1])
|1618|    |-				matrix[i].splice(closeClusters[1],1);
|    |1618|+				matrix[i].splice(closeClusters[1], 1);
|1619|1619| 		}
|1620|1620| 		// add a new row of distances to the matrix and the new cluster
|1621|1621| 		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
| 739| »   »   »   if(!cmpTechnologyManager·&&·!cmpTechnologyManager.IsTechnologyResearched(cmpUpgrade.GetRequiredTechnology(cmd.template))){
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/helpers/Commands.js
| 787| »   »   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
|1272| ····»   »   »   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
|1273| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

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

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

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

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

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

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

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

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

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

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

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

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

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

Silier requested changes to this revision.Feb 13 2020, 1:31 PM

You misunderstood me or code

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

thats not correct,
you are checking if technology manager does not exists and required technology is not researched, more you do not know here if Getrequiredtechnology returns valid value

next problem is logic introduced here (if would be correct, whats not), if cmpTechManager does not exist next part of condition is evaluated and fails on calling function upon undefined cmpTechnologyManager

As I pointed out, L737 checks if upgradable entity does require some technology to be researched cmpUpgrade.GetRequiredTechnology(cmd.template) only if this returns true, next part is evaluated !cmpTechnologyManager.IsTechnologyResearched(cmpUpgrade.GetRequiredTechnology(cmd.template)) problem which needs to be solved is that cmpTechnologyManager does not have to exits, but performed check cannot influence behaviour when no technology is required for upgrade

This revision now requires changes to proceed.Feb 13 2020, 1:31 PM
Ampaex updated this revision to Diff 11343.Feb 13 2020, 8:30 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 527| 527| 			if (cmpGarrisonHolder)
| 528| 528| 			{
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531|    |-				    && player != +cmd.owner)
|    | 530|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 531|+				    player != +cmd.owner)
| 532| 532| 						continue;
| 533| 533| 
| 534| 534| 				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
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530| 530| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531| 531| 				    && player != +cmd.owner)
| 532|    |-						continue;
|    | 532|+					continue;
| 533| 533| 
| 534| 534| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 535| 535| 					notifyUnloadFailure(player, garrisonHolder);
|    | [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
| 735| 735| 
| 736| 736| 			var cmpTechnologyManager = QueryOwnerInterface(ent, IID_TechnologyManager);
| 737| 737| 
| 738|    |-			//Check if the player requiring a technology has cmpTecnologyManager
|    | 738|+			// Check if the player requiring a technology has cmpTecnologyManager
| 739| 739| 			if(cmpUpgrade.GetRequiredTechnology(cmd.template) && !cmpTechnologyManager){
| 740| 740| 				if (g_DebugCommands)
| 741| 741| 					warn("Invalid command: the selected player cannot upgrade this technology : " + uneval(cmd));
|    | [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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1141|1141| 
|1142|1142| 	// send Metadata info if any
|1143|1143| 	if (cmd.metadata)
|1144|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1144|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1145|1145| 
|1146|1146| 	// Tell the units to start building this new entity
|1147|1147| 	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
|1249|1249| 		}
|1250|1250| 
|1251|1251| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1252|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1252|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1253|1253| 	}
|1254|1254| 
|1255|1255| 	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
|1313|1313| 
|1314|1314| 				if (i > 0)
|1315|1315| 				{
|1316|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1316|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1317|1317| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1318|1318| 					// TODO: ensure that cmpPreviousObstruction exists
|1319|1319| 					// 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
|1476|1476| 		// Check that all its members are selected
|1477|1477| 		var fid = formationIds[0];
|1478|1478| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1479|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1480|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1479|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1480|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1481|1481| 		{
|1482|1482| 			cmpFormation.DeleteTwinFormations();
|1483|1483| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1584|1584| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1585|1585| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1586|1586| 				if (matrix[i][j] < distSq)
|1587|    |-					closeClusters = [i,j];
|    |1587|+					closeClusters = [i, j];
|1588|1588| 
|1589|1589| 		// if no more close clusters found, just return all found clusters so far
|1590|1590| 		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
|1606|1606| 		}
|1607|1607| 		// remove the rows and columns in the matrix for the merged clusters,
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|    |-		clusters.splice(closeClusters[0],1);
|    |1609|+		clusters.splice(closeClusters[0], 1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|1612| 		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
|1607|1607| 		// remove the rows and columns in the matrix for the merged clusters,
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|    |-		clusters.splice(closeClusters[1],1);
|    |1610|+		clusters.splice(closeClusters[1], 1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|1612| 		matrix.splice(closeClusters[1],1);
|1613|1613| 		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
|1608|1608| 		// and the clusters themselves from the cluster list
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|    |-		matrix.splice(closeClusters[0],1);
|    |1611|+		matrix.splice(closeClusters[0], 1);
|1612|1612| 		matrix.splice(closeClusters[1],1);
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1609|1609| 		clusters.splice(closeClusters[0],1);
|1610|1610| 		clusters.splice(closeClusters[1],1);
|1611|1611| 		matrix.splice(closeClusters[0],1);
|1612|    |-		matrix.splice(closeClusters[1],1);
|    |1612|+		matrix.splice(closeClusters[1], 1);
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|1615|1615| 			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
|1613|1613| 		for (let i = 0; i < matrix.length; ++i)
|1614|1614| 		{
|1615|1615| 			if (matrix[i].length > closeClusters[0])
|1616|    |-				matrix[i].splice(closeClusters[0],1);
|    |1616|+				matrix[i].splice(closeClusters[0], 1);
|1617|1617| 			if (matrix[i].length > closeClusters[1])
|1618|1618| 				matrix[i].splice(closeClusters[1],1);
|1619|1619| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1615|1615| 			if (matrix[i].length > closeClusters[0])
|1616|1616| 				matrix[i].splice(closeClusters[0],1);
|1617|1617| 			if (matrix[i].length > closeClusters[1])
|1618|    |-				matrix[i].splice(closeClusters[1],1);
|    |1618|+				matrix[i].splice(closeClusters[1], 1);
|1619|1619| 		}
|1620|1620| 		// add a new row of distances to the matrix and the new cluster
|1621|1621| 		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
| 739| »   »   »   if(cmpUpgrade.GetRequiredTechnology(cmd.template)·&&·!cmpTechnologyManager){
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

binaries/data/mods/public/simulation/helpers/Commands.js
| 787| »   »   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
|1272| ····»   »   »   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
|1273| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

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

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

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

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

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

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

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

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

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

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

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

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

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

Ampaex updated this revision to Diff 11345.Feb 13 2020, 8:48 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 527| 527| 			if (cmpGarrisonHolder)
| 528| 528| 			{
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531|    |-				    && player != +cmd.owner)
|    | 530|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 531|+				    player != +cmd.owner)
| 532| 532| 						continue;
| 533| 533| 
| 534| 534| 				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
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530| 530| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531| 531| 				    && player != +cmd.owner)
| 532|    |-						continue;
|    | 532|+					continue;
| 533| 533| 
| 534| 534| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 535| 535| 					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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1243|1243| 		}
|1244|1244| 
|1245|1245| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1246|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1246|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1247|1247| 	}
|1248|1248| 
|1249|1249| 	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
|1307|1307| 
|1308|1308| 				if (i > 0)
|1309|1309| 				{
|1310|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1310|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1311|1311| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1312|1312| 					// TODO: ensure that cmpPreviousObstruction exists
|1313|1313| 					// 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
|1470|1470| 		// Check that all its members are selected
|1471|1471| 		var fid = formationIds[0];
|1472|1472| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1473|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1474|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1473|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1474|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1475|1475| 		{
|1476|1476| 			cmpFormation.DeleteTwinFormations();
|1477|1477| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1578|1578| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1579|1579| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1580|1580| 				if (matrix[i][j] < distSq)
|1581|    |-					closeClusters = [i,j];
|    |1581|+					closeClusters = [i, j];
|1582|1582| 
|1583|1583| 		// if no more close clusters found, just return all found clusters so far
|1584|1584| 		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
|1600|1600| 		}
|1601|1601| 		// remove the rows and columns in the matrix for the merged clusters,
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|    |-		clusters.splice(closeClusters[0],1);
|    |1603|+		clusters.splice(closeClusters[0], 1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|1606| 		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
|1601|1601| 		// remove the rows and columns in the matrix for the merged clusters,
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|    |-		clusters.splice(closeClusters[1],1);
|    |1604|+		clusters.splice(closeClusters[1], 1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|1606| 		matrix.splice(closeClusters[1],1);
|1607|1607| 		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
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|    |-		matrix.splice(closeClusters[0],1);
|    |1605|+		matrix.splice(closeClusters[0], 1);
|1606|1606| 		matrix.splice(closeClusters[1],1);
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|    | [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
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|    |-		matrix.splice(closeClusters[1],1);
|    |1606|+		matrix.splice(closeClusters[1], 1);
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|1609|1609| 			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
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|1609|1609| 			if (matrix[i].length > closeClusters[0])
|1610|    |-				matrix[i].splice(closeClusters[0],1);
|    |1610|+				matrix[i].splice(closeClusters[0], 1);
|1611|1611| 			if (matrix[i].length > closeClusters[1])
|1612|1612| 				matrix[i].splice(closeClusters[1],1);
|1613|1613| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1609|1609| 			if (matrix[i].length > closeClusters[0])
|1610|1610| 				matrix[i].splice(closeClusters[0],1);
|1611|1611| 			if (matrix[i].length > closeClusters[1])
|1612|    |-				matrix[i].splice(closeClusters[1],1);
|    |1612|+				matrix[i].splice(closeClusters[1], 1);
|1613|1613| 		}
|1614|1614| 		// add a new row of distances to the matrix and the new cluster
|1615|1615| 		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
| 781| »   »   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
|1266| ····»   »   »   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
|1267| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

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

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

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

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

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

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

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

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

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

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

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

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

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

Ampaex updated this revision to Diff 11346.Feb 13 2020, 9:23 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 527| 527| 			if (cmpGarrisonHolder)
| 528| 528| 			{
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531|    |-				    && player != +cmd.owner)
|    | 530|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 531|+				    player != +cmd.owner)
| 532| 532| 						continue;
| 533| 533| 
| 534| 534| 				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
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530| 530| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531| 531| 				    && player != +cmd.owner)
| 532|    |-						continue;
|    | 532|+					continue;
| 533| 533| 
| 534| 534| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 535| 535| 					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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1243|1243| 		}
|1244|1244| 
|1245|1245| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1246|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1246|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1247|1247| 	}
|1248|1248| 
|1249|1249| 	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
|1307|1307| 
|1308|1308| 				if (i > 0)
|1309|1309| 				{
|1310|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1310|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1311|1311| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1312|1312| 					// TODO: ensure that cmpPreviousObstruction exists
|1313|1313| 					// 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
|1470|1470| 		// Check that all its members are selected
|1471|1471| 		var fid = formationIds[0];
|1472|1472| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1473|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1474|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1473|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1474|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1475|1475| 		{
|1476|1476| 			cmpFormation.DeleteTwinFormations();
|1477|1477| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1578|1578| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1579|1579| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1580|1580| 				if (matrix[i][j] < distSq)
|1581|    |-					closeClusters = [i,j];
|    |1581|+					closeClusters = [i, j];
|1582|1582| 
|1583|1583| 		// if no more close clusters found, just return all found clusters so far
|1584|1584| 		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
|1600|1600| 		}
|1601|1601| 		// remove the rows and columns in the matrix for the merged clusters,
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|    |-		clusters.splice(closeClusters[0],1);
|    |1603|+		clusters.splice(closeClusters[0], 1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|1606| 		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
|1601|1601| 		// remove the rows and columns in the matrix for the merged clusters,
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|    |-		clusters.splice(closeClusters[1],1);
|    |1604|+		clusters.splice(closeClusters[1], 1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|1606| 		matrix.splice(closeClusters[1],1);
|1607|1607| 		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
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|    |-		matrix.splice(closeClusters[0],1);
|    |1605|+		matrix.splice(closeClusters[0], 1);
|1606|1606| 		matrix.splice(closeClusters[1],1);
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|    | [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
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|    |-		matrix.splice(closeClusters[1],1);
|    |1606|+		matrix.splice(closeClusters[1], 1);
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|1609|1609| 			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
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|1609|1609| 			if (matrix[i].length > closeClusters[0])
|1610|    |-				matrix[i].splice(closeClusters[0],1);
|    |1610|+				matrix[i].splice(closeClusters[0], 1);
|1611|1611| 			if (matrix[i].length > closeClusters[1])
|1612|1612| 				matrix[i].splice(closeClusters[1],1);
|1613|1613| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1609|1609| 			if (matrix[i].length > closeClusters[0])
|1610|1610| 				matrix[i].splice(closeClusters[0],1);
|1611|1611| 			if (matrix[i].length > closeClusters[1])
|1612|    |-				matrix[i].splice(closeClusters[1],1);
|    |1612|+				matrix[i].splice(closeClusters[1], 1);
|1613|1613| 		}
|1614|1614| 		// add a new row of distances to the matrix and the new cluster
|1615|1615| 		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
| 781| »   »   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
|1266| ····»   »   »   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
|1267| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

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

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

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

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

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

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

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

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

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

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

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

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

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

Ampaex updated this revision to Diff 11348.Feb 13 2020, 9:33 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 527| 527| 			if (cmpGarrisonHolder)
| 528| 528| 			{
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531|    |-				    && player != +cmd.owner)
|    | 530|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 531|+				    player != +cmd.owner)
| 532| 532| 						continue;
| 533| 533| 
| 534| 534| 				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
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530| 530| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531| 531| 				    && player != +cmd.owner)
| 532|    |-						continue;
|    | 532|+					continue;
| 533| 533| 
| 534| 534| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 535| 535| 					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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1243|1243| 		}
|1244|1244| 
|1245|1245| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1246|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1246|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1247|1247| 	}
|1248|1248| 
|1249|1249| 	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
|1307|1307| 
|1308|1308| 				if (i > 0)
|1309|1309| 				{
|1310|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1310|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1311|1311| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1312|1312| 					// TODO: ensure that cmpPreviousObstruction exists
|1313|1313| 					// 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
|1470|1470| 		// Check that all its members are selected
|1471|1471| 		var fid = formationIds[0];
|1472|1472| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1473|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1474|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1473|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1474|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1475|1475| 		{
|1476|1476| 			cmpFormation.DeleteTwinFormations();
|1477|1477| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1578|1578| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1579|1579| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1580|1580| 				if (matrix[i][j] < distSq)
|1581|    |-					closeClusters = [i,j];
|    |1581|+					closeClusters = [i, j];
|1582|1582| 
|1583|1583| 		// if no more close clusters found, just return all found clusters so far
|1584|1584| 		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
|1600|1600| 		}
|1601|1601| 		// remove the rows and columns in the matrix for the merged clusters,
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|    |-		clusters.splice(closeClusters[0],1);
|    |1603|+		clusters.splice(closeClusters[0], 1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|1606| 		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
|1601|1601| 		// remove the rows and columns in the matrix for the merged clusters,
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|    |-		clusters.splice(closeClusters[1],1);
|    |1604|+		clusters.splice(closeClusters[1], 1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|1606| 		matrix.splice(closeClusters[1],1);
|1607|1607| 		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
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|    |-		matrix.splice(closeClusters[0],1);
|    |1605|+		matrix.splice(closeClusters[0], 1);
|1606|1606| 		matrix.splice(closeClusters[1],1);
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|    | [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
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|    |-		matrix.splice(closeClusters[1],1);
|    |1606|+		matrix.splice(closeClusters[1], 1);
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|1609|1609| 			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
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|1609|1609| 			if (matrix[i].length > closeClusters[0])
|1610|    |-				matrix[i].splice(closeClusters[0],1);
|    |1610|+				matrix[i].splice(closeClusters[0], 1);
|1611|1611| 			if (matrix[i].length > closeClusters[1])
|1612|1612| 				matrix[i].splice(closeClusters[1],1);
|1613|1613| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1609|1609| 			if (matrix[i].length > closeClusters[0])
|1610|1610| 				matrix[i].splice(closeClusters[0],1);
|1611|1611| 			if (matrix[i].length > closeClusters[1])
|1612|    |-				matrix[i].splice(closeClusters[1],1);
|    |1612|+				matrix[i].splice(closeClusters[1], 1);
|1613|1613| 		}
|1614|1614| 		// add a new row of distances to the matrix and the new cluster
|1615|1615| 		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
| 781| »   »   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
|1266| ····»   »   »   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
|1267| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

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

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

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

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

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

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

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

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

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

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

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

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

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

Ampaex updated this revision to Diff 11349.Feb 13 2020, 9:48 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
| 527| 527| 			if (cmpGarrisonHolder)
| 528| 528| 			{
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530|    |-				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531|    |-				    && player != +cmd.owner)
|    | 530|+				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits &&
|    | 531|+				    player != +cmd.owner)
| 532| 532| 						continue;
| 533| 533| 
| 534| 534| 				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
| 529| 529| 				// Only the owner of the garrisonHolder may unload entities from any owners
| 530| 530| 				if (!IsOwnedByPlayer(player, garrisonHolder) && !data.controlAllUnits
| 531| 531| 				    && player != +cmd.owner)
| 532|    |-						continue;
|    | 532|+					continue;
| 533| 533| 
| 534| 534| 				if (!cmpGarrisonHolder.UnloadTemplate(cmd.template, cmd.owner, cmd.all))
| 535| 535| 					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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata": cmd.metadata, "owner" : player } );
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner": player } );
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1135|1135| 
|1136|1136| 	// send Metadata info if any
|1137|1137| 	if (cmd.metadata)
|1138|    |-		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player } );
|    |1138|+		Engine.PostMessage(ent, MT_AIMetadata, { "id": ent, "metadata" : cmd.metadata, "owner" : player });
|1139|1139| 
|1140|1140| 	// Tell the units to start building this new entity
|1141|1141| 	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
|1243|1243| 		}
|1244|1244| 
|1245|1245| 		lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|1246|    |-		//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|    |1246|+		// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|1247|1247| 	}
|1248|1248| 
|1249|1249| 	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
|1307|1307| 
|1308|1308| 				if (i > 0)
|1309|1309| 				{
|1310|    |-					//warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|    |1310|+					// warn("   updating previous wall piece's secondary control group to " + newTowerControlGroup);
|1311|1311| 					var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|1312|1312| 					// TODO: ensure that cmpPreviousObstruction exists
|1313|1313| 					// 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
|1470|1470| 		// Check that all its members are selected
|1471|1471| 		var fid = formationIds[0];
|1472|1472| 		var cmpFormation = Engine.QueryInterface(+fid, IID_Formation);
|1473|    |-		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length
|1474|    |-			&& cmpFormation.GetMemberCount() == formation.entities.length)
|    |1473|+		if (cmpFormation && cmpFormation.GetMemberCount() == formation.members[fid].length &&
|    |1474|+			cmpFormation.GetMemberCount() == formation.entities.length)
|1475|1475| 		{
|1476|1476| 			cmpFormation.DeleteTwinFormations();
|1477|1477| 			// The whole formation was selected, so reuse its controller for this command
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1578|1578| 		for (var i = matrix.length - 1; i >= 0 && !closeClusters; --i)
|1579|1579| 			for (var j = i - 1; j >= 0 && !closeClusters; --j)
|1580|1580| 				if (matrix[i][j] < distSq)
|1581|    |-					closeClusters = [i,j];
|    |1581|+					closeClusters = [i, j];
|1582|1582| 
|1583|1583| 		// if no more close clusters found, just return all found clusters so far
|1584|1584| 		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
|1600|1600| 		}
|1601|1601| 		// remove the rows and columns in the matrix for the merged clusters,
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|    |-		clusters.splice(closeClusters[0],1);
|    |1603|+		clusters.splice(closeClusters[0], 1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|1606| 		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
|1601|1601| 		// remove the rows and columns in the matrix for the merged clusters,
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|    |-		clusters.splice(closeClusters[1],1);
|    |1604|+		clusters.splice(closeClusters[1], 1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|1606| 		matrix.splice(closeClusters[1],1);
|1607|1607| 		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
|1602|1602| 		// and the clusters themselves from the cluster list
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|    |-		matrix.splice(closeClusters[0],1);
|    |1605|+		matrix.splice(closeClusters[0], 1);
|1606|1606| 		matrix.splice(closeClusters[1],1);
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|    | [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
|1603|1603| 		clusters.splice(closeClusters[0],1);
|1604|1604| 		clusters.splice(closeClusters[1],1);
|1605|1605| 		matrix.splice(closeClusters[0],1);
|1606|    |-		matrix.splice(closeClusters[1],1);
|    |1606|+		matrix.splice(closeClusters[1], 1);
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|1609|1609| 			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
|1607|1607| 		for (let i = 0; i < matrix.length; ++i)
|1608|1608| 		{
|1609|1609| 			if (matrix[i].length > closeClusters[0])
|1610|    |-				matrix[i].splice(closeClusters[0],1);
|    |1610|+				matrix[i].splice(closeClusters[0], 1);
|1611|1611| 			if (matrix[i].length > closeClusters[1])
|1612|1612| 				matrix[i].splice(closeClusters[1],1);
|1613|1613| 		}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
|1609|1609| 			if (matrix[i].length > closeClusters[0])
|1610|1610| 				matrix[i].splice(closeClusters[0],1);
|1611|1611| 			if (matrix[i].length > closeClusters[1])
|1612|    |-				matrix[i].splice(closeClusters[1],1);
|    |1612|+				matrix[i].splice(closeClusters[1], 1);
|1613|1613| 		}
|1614|1614| 		// add a new row of distances to the matrix and the new cluster
|1615|1615| 		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
| 781| »   »   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
|1266| ····»   »   »   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
|1267| ····»   »   »   break;
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

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

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

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

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

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

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

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

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

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

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

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

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

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

Silier accepted this revision.Feb 13 2020, 9:57 PM

condition change is correct, when technology is required for upgrade and technology manager is not available for player or technology is not researched, upgrade is skipped.
this change does not affect upgrades, that do not require any technology

Assigning cmpUpgrade.GetRequiredTechnology(cmd.template) to variable is correct and desired because that function was called twice in a row inside the for loop.

Thank you for your work.

This revision is now accepted and ready to land.Feb 13 2020, 9:57 PM
This revision was automatically updated to reflect the committed changes.