Page MenuHomeWildfire Games

Split buildingAI for building and for entity with unitAI
AbandonedPublic

Authored by fatherbushido on Aug 12 2017, 9:54 PM.

Details

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

Some years ago was done a temporary solution http://trac.wildfiregames.com/ticket/818#comment:5 giving BuildingAI to units with UnitAI.
Meanwhile BuildingAI has been improved (see #2010).
But the hack leads to some issues #3763, rP17784, #4189, #4000 and prevent future developpement.

Following cleaning plan suggested by leper in https://wildfiregames.com/forum/index.php?/topic/21358-buildingai-unitai-attack-story-of-an-hack/ (staff only):

  • Copy old BuildingAI in ManpowerHolderBuilding and ManpowerHolderUnit (names suggested by Itms). Both component implement the same interface ManpowerHolder.
  • Remove some useless functions in ManpowerHolderBuilding (related to unitAI target).
  • Let Units with ManpowerHolderUnit do their not ranged attack.
  • Do the needed change for tooltips...
  • So: no changes (regression) compared to the current implementation, but ManpowerHolderUnit is ready to be modified in the future.
Test Plan

-

Event Timeline

fatherbushido created this revision.Aug 12 2017, 9:54 PM

Added files

fatherbushido added inline comments.Aug 12 2017, 10:06 PM
binaries/data/mods/public/globalscripts/Templates.js
219

That's wrong: should use the second parameter of getEntityValue.

Vulcan added a subscriber: Vulcan.Aug 12 2017, 10:40 PM

Build has FAILED

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests).ERROR: CVFSFile: file simulation/components/interfaces/ManpowerHolder.js couldn't be opened (vfs_load: -110101)

In TestComponentScripts::test_scripts:
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:50: Error: Assertion failed: componentManager->LoadScript(VfsPath(L"simulation/components") / pathname)
ERROR: JavaScript error: simulation/components/GuiInterface.js line 516
ReferenceError: IID_ManpowerHolder is not defined
  GuiInterface.prototype.GetExtendedEntityState@simulation/components/GuiInterface.js:516:6
  @simulation/components/tests/test_GuiInterface.js:644:25
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Test failed: L"Running script simulation/components/tests/test_GuiInterface.js"
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Assertion failed: scriptInterface.LoadScript(pathname, content)
ERROR: CVFSFile: file simulation/components/interfaces/ManpowerHolder.js couldn't be opened (vfs_load: -110101)
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:50: Error: Assertion failed: componentManager->LoadScript(VfsPath(L"simulation/components") / pathname)
ERROR: JavaScript error: simulation/components/UnitAI.js line 1967
ReferenceError: IID_ManpowerHolder is not defined
  UnitAI.prototype.UnitFsmSpec.INDIVIDUAL.COMBAT.ATTACKING.enter@simulation/components/UnitAI.js:1967:10
  FSM.prototype.SwitchToNextState@simulation/helpers/FSM.js:376:8
  FSM.prototype.ProcessMessage@simulation/helpers/FSM.js:284:4
  UnitAI.prototype.PushOrderFront@simulation/components/UnitAI.js:3795:13
  UnitAI.prototype.AttackVisibleEntity@simulation/components/UnitAI.js:4709:1
  UnitAI.prototype.RespondToTargetedEntities@simulation/components/UnitAI.js:4743:1
  UnitAI.prototype.AttackEntitiesByPreference@simulation/components/UnitAI.js:6102:8
  UnitAI.prototype.FindNewTargets@simulation/components/UnitAI.js:5571:9
  UnitAI.prototype.UnitFsmSpec.INDIVIDUAL.IDLE.enter@simulation/components/UnitAI.js:1556:9
  FSM.prototype.SwitchToNextState@simulation/helpers/FSM.js:376:8
  FSM.prototype.ProcessMessage@simulation/helpers/FSM.js:284:4
  UnitAI.prototype.SetFormationController@simulation/components/UnitAI.js:4865:3
  Formation.prototype.Disband@simulation/components/Formation.js:427:3
  TestFormationExiting@simulation/components/tests/test_UnitAI.js:158:2
  @simulation/components/tests/test_UnitAI.js:316:1
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Test failed: L"Running script simulation/components/tests/test_UnitAI.js"
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Assertion failed: scriptInterface.LoadScript(pathname, content)
................................................................................................................................................................................................................................................................................................................
Failed 1 and Skipped 0 of 306 tests
Success rate: 99%

Link to build: http://jw:8080/job/phabricator/1848/
See console output for more information: http://jw:8080/job/phabricator/1848/console

Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  46|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|  49|  49| 	});

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  46| »   »   ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·},
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 160| »   if·(mode·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 229| »   »   »   GetTurretParent:·function()·{·return·INVALID_ENTITY;·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 230| »   »   »   GetPosition:·function()·{·return·new·Vector3D();·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 231| »   »   »   GetPosition2D:·function()·{·return·new·Vector2D();·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

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

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

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

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

binaries/data/mods/public/globalscripts/Templates.js
|  61| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/globalscripts/Templates.js
|  60| »   »   if·(sublist.every(c·=>·(c[0]·==·"!"·&&·classes.indexOf(c.substr(1))·==·-1)
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/globalscripts/Templates.js
| 146| »   »   »   let·getAttackStat·=·function(stat)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/globalscripts/Templates.js
| 206| »   if·(template.ManpowerHolder·|| template.ManpowerHolderBuilding·|| template.ManpowerHolderUnit)
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/common/tooltips.js
| 606| »   »   '[/color][/font]'·+·"·"·+
|    | [NORMAL] ESLintBear (no-useless-concat):
|    | Unexpected string concatenation of literals.

binaries/data/mods/public/gui/common/tooltips.js
| 439| »   »   let·[rate,·count]·=·types.reduce((sum,·t)·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/common/tooltips.js
| 618| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/tooltips.js
| 618| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
| 209| 209| {
| 210| 210| 	if (this.miragedEntities[player])
| 211| 211| 		return this.renamedEntities.concat(this.miragedEntities[player]);
| 212|    |-	else
| 213|    |-		return this.renamedEntities;
|    | 212|+	return this.renamedEntities;
| 214| 213| };
| 215| 214| 
| 216| 215| GuiInterface.prototype.ClearRenamedEntities = function()
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|1231|1231| 
|1232|1232| 		return false;
|1233|1233| 	}
|1234|    |-	else
|1235|    |-	{
|    |1234|+	
|1236|1235| 		// Move all existing cached entities outside of the world and reset their use count
|1237|1236| 		for (let tpl in this.placementWallEntities)
|1238|1237| 		{
|1266|1265| 				}
|1267|1266| 			}
|1268|1267| 		}
|1269|    |-	}
|    |1268|+	
|1270|1269| 
|1271|1270| 	// prevent division by zero errors further on if the start and end positions are the same
|1272|1271| 	if (end.pos && (start.pos.x === end.pos.x && start.pos.z === end.pos.z))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|2032|2032| {
|2033|2033| 	if (exposedFunctions[name])
|2034|2034| 		return this[name](player, args);
|2035|    |-	else
|2036|    |-		throw new Error("Invalid GuiInterface Call name \""+name+"\"");
|    |2035|+	throw new Error("Invalid GuiInterface Call name \""+name+"\"");
|2037|2036| };
|2038|2037| 
|2039|2038| Engine.RegisterSystemComponentType(IID_GuiInterface, "GuiInterface", GuiInterface);

binaries/data/mods/public/simulation/components/GuiInterface.js
| 668| »   for·(let·name·of·auraNames)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'name' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/GuiInterface.js
| 668| »   for·(let·name·of·auraNames)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'name' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/GuiInterface.js
| 769| »   if·(notification.players·==·undefined)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'undefined'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1037| »   »   »   »   if·(cmd.queued·==·true)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'true'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1089| »   »   if·(cmd.template·==·"")
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with ''.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1510| »   »   »   »   if·(terrainGroundPrev·!=·null·||·terrainGroundNext·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1510| »   »   »   »   if·(terrainGroundPrev·!=·null·||·terrainGroundNext·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1632| »   if·(numRequiredPieces·>·0·&&·result.pieces.length·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1702| »   »   if·(minDistEntitySnapData·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1754| »   »   if(bucket·==·0·&&·data.prevUnit·&&·entity·<=·data.prevUnit)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1762| »   »   if·(data.limit·&&·bucket·==·0·&&·idleUnits[0].length·==·data.limit)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
| 124| 124| });
| 125| 125| 
| 126| 126| AddMock(100, IID_TechnologyManager, {
| 127|    |-	IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; else return false; },
|    | 127|+	IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; return false; },
| 128| 128| 	GetQueuedResearch: function() { return {}; },
| 129| 129| 	GetStartedTechs: function() { return {}; },
| 130| 130| 	GetResearchedTechs: function() { return {}; },
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
| 210| 210| });
| 211| 211| 
| 212| 212| AddMock(101, IID_TechnologyManager, {
| 213|    |-		IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; else return false; },
|    | 213|+		IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; return false; },
| 214| 214| 		GetQueuedResearch: function() { return {}; },
| 215| 215| 		GetStartedTechs: function() { return {}; },
| 216| 216| 		GetResearchedTechs: function() { return {}; },
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 911| 911| 					this.FinishOrder();
| 912| 912| 					return;
| 913| 913| 				}
| 914|    |-				else
| 915|    |-				{
|    | 914|+				
| 916| 915| 					// Out of range; move there in formation
| 917| 916| 					if (this.MoveToGarrisonRange(msg.data.target))
| 918| 917| 					{
| 919| 918| 						this.SetNextState("GARRISON.APPROACHING");
| 920| 919| 						return;
| 921| 920| 					}
| 922|    |-				}
|    | 921|+				
| 923| 922| 			}
| 924| 923| 
| 925| 924| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1960|1960| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1961|1961| 
|1962|1962| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1963|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1963|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1964|1964| 
|1965|1965| 					this.FaceTowardsTarget(this.order.data.target);
|1966|1966| 
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2187|2187| 							this.PerformGather(nearby, false, false);
|2188|2188| 							return true;
|2189|2189| 						}
|2190|    |-						else
|2191|    |-						{
|    |2190|+						
|2192|2191| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2193|2192| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2194|2193| 							// to order it to GatherNear the resource position.
|2209|2208| 									return true;
|2210|2209| 								}
|2211|2210| 							}
|2212|    |-						}
|    |2211|+						
|2213|2212| 						return true;
|2214|2213| 					}
|2215|2214| 					return false;
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2199|2199| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2200|2200| 								return true;
|2201|2201| 							}
|2202|    |-							else
|2203|    |-							{
|    |2202|+							
|2204|2203| 								// we're kind of stuck here. Return resource.
|2205|2204| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2206|2205| 								if (nearby)
|2208|2207| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2209|2208| 									return true;
|2210|2209| 								}
|2211|    |-							}
|    |2210|+							
|2212|2211| 						}
|2213|2212| 						return true;
|2214|2213| 					}
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2583|2583| 					this.StartTimer(prepare, this.healTimers.repeat);
|2584|2584| 
|2585|2585| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2586|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2586|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2587|2587| 
|2588|2588| 					this.FaceTowardsTarget(this.order.data.target);
|2589|2589| 				},
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3399|3399| 
|3400|3400| UnitAI.prototype.IsAnimal = function()
|3401|3401| {
|3402|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3402|+	return (!!this.template.NaturalBehaviour);
|3403|3403| };
|3404|3404| 
|3405|3405| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3718|3718| 		// Otherwise we've successfully processed a new order
|3719|3719| 		return true;
|3720|3720| 	}
|3721|    |-	else
|3722|    |-	{
|    |3721|+	
|3723|3722| 		this.SetNextState("IDLE");
|3724|3723| 
|3725|3724| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3740|3739| 		}
|3741|3740| 
|3742|3741| 		return false;
|3743|    |-	}
|    |3742|+	
|3744|3743| };
|3745|3744| 
|3746|3745| /**
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|4783|4783| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4784|4784| 	if (this.isGuardOf)
|4785|4785| 	{
|4786|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4786|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4787|4787| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4788|4788| 		if (cmpUnitAI && cmpAttack &&
|4789|4789| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|4830|4830| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4831|4831| 	if (this.isGuardOf)
|4832|4832| 	{
|4833|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4833|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4834|4834| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4835|4835| 		if (cmpUnitAI && cmpAttack &&
|4836|4836| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|5004|5004| 	{
|5005|5005| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5006|5006| 			return;
|5007|    |-		else
|5008|    |-			this.RemoveGuard();
|    |5007|+		this.RemoveGuard();
|5009|5008| 	}
|5010|5009| 
|5011|5010| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|5252|5252| 
|5253|5253| 	// Remember the position of our target, if any, in case it disappears
|5254|5254| 	// later and we want to head to its last known position
|5255|    |-	var lastPos = undefined;
|    |5255|+	var lastPos;
|5256|5256| 	var cmpPosition = Engine.QueryInterface(target, IID_Position);
|5257|5257| 	if (cmpPosition && cmpPosition.IsInWorld())
|5258|5258| 		lastPos = cmpPosition.GetPosition();

binaries/data/mods/public/simulation/components/UnitAI.js
|2485| »   »   »   »   »   »   let·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'nearby' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3907| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4232| »   »   let·cmpOwnership·=·Engine.QueryInterface(ent,·IID_Ownership);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpOwnership' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4705| »   var·target·=·ents.find(target·=>·this.CanAttack(target,·forceResponse));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4720| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4766| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4789| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
| 363| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1953| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2180| »   »   »   »   »   »   »   »   ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2181| »   »   »   »   »   »   »   »   ·||·(type.specific·==·oldType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2182| »   »   »   »   »   »   »   »   ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2205| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2245| »   »   »   »   »   »   »   »   &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2246| »   »   »   »   »   »   »   »   ||·(type.specific·==·oldType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2247| »   »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·oldTemplate·==·template)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2291| »   »   »   »   »   »   »   ||·(type.specific·==·resourceType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2292| »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2308| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2496| »   »   »   »   »   var·nearby·=·this.FindNearbyResource(function·(ent,·type,·template)·{
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2499| »   »   »   »   »   »   »   ||·(type.specific·==·resourceType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2500| »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·resourceTemplate·==·template))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2520| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2899| »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceDropsite' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2998| »   »   »   »   »   if·(this.CanGarrison(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3001| »   »   »   »   »   »   if·(this.CheckGarrisonRange(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3003| »   »   »   »   »   »   »   var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3025| »   »   »   »   »   »   »   »   var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3026| »   »   »   »   »   »   »   »   if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3041| »   »   »   »   »   »   »   »   »   var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3042| »   »   »   »   »   »   »   »   »   var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI);
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3069| »   »   »   »   »   »   »   if·(this.MoveToTarget(target))
|    | [NORMAL] JSHintBear:
|    | 'target' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3366| »   return·this.alertRaiser·!=·undefined;
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'undefined'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3508| »   »   »   ||·this.orderQueue[0].type·==·"Pack"·||·this.orderQueue[0].type·==·"Unpack")))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|3572| »   »   if·(i·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3950| »   if·(this.workOrders.length·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/UnitAI.js
|4136| »   return·cmpHealth·&&·cmpHealth.GetHitpoints()·!=·0;
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with '0'.

binaries/data/mods/public/simulation/components/UnitAI.js
|4475| »   »   var·parabolicMaxRange·=·0;
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4479| »   var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2;
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4486| »   return·cmpUnitMotion.MoveToTargetRange(target,·range.min,·Math.min(range.max,·parabolicMaxRange));
|    | [NORMAL] JSHintBear:
|    | 'parabolicMaxRange' used out of scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4542| »   »   »   &&·cmpFormationUnitAI.order.data.target·==·target)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4722| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4723| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5255| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

binaries/data/mods/public/simulation/components/UnitAI.js
|5594| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5597| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5610| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5620| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5623| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5623| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [MAJOR] JSHintBear:
|    | Too many errors. (91% scanned).
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/388/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1849/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/ManpowerHolderUnit.js
| 125| »   if·(enemies.length·&&·enemies[0]·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderUnit.js
| 295| »   if·(this.currentRound·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
| 124| 124| });
| 125| 125| 
| 126| 126| AddMock(100, IID_TechnologyManager, {
| 127|    |-	IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; else return false; },
|    | 127|+	IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; return false; },
| 128| 128| 	GetQueuedResearch: function() { return {}; },
| 129| 129| 	GetStartedTechs: function() { return {}; },
| 130| 130| 	GetResearchedTechs: function() { return {}; },
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
| 210| 210| });
| 211| 211| 
| 212| 212| AddMock(101, IID_TechnologyManager, {
| 213|    |-		IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; else return false; },
|    | 213|+		IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; return false; },
| 214| 214| 		GetQueuedResearch: function() { return {}; },
| 215| 215| 		GetStartedTechs: function() { return {}; },
| 216| 216| 		GetResearchedTechs: function() { return {}; },
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  46|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|  49|  49| 	});

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  46| »   »   ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·},
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 160| »   if·(mode·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 229| »   »   »   GetTurretParent:·function()·{·return·INVALID_ENTITY;·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 230| »   »   »   GetPosition:·function()·{·return·new·Vector3D();·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 231| »   »   »   GetPosition2D:·function()·{·return·new·Vector2D();·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

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

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

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

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

binaries/data/mods/public/simulation/components/ManpowerHolderBuilding.js
| 125| »   if·(enemies.length·&&·enemies[0]·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderBuilding.js
| 288| »   if·(this.currentRound·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/globalscripts/Templates.js
|  61| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/globalscripts/Templates.js
|  60| »   »   if·(sublist.every(c·=>·(c[0]·==·"!"·&&·classes.indexOf(c.substr(1))·==·-1)
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/globalscripts/Templates.js
| 146| »   »   »   let·getAttackStat·=·function(stat)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/globalscripts/Templates.js
| 206| »   if·(template.ManpowerHolder·|| template.ManpowerHolderBuilding·|| template.ManpowerHolderUnit)
|    | [NORMAL] JSHintBear:
|    | This line contains non-breaking spaces: http://jshint.com/docs/options/#nonbsp

binaries/data/mods/public/gui/common/tooltips.js
| 606| »   »   '[/color][/font]'·+·"·"·+
|    | [NORMAL] ESLintBear (no-useless-concat):
|    | Unexpected string concatenation of literals.

binaries/data/mods/public/gui/common/tooltips.js
| 439| »   »   let·[rate,·count]·=·types.reduce((sum,·t)·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/common/tooltips.js
| 618| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/tooltips.js
| 618| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
| 209| 209| {
| 210| 210| 	if (this.miragedEntities[player])
| 211| 211| 		return this.renamedEntities.concat(this.miragedEntities[player]);
| 212|    |-	else
| 213|    |-		return this.renamedEntities;
|    | 212|+	return this.renamedEntities;
| 214| 213| };
| 215| 214| 
| 216| 215| GuiInterface.prototype.ClearRenamedEntities = function()
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|1231|1231| 
|1232|1232| 		return false;
|1233|1233| 	}
|1234|    |-	else
|1235|    |-	{
|    |1234|+	
|1236|1235| 		// Move all existing cached entities outside of the world and reset their use count
|1237|1236| 		for (let tpl in this.placementW

http://jw:8080/job/phabricator_lint/389/ for more details.

Stan awarded a token.Aug 13 2017, 12:36 AM
Stan added a subscriber: Stan.Aug 13 2017, 12:43 AM

I know it's a WIP but manPower bugs me. Woud something like GarrisonHolderUnitAI GarrisonHolderBuildingAI make more sense ?

Imarok added a subscriber: Imarok.Aug 13 2017, 1:14 PM

ManpowerHolderUnit and ManpowerHolderBuilding are nearly identically. Maybe you should create ManpowerHolder and ManpowerHolderUnit and ManpowerHolderBuilding inherit from that?
(If you plan to change that, just ignore my comment ;)

In D787#31165, @Imarok wrote:

ManpowerHolderUnit and ManpowerHolderBuilding are nearly identically. Maybe you should create ManpowerHolder and ManpowerHolderUnit and ManpowerHolderBuilding inherit from that?
(If you plan to change that, just ignore my comment ;)

Sure, they aimed to be different (perhaps only sharing few getters).
(see the team forum topic)

gui template getter

or/and mistake

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1851/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/ManpowerHolderUnit.js
| 125| »   if·(enemies.length·&&·enemies[0]·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderUnit.js
| 295| »   if·(this.currentRound·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/tooltips.js
| 606| »   »   '[/color][/font]'·+·"·"·+
|    | [NORMAL] ESLintBear (no-useless-concat):
|    | Unexpected string concatenation of literals.

binaries/data/mods/public/gui/common/tooltips.js
| 439| »   »   let·[rate,·count]·=·types.reduce((sum,·t)·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/common/tooltips.js
| 618| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/tooltips.js
| 618| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
| 209| 209| {
| 210| 210| 	if (this.miragedEntities[player])
| 211| 211| 		return this.renamedEntities.concat(this.miragedEntities[player]);
| 212|    |-	else
| 213|    |-		return this.renamedEntities;
|    | 212|+	return this.renamedEntities;
| 214| 213| };
| 215| 214| 
| 216| 215| GuiInterface.prototype.ClearRenamedEntities = function()
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|1231|1231| 
|1232|1232| 		return false;
|1233|1233| 	}
|1234|    |-	else
|1235|    |-	{
|    |1234|+	
|1236|1235| 		// Move all existing cached entities outside of the world and reset their use count
|1237|1236| 		for (let tpl in this.placementWallEntities)
|1238|1237| 		{
|1266|1265| 				}
|1267|1266| 			}
|1268|1267| 		}
|1269|    |-	}
|    |1268|+	
|1270|1269| 
|1271|1270| 	// prevent division by zero errors further on if the start and end positions are the same
|1272|1271| 	if (end.pos && (start.pos.x === end.pos.x && start.pos.z === end.pos.z))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|2032|2032| {
|2033|2033| 	if (exposedFunctions[name])
|2034|2034| 		return this[name](player, args);
|2035|    |-	else
|2036|    |-		throw new Error("Invalid GuiInterface Call name \""+name+"\"");
|    |2035|+	throw new Error("Invalid GuiInterface Call name \""+name+"\"");
|2037|2036| };
|2038|2037| 
|2039|2038| Engine.RegisterSystemComponentType(IID_GuiInterface, "GuiInterface", GuiInterface);

binaries/data/mods/public/simulation/components/GuiInterface.js
| 668| »   for·(let·name·of·auraNames)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'name' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/GuiInterface.js
| 668| »   for·(let·name·of·auraNames)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'name' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/GuiInterface.js
| 769| »   if·(notification.players·==·undefined)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'undefined'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1037| »   »   »   »   if·(cmd.queued·==·true)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'true'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1089| »   »   if·(cmd.template·==·"")
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with ''.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1510| »   »   »   »   if·(terrainGroundPrev·!=·null·||·terrainGroundNext·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1510| »   »   »   »   if·(terrainGroundPrev·!=·null·||·terrainGroundNext·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1632| »   if·(numRequiredPieces·>·0·&&·result.pieces.length·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1702| »   »   if·(minDistEntitySnapData·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1754| »   »   if(bucket·==·0·&&·data.prevUnit·&&·entity·<=·data.prevUnit)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1762| »   »   if·(data.limit·&&·bucket·==·0·&&·idleUnits[0].length·==·data.limit)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderBuilding.js
| 125| »   if·(enemies.length·&&·enemies[0]·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderBuilding.js
| 288| »   if·(this.currentRound·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  46|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|  49|  49| 	});

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  46| »   »   ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·},
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 160| »   if·(mode·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 229| »   »   »   GetTurretParent:·function()·{·return·INVALID_ENTITY;·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 230| »   »   »   GetPosition:·function()·{·return·new·Vector3D();·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 231| »   »   »   GetPosition2D:·function()·{·return·new·Vector2D();·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

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

binarie

http://jw:8080/job/phabricator_lint/391/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1852/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/globalscripts/Templates.js
|  61| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/globalscripts/Templates.js
|  60| »   »   if·(sublist.every(c·=>·(c[0]·==·"!"·&&·classes.indexOf(c.substr(1))·==·-1)
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/globalscripts/Templates.js
| 146| »   »   »   let·getAttackStat·=·function(stat)·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/common/tooltips.js
| 606| »   »   '[/color][/font]'·+·"·"·+
|    | [NORMAL] ESLintBear (no-useless-concat):
|    | Unexpected string concatenation of literals.

binaries/data/mods/public/gui/common/tooltips.js
| 439| »   »   let·[rate,·count]·=·types.reduce((sum,·t)·=>·{
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/gui/common/tooltips.js
| 618| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/gui/common/tooltips.js
| 618| »   if·(walk·==·0·&&·run·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
| 124| 124| });
| 125| 125| 
| 126| 126| AddMock(100, IID_TechnologyManager, {
| 127|    |-	IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; else return false; },
|    | 127|+	IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; return false; },
| 128| 128| 	GetQueuedResearch: function() { return {}; },
| 129| 129| 	GetStartedTechs: function() { return {}; },
| 130| 130| 	GetResearchedTechs: function() { return {}; },
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
| 210| 210| });
| 211| 211| 
| 212| 212| AddMock(101, IID_TechnologyManager, {
| 213|    |-		IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; else return false; },
|    | 213|+		IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; return false; },
| 214| 214| 		GetQueuedResearch: function() { return {}; },
| 215| 215| 		GetStartedTechs: function() { return {}; },
| 216| 216| 		GetResearchedTechs: function() { return {}; },

binaries/data/mods/public/simulation/components/ManpowerHolderUnit.js
| 125| »   if·(enemies.length·&&·enemies[0]·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderUnit.js
| 295| »   if·(this.currentRound·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  46|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|  49|  49| 	});

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  46| »   »   ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·},
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 160| »   if·(mode·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 229| »   »   »   GetTurretParent:·function()·{·return·INVALID_ENTITY;·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 230| »   »   »   GetPosition:·function()·{·return·new·Vector3D();·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 231| »   »   »   GetPosition2D:·function()·{·return·new·Vector2D();·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

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

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

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

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

binaries/data/mods/public/simulation/components/ManpowerHolderBuilding.js
| 125| »   if·(enemies.length·&&·enemies[0]·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderBuilding.js
| 288| »   if·(this.currentRound·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
| 209| 209| {
| 210| 210| 	if (this.miragedEntities[player])
| 211| 211| 		return this.renamedEntities.concat(this.miragedEntities[player]);
| 212|    |-	else
| 213|    |-		return this.renamedEntities;
|    | 212|+	return this.renamedEntities;
| 214| 213| };
| 215| 214| 
| 216| 215| GuiInterface.prototype.ClearRenamedEntities = function()
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|1231|1231| 
|1232|1232| 		return false;
|1233|1233| 	}
|1234|    |-	else
|1235|    |-	{
|    |1234|+	
|1236|1235| 		// Move all existing cached entities outside of the world and reset their use count
|1237|1236| 		for (let tpl in this.placementWallEntities)
|1238|1237| 		{
|1266|1265| 				}
|1267|1266| 			}
|1268|1267| 		}
|1269|    |-	}
|    |1268|+	
|1270|1269| 
|1271|1270| 	// prevent division by zero errors further on if the start and end positions are the same
|1272|1271| 	if (end.pos && (start.pos.x === end.pos.x && start.pos.z === end.pos.z))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|2032|2032| {
|2033|2033| 	if (exposedFunctions[name])
|2034|2034| 		return this[name](player, args);
|2035|    |-	else
|2036|    |-		throw new Error("Invalid GuiInterface Call name \""+name+"\"");
|    |2035|+	throw new Error("Invalid GuiInterface Call name \""+name+"\"");
|2037|2036| };
|2038|2037| 
|2039|2038| Engine.RegisterSystemComponentType(IID_GuiInterface, "GuiInterface", GuiInterface);

binaries/data/mods/public/simulation/components/GuiInterface.js
| 668| »   for·(let·name·of·auraNames)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'name' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/GuiInterface.js
| 668| »   for·(let·name·of·auraNames)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'name' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/GuiInterface.js
| 769| »   if·(notification.players·==·undefined)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'undefined'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1037| »   »   »   »   if·(cmd.queued·==·true)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'true'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1089| »   »   if·(cmd.template·==·"")
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with ''.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1510| »   »   »   »   if·(terrainGroundPrev·!=·null·||·terrainGroundNext·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1510| »   »   »   »   if·(terrainGroundPrev·!=·null·||·terrainGroundNext·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1632| »   if·(numRequiredPieces·>·0·&&·result.pieces.length·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1702| »   »   if·(minDistEntitySnapData·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1754| »   »   if(bucket·==·0·&&·data.prevUnit·&&·entity·<=·data.prevUnit)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1762| »   »   if·(data.limit·&&·bucket·==·0·&&·idleUnits[0].length·==·data.limit)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 911| 911| 					this.FinishOrder();
| 912| 912| 					return;
| 913| 913| 				}
| 914|    |-				else
| 915|    |-				{
|    | 914|+				
| 916| 915| 					// Out of range; move there in formation
| 917| 916| 					if (this.MoveToGarrisonRange(msg.data.target))
| 918| 917| 					{
| 919| 918| 						this.SetNextState("GARRISON.APPROACHING");
| 920| 919| 						return;
| 921| 920| 					}
| 922|    |-				}
|    | 921|+				
| 923| 922| 			}
| 924| 923| 
| 925| 924| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1960|1960| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1961|1961| 
|1962|1962| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1963|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1963|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1964|1964| 
|1965|1965| 					this.FaceTowardsTarget(this.order.data.target);
|1966|1966| 
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2187|2187| 							this.PerformGather(nearby, false, false);
|2188|2188| 							return true;
|2189|2189| 						}
|2190|    |-						else
|2191|    |-						{
|    |2190|+						
|2192|2191| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2193|2192| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2194|2193| 							// to order it to GatherNear the resource position.
|2209|2208| 									return true;
|2210|2209| 								}
|2211|2210| 							}
|2212|    |-						}
|    |2211|+						
|2213|2212| 						return true;
|2214|2213| 					}
|2215|2214| 					return false;
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2199|2199| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2200|2200| 								return true;
|2201|2201| 							}
|2202|    |-							else
|2203|    |-							{
|    |2202|+							
|2204|2203| 								// we're kind of stuck here. Return resource.
|2205|2204| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2206|2205| 								if (nearby)
|2208|2207| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2209|2208| 									return true;
|2210|2209| 								}
|2211|    |-							}
|    |2210|+							
|2212|2211| 						}
|2213|2212| 						return true;
|2214|2213| 					}
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2583|2583| 					this.StartTimer(prepare, this.healTimers.repeat);
|2584|2584| 
|2585|2585| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2586|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2586|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2587|2587| 
|2588|2588| 					this.FaceTowardsTarget(this.order.data.target);
|2589|2589| 				},
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3399|3399| 
|3400|3400| UnitAI.prototype.IsAnimal = function()
|3401|3401| {
|3402|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3402|+	return (!!this.template.NaturalBehaviour);
|3403|3403| };
|3404|3404| 
|3405|3405| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3718|3718| 		// Otherwise we've successfully processed a new order
|3719|3719| 		return true;
|3720|3720| 	}
|3721|    |-	else
|3722|    |-	{
|    |3721|+	
|3723|3722| 		this.SetNextState("IDLE");
|3724|3723| 
|3725|3724| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3740|3739| 		}
|3741|3740| 
|3742|3741| 		return false;
|3743|    |-	}
|    |3742|+	
|3744|3743| };
|3745|3744| 
|3746|3745| /**
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|4783|4783| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4784|4784| 	if (this.isGuardOf)
|4785|4785| 	{
|4786|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4786|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4787|4787| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4788|4788| 		if (cmpUnitAI && cmpAttack &&
|4789|4789| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|4830|4830| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4831|4831| 	if (this.isGuardOf)
|4832|4832| 	{
|4833|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4833|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4834|4834| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4835|4835| 		if (cmpUnitAI && cmpAttack &&
|4836|4836| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|5004|5004| 	{
|5005|5005| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5006|5006| 			return;
|5007|    |-		else
|5008|    |-			this.RemoveGuard();
|    |5007|+		this.RemoveGuard();
|5009|5008| 	}
|5010|5009| 
|5011|5010| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|5252|5252| 
|5253|5253| 	// Remember the position of our target, if any, in case it disappears
|5254|5254| 	// later and we want to head to its last known position
|5255|    |-	var lastPos = undefined;
|    |5255|+	var lastPos;
|5256|5256| 	var cmpPosition = Engine.QueryInterface(target, IID_Position);
|5257|5257| 	if (cmpPosition && cmpPosition.IsInWorld())
|5258|5258| 		lastPos = cmpPosition.GetPosition();

binaries/data/mods/public/simulation/components/UnitAI.js
|2485| »   »   »   »   »   »   let·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'nearby' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|3907| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4232| »   »   let·cmpOwnership·=·Engine.QueryInterface(ent,·IID_Ownership);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'cmpOwnership' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4705| »   var·target·=·ents.find(target·=>·this.CanAttack(target,·forceResponse));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4720| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4766| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4789| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
| 363| »   »   ····&&·(this.lastShorelinePosition.z·==·cmpPosition.GetPosition().z))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1953| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2180| »   »   »   »   »   »   »   »   ·&&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2181| »   »   »   »   »   »   »   »   ·||·(type.specific·==·oldType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2182| »   »   »   »   »   »   »   »   ·&&·(type.specific·!=·"meat"·||·oldTemplate·==·template)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2205| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2245| »   »   »   »   »   »   »   »   &&·((type.generic·==·"treasure"·&&·oldType.generic·==·"treasure")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2246| »   »   »   »   »   »   »   »   ||·(type.specific·==·oldType.specific
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2247| »   »   »   »   »   »   »   »   &&·(type.specific·!=·"meat"·||·oldTemplate·==·template)))
|    | [NORMAL] JSHintBear:
|    | Misleading line

http://jw:8080/job/phabricator_lint/392/ for more details.

fatherbushido edited the summary of this revision. (Show Details)Aug 19 2017, 5:49 PM
fatherbushido edited the summary of this revision. (Show Details)
fatherbushido added a subscriber: leper.
fatherbushido abandoned this revision.Aug 30 2017, 11:24 PM
Grugnas added inline comments.
binaries/data/mods/public/globalscripts/Templates.js
217

try again :P

fatherbushido added inline comments.Sep 12 2017, 5:46 PM
binaries/data/mods/public/globalscripts/Templates.js
217

I you equate a typo and a misunderstanding, I can't help you anymore.

fatherbushido added inline comments.Sep 12 2017, 6:18 PM
binaries/data/mods/public/globalscripts/Templates.js
217

Thanks for catching it though

fatherbushido reclaimed this revision.Sep 18 2017, 10:19 PM
fatherbushido retitled this revision from [WIP] Split buildingAI for building and for entity with unitAI to Split buildingAI for building and for entity with unitAI.Sep 18 2017, 10:21 PM
fatherbushido added a reviewer: Restricted Owners Package.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jenkins-master:8080/job/phabricator/2054/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/ManpowerHolderBuilding.js
| 125| »   if·(enemies.length·&&·enemies[0]·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderBuilding.js
| 288| »   if·(this.currentRound·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
| 124| 124| });
| 125| 125| 
| 126| 126| AddMock(100, IID_TechnologyManager, {
| 127|    |-	IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; else return false; },
|    | 127|+	IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; return false; },
| 128| 128| 	GetQueuedResearch: function() { return {}; },
| 129| 129| 	GetStartedTechs: function() { return {}; },
| 130| 130| 	GetResearchedTechs: function() { return {}; },
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js
| 210| 210| });
| 211| 211| 
| 212| 212| AddMock(101, IID_TechnologyManager, {
| 213|    |-		IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; else return false; },
|    | 213|+		IsTechnologyResearched: function(tech) { if (tech == "phase_village") return true; return false; },
| 214| 214| 		GetQueuedResearch: function() { return {}; },
| 215| 215| 		GetStartedTechs: function() { return {}; },
| 216| 216| 		GetResearchedTechs: function() { return {}; },

binaries/data/mods/public/simulation/components/ManpowerHolderUnit.js
| 125| »   if·(enemies.length·&&·enemies[0]·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/ManpowerHolderUnit.js
| 295| »   if·(this.currentRound·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  43|  43| 			return 1;
|  44|  44| 		},
|  45|  45| 		EnableActiveQuery: function(id) { },
|  46|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    |  46|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
|  47|  47| 		DisableActiveQuery: function(id) { },
|  48|  48| 		GetEntityFlagMask: function(identifier) { },
|  49|  49| 	});

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|  46| »   »   ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·},
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 160| »   if·(mode·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 229| »   »   »   GetTurretParent:·function()·{·return·INVALID_ENTITY;·},
|    | [NORMAL] JSHintBear:
|    | Don't make functions within a loop.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 230| »   »   »   GetPosition:·function()·{·re

http://jenkins-master:8080/job/phabricator_lint/538/ for more details.

elexis added a subscriber: elexis.Sep 18 2017, 11:30 PM

(answered in the forum thread)

For the unit logic. I have ideas but not enough room in that margin.
Anyway, we can't (at least I won't) work on it before splitting that.

fatherbushido abandoned this revision.Sep 22 2017, 10:19 PM

(I never intend to commit that or to use that. It was lines to help me think about that.
Neither plan I to have two things doing the same thing.)