Page MenuHomeWildfire Games

Town bell - use matching classes, add a market alert
ClosedPublic

Authored by temple on Sep 30 2017, 1:34 AM.
Tags
None
Subscribers
Restricted Owners Package
Restricted Owners Package
Tokens
"Like" token, awarded by Grugnas."Like" token, awarded by Dunedan.

Details

Summary

This is the second part to D681.

  • Allow garrisoning in allied buildings
  • Replace the alert level with matching classes
  • Add a bell at the market for trade carts
  • Change the GUI to always display two buttons: alert (garrison) and safe (back to work)

I've also added a timer so that the raise or end alert is only done once per turn. (We search for units and garrison holders, so I'm assuming there's some kind of performance hit.)

Here's the GUI change to the market. The icons are slightly smaller so they don't overlap with the portrait. Now four digit prices slightly run over the icons, but there's not room to make the icons bigger and the font looks bad at a smaller size. Because we can't really fix this, I'm saying it's not a big deal.

(I decided to leave hotkeys for another day.)

Test Plan

This is logically separate from D681 but it alters some of the same files, so the patch I've uploaded here contains both of them.

See how you like the behavior.

I've kept the "Raise an alert!"/"End of alert." tooltips, but maybe they can be updated.

causative suggested adding a bell on the storehouse too. I haven't done that, but it's worth considering.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

temple created this revision.Sep 30 2017, 1:34 AM
temple updated this revision to Diff 4646.Dec 8 2017, 5:15 AM
temple set the repository for this revision to rP 0 A.D. Public Repository.

rebase

Owners added subscribers: Restricted Owners Package, Restricted Owners Package.Dec 8 2017, 5:15 AM
Vulcan added a subscriber: Vulcan.Dec 8 2017, 5:18 AM

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
temple added inline comments.Dec 8 2017, 5:18 AM
binaries/data/mods/public/gui/session/selection_panels.js
43 ↗(On Diff #4646)

0 should be []

I get a conflict applying the patch, can you update to svn?
C binaries/data/mods/public/simulation/components/AlertRaiser.js

rejected hunk @@ -1,162 +1,135 @@
temple updated this revision to Diff 4749.EditedDec 12 2017, 7:06 PM

Rebase. (When D681 is done I'll include its changes and update the tests.)

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
causative added inline comments.Dec 23 2017, 6:51 AM
binaries/data/mods/public/simulation/components/AlertRaiser.js
43 ↗(On Diff #4749)

For the market alert, this loads into javascript a list of all your units. That could potentially be a performance problem. It also uses the range manager which is unnecessary since you want infinite range.

However, I can't actually observe any performance problem on my machine. So I'll just note that if it does become a problem you could filter the list in C++ (using e.g. Engine.PickSimilarPlayerEntities as an example).

71 ↗(On Diff #4749)

In the case of a market this is an invalid order and it causes all traders that can't garrison to stop. This may be okay. On the one hand it stops traders from walking towards the raiders, but on the other hand a stationary trader is easier to kill. On the third hand it is not consistent with the CC alert where women will walk towards the CC if they can't garrison.

temple added inline comments.Dec 23 2017, 10:02 PM
binaries/data/mods/public/simulation/components/AlertRaiser.js
43 ↗(On Diff #4749)

We don't need to sort by distance, which this query does. We could GetEntitiesByPlayer then filter with a distance check, would that be better?

71 ↗(On Diff #4749)

We probably want consistent behavior, so units could:

  • move to the alert raiser (instead of garrison)
  • stop their current order
  • continue their current order

Any opinion? I think I'm leaning towards stop, since then traders won't turn around to come home or continue to walk into danger. And when women are attacked they won't try to return to gather after fleeing for a moment.

temple updated this revision to Diff 5583.Jan 30 2018, 3:46 AM
temple marked an inline comment as done.

rebased

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_AlertRaiser.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/tests/test_AlertRaiser.js
|   1|   1| Engine.LoadHelperScript("Entity.js");
|   2|    |-Engine.LoadComponentScript("interfaces/AlertRaiser.js")
|    |   2|+Engine.LoadComponentScript("interfaces/AlertRaiser.js");
|   3|   3| Engine.LoadComponentScript("interfaces/GarrisonHolder.js");
|   4|   4| Engine.LoadComponentScript("interfaces/UnitAI.js");
|   5|   5| Engine.LoadComponentScript("AlertRaiser.js");

binaries/data/mods/public/simulation/components/tests/test_AlertRaiser.js
|   2| Engine.LoadComponentScript("interfaces/AlertRaiser.js")
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/AlertRaiser.js
| 125| »   »   let·units·=·cmpGarrisonHolder.GetEntities().filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'units' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 414| 414| 	let otherEnts = [];
| 415| 415| 
| 416| 416| 	for (let ent of garrisonHolders)
| 417|    |-	{
|    | 417|+	
| 418| 418| 		if (controlsPlayer(GetEntityState(ent).player))
| 419| 419| 			ownEnts.push(ent);
| 420| 420| 		else
| 421| 421| 			otherEnts.push(ent);
| 422|    |-	}
|    | 422|+	
| 423| 423| 
| 424| 424| 	if (ownEnts.length)
| 425| 425| 		Engine.PostNetworkCommand({
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/selection_panels.js
| 460| 460| 				continue;
| 461| 461| 
| 462| 462| 			if (state.pack.progress == 0)
| 463|    |-			{
|    | 463|+			
| 464| 464| 				if (state.pack.packed)
| 465| 465| 					checks.unpackButton = true;
| 466| 466| 				else
| 467| 467| 					checks.packButton = true;
| 468|    |-			}
|    | 468|+			
| 469| 469| 			else if (state.pack.packed)
| 470| 470| 				checks.unpackCancelButton = true;
| 471| 471| 			else

binaries/data/mods/public/gui/session/selection_panels.js
|  48| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  59| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 742| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/helpers/Commands.js
| 883| »   var·ids·=·[·id·for·(id·in·members)·];
|    | [MAJOR] ESLintBear:
|    | Parsing error: Unexpected token for

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
| 524| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Commands.js
| 712| »   »   »   »   var·cmpGUIInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface);
|    | [NORMAL] JSHintBear:
|    | 'cmpGUIInterface' is already defined
temple updated this revision to Diff 5595.Jan 30 2018, 11:32 PM

Moved some constants to templates.
Fixed some bugs.
Deleted the test. It was checking whether the alert levels were correct, but they don't exist anymore. (Previously it checked that units and buildings were put under alert, but that doesn't exist anymore either.) So I'm not sure if there's anything worth putting in a test?

I think we need to keep track of the time, otherwise when the game's paused players could hit the alert a hundred times and when unpaused it'd do all of them. In my tests with lots of units the alerts took 10-30ms, something like that.

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

binaries/data/mods/public/simulation/components/AlertRaiser.js
| 125| »   »   let·units·=·cmpGarrisonHolder.GetEntities().filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'units' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 414| 414| 	let otherEnts = [];
| 415| 415| 
| 416| 416| 	for (let ent of garrisonHolders)
| 417|    |-	{
|    | 417|+	
| 418| 418| 		if (controlsPlayer(GetEntityState(ent).player))
| 419| 419| 			ownEnts.push(ent);
| 420| 420| 		else
| 421| 421| 			otherEnts.push(ent);
| 422|    |-	}
|    | 422|+	
| 423| 423| 
| 424| 424| 	if (ownEnts.length)
| 425| 425| 		Engine.PostNetworkCommand({
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/selection_panels.js
| 460| 460| 				continue;
| 461| 461| 
| 462| 462| 			if (state.pack.progress == 0)
| 463|    |-			{
|    | 463|+			
| 464| 464| 				if (state.pack.packed)
| 465| 465| 					checks.unpackButton = true;
| 466| 466| 				else
| 467| 467| 					checks.packButton = true;
| 468|    |-			}
|    | 468|+			
| 469| 469| 			else if (state.pack.packed)
| 470| 470| 				checks.unpackCancelButton = true;
| 471| 471| 			else

binaries/data/mods/public/gui/session/selection_panels.js
|  48| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  59| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 742| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/helpers/Commands.js
| 883| »   var·ids·=·[·id·for·(id·in·members)·];
|    | [MAJOR] ESLintBear:
|    | Parsing error: Unexpected token for

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
| 524| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 883| »   var·ids·=·[·id·for·(id·in·members)·];
|    | [NORMAL] JSHintBear:
|    | 'array comprehension' is only available in Mozilla JavaScript extensions (use moz option).

binaries/data/mods/public/simulation/helpers/Commands.js
| 883| »   var·ids·=·[·id·for·(id·in·members)·];
|    | [NORMAL] JSHintBear:
|    | Expected 'for' and instead saw 'id'.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1093| »   »   var·cmpGuiInterface·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_GuiInterface)

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
causative accepted this revision.Feb 6 2018, 11:13 AM
This revision is now accepted and ready to land.Feb 6 2018, 11:13 AM
temple added inline comments.Feb 6 2018, 10:23 PM
binaries/data/mods/public/simulation/components/AlertRaiser.js
16 ↗(On Diff #5595)

remove

temple updated this revision to Diff 5806.Feb 17 2018, 3:02 AM
temple marked an inline comment as done.

Add a bell with a smaller radius to farmstead and storehouse. I think it'll be convenient.

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

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

binaries/data/mods/public/simulation/components/AlertRaiser.js
| 123| »   »   let·units·=·cmpGarrisonHolder.GetEntities().filter(ent·=>·{
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'units' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 414| 414| 	let otherEnts = [];
| 415| 415| 
| 416| 416| 	for (let ent of garrisonHolders)
| 417|    |-	{
|    | 417|+	
| 418| 418| 		if (controlsPlayer(GetEntityState(ent).player))
| 419| 419| 			ownEnts.push(ent);
| 420| 420| 		else
| 421| 421| 			otherEnts.push(ent);
| 422|    |-	}
|    | 422|+	
| 423| 423| 
| 424| 424| 	if (ownEnts.length)
| 425| 425| 		Engine.PostNetworkCommand({
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 460| 460| 				continue;
| 461| 461| 
| 462| 462| 			if (state.pack.progress == 0)
| 463|    |-			{
|    | 463|+			
| 464| 464| 				if (state.pack.packed)
| 465| 465| 					checks.unpackButton = true;
| 466| 466| 				else
| 467| 467| 					checks.packButton = true;
| 468|    |-			}
|    | 468|+			
| 469| 469| 			else if (state.pack.packed)
| 470| 470| 				checks.unpackCancelButton = true;
| 471| 471| 			else

binaries/data/mods/public/gui/session/selection_panels.js
|  48| »   »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
|  59| »   »   switch·(data.item)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/gui/session/selection_panels.js
| 742| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/simulation/helpers/Commands.js
| 883| »   var·ids·=·[·id·for·(id·in·members)·];
|    | [MAJOR] ESLintBear:
|    | Parsing error: Unexpected token for

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
| 524| »   »   »   »   ····&&·player·!=·+cmd.owner)
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

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

binaries/data/mods/public/simulation/helpers/Commands.js
| 883| »   var·ids·=·[·id·for·(id·in·members)·];
|    | [NORMAL] JSHintBear:
|    | 'array comprehension' is only available in Mozilla JavaScript extensions (use moz option).

binaries/data/mods/public/simulation/helpers/Commands.js
| 883| »   var·ids·=·[·id·for·(id·in·members)·];
|    | [NORMAL] JSHintBear:
|    | Expected 'for' and instead saw 'id'.

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

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

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

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1469| »   »   »   &&·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
|1484| »   »   for·(var·fid·in·formation.members)
|    | [NORMAL] JSHintBear:
|    | 'fid' is already defined.

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

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

binaries/data/mods/public/simulation/helpers/Commands.js
|1526| »   »   »   var·cmpFormation·=·Engine.QueryInterface(formationEnt,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'upgrades'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 286| 286| 	var cmpUpgrade = Engine.QueryInterface(ent, IID_Upgrade);
| 287| 287| 	if (cmpUpgrade)
| 288| 288| 		ret.upgrade = {
| 289|    |-			"upgrades" : cmpUpgrade.GetUpgrades(),
|    | 289|+			"upgrades": cmpUpgrade.GetUpgrades(),
| 290| 290| 			"progress": cmpUpgrade.GetProgress(),
| 291| 291| 			"template": cmpUpgrade.GetUpgradingTo()
| 292| 292| 		};
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'isIdle'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 350| 350| 			"isGuarding": cmpUnitAI.IsGuardOf(),
| 351| 351| 			"canPatrol": cmpUnitAI.CanPatrol(),
| 352| 352| 			"possibleStances": cmpUnitAI.GetPossibleStances(),
| 353|    |-			"isIdle":cmpUnitAI.IsIdle(),
|    | 353|+			"isIdle": cmpUnitAI.IsIdle(),
| 354| 354| 		};
| 355| 355| 
| 356| 356| 	let cmpGuard = Engine.QueryInterface(ent, IID_Guard);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 790| 790| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 791| 791| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 792| 792| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 793|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 793|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 794| 794| 	}
| 795| 795| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 796| 796| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'r'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 815| 815| 		let color = playerColors[owner];
| 816| 816| 		if (!color)
| 817| 817| 		{
| 818|    |-			color = { "r":1, "g":1, "b":1 };
|    | 818|+			color = { "r": 1, "g":1, "b":1 };
| 819| 819| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 820| 820| 			if (cmpPlayer)
| 821| 821| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'g'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 815| 815| 		let color = playerColors[owner];
| 816| 816| 		if (!color)
| 817| 817| 		{
| 818|    |-			color = { "r":1, "g":1, "b":1 };
|    | 818|+			color = { "r":1, "g": 1, "b":1 };
| 819| 819| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 820| 820| 			if (cmpPlayer)
| 821| 821| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'b'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 815| 815| 		let color = playerColors[owner];
| 816| 816| 		if (!color)
| 817| 817| 		{
| 818|    |-			color = { "r":1, "g":1, "b":1 };
|    | 818|+			color = { "r":1, "g":1, "b": 1 };
| 819| 819| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 820| 820| 			if (cmpPlayer)
| 821| 821| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 4 spaces.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 894| 894| 
| 895| 895| GuiInterface.prototype.GetNonGaiaEntities = function()
| 896| 896| {
| 897|    |-    return Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager).GetNonGaiaEntities();
|    | 897|+	return Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager).GetNonGaiaEntities();
| 898| 898| };
| 899| 899| 
| 900| 900| /**
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1309|1309| 		}
|1310|1310| 	}
|1311|1311| 	else
|1312|    |-	{
|    |1312|+	
|1313|1313| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1314|1314| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1315|1315| 		// wall piece.
|1330|1330| 			"pos": start.pos,
|1331|1331| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1332|1332| 		});
|1333|    |-	}
|    |1333|+	
|1334|1334| 
|1335|1335| 	if (end.pos)
|1336|1336| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1333|1333| 	}
|1334|1334| 
|1335|1335| 	if (end.pos)
|1336|    |-	{
|    |1336|+	
|1337|1337| 		// Analogous to the starting side case above
|1338|1338| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1339|1339| 		{
|1371|1371| 				"pos": end.pos,
|1372|1372| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1373|1373| 			});
|1374|    |-	}
|    |1374|+	
|1375|1375| 
|1376|1376| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1377|1377| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1549|1549| 
|1550|1550| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1551|1551| 		if (cmpVisual)
|1552|    |-		{
|    |1552|+		
|1553|1553| 			if (!allPiecesValid || !canAfford)
|1554|1554| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1555|1555| 			else
|1556|1556| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1557|    |-		}
|    |1557|+		
|1558|1558| 
|1559|1559| 		++entPool.numUsed;
|1560|1560| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1623|1623| 			{
|1624|1624| 				minDist2 = dist2;
|1625|1625| 				minDistEntitySnapData = {
|1626|    |-						"x": pos.x,
|    |1626|+					"x": pos.x,
|1627|1627| 						"z": pos.z,
|1628|1628| 						"angle": cmpPosition.GetRotation().y,
|1629|1629| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1624|1624| 				minDist2 = dist2;
|1625|1625| 				minDistEntitySnapData = {
|1626|1626| 						"x": pos.x,
|1627|    |-						"z": pos.z,
|    |1627|+					"z": pos.z,
|1628|1628| 						"angle": cmpPosition.GetRotation().y,
|1629|1629| 						"ent": ent
|1630|1630| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1625|1625| 				minDistEntitySnapData = {
|1626|1626| 						"x": pos.x,
|1627|1627| 						"z": pos.z,
|1628|    |-						"angle": cmpPosition.GetRotation().y,
|    |1628|+					"angle": cmpPosition.GetRotation().y,
|1629|1629| 						"ent": ent
|1630|1630| 				};
|1631|1631| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1626|1626| 						"x": pos.x,
|1627|1627| 						"z": pos.z,
|1628|1628| 						"angle": cmpPosition.GetRotation().y,
|1629|    |-						"ent": ent
|    |1629|+					"ent": ent
|1630|1630| 				};
|1631|1631| 			}
|1632|1632| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1771|1771| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1772|1772| 	}
|1773|1773| 	else if (data.target === secondMarket)
|1774|    |-	{
|    |1774|+	
|1775|1775| 		result = {
|1776|1776| 			"type": "is second",
|1777|1777| 			"gain": cmpEntityTrader.GetGoods().amount,
|1778|1778| 		};
|1779|    |-	}
|    |1779|+	
|1780|1780| 	else if (!firstMarket)
|1781|1781| 	{
|1782|1782| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1778|1778| 		};
|1779|1779| 	}
|1780|1780| 	else if (!firstMarket)
|1781|    |-	{
|    |1781|+	
|1782|1782| 		result = { "type": "set first" };
|1783|    |-	}
|    |1783|+	
|1784|1784| 	else if (!secondMarket)
|1785|1785| 	{
|1786|1786| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1782|1782| 		result = { "type": "set first" };
|1783|1783| 	}
|1784|1784| 	else if (!secondMarket)
|1785|    |-	{
|    |1785|+	
|1786|1786| 		result = {
|1787|1787| 			"type": "set second",
|1788|1788| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1789|1789| 		};
|1790|    |-	}
|    |1790|+	
|1791|1791| 	else
|1792|1792| 	{
|1793|1793| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1789|1789| 		};
|1790|1790| 	}
|1791|1791| 	else
|1792|    |-	{
|    |1792|+	
|1793|1793| 		// Else both markets are not null and target is different from them
|1794|1794| 		result = { "type": "set first" };
|1795|    |-	}
|    |1795|+	
|1796|1796| 	return result;
|1797|1797| };
|1798|1798| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  70|  70| // do worry around armies slaughtering the guy standing next to you), etc.
|  71|  71| var g_Stances = {
|  72|  72| 	"violent": {
|  73|    |-		targetVisibleEnemies: true,
|    |  73|+		"targetVisibleEnemies": true,
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  71|  71| var g_Stances = {
|  72|  72| 	"violent": {
|  73|  73| 		targetVisibleEnemies: true,
|  74|    |-		targetAttackersAlways: true,
|    |  74|+		"targetAttackersAlways": true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  72|  72| 	"violent": {
|  73|  73| 		targetVisibleEnemies: true,
|  74|  74| 		targetAttackersAlways: true,
|  75|    |-		respondFlee: false,
|    |  75|+		"respondFlee": false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  73|  73| 		targetVisibleEnemies: true,
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|    |-		respondChase: true,
|    |  76|+		"respondChase": true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|  79|  79| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|    |-		respondChaseBeyondVision: true,
|    |  77|+		"respondChaseBeyondVision": true,
|  78|  78| 		respondStandGround: false,
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|    |-		respondStandGround: false,
|    |  78|+		"respondStandGround": false,
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|  79|    |-		respondHoldGround: false,
|    |  79|+		"respondHoldGround": false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|    |-		targetVisibleEnemies: true,
|    |  82|+		"targetVisibleEnemies": true,
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|  83|    |-		targetAttackersAlways: false,
|    |  83|+		"targetAttackersAlways": false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|  83|  83| 		targetAttackersAlways: false,
|  84|    |-		respondFlee: false,
|    |  84|+		"respondFlee": false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  82|  82| 		targetVisibleEnemies: true,
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|    |-		respondChase: true,
|    |  85|+		"respondChase": true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|  88|  88| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|    |-		respondChaseBeyondVision: false,
|    |  86|+		"respondChaseBeyondVision": false,
|  87|  87| 		respondStandGround: false,
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|    |-		respondStandGround: false,
|    |  87|+		"respondStandGround": false,
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|  88|    |-		respondHoldGround: false,
|    |  88|+		"respondHoldGround": false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|    |-		targetVisibleEnemies: true,
|    |  91|+		"targetVisibleEnemies": true,
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|  92|    |-		targetAttackersAlways: false,
|    |  92|+		"targetAttackersAlways": false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|  92|  92| 		targetAttackersAlways: false,
|  93|    |-		respondFlee: false,
|    |  93|+		"respondFlee": false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  91|  91| 		targetVisibleEnemies: true,
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|    |-		respondChase: false,
|    |  94|+		"respondChase": false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|  97|  97| 		respondHoldGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|    |-		respondChaseBeyondVision: false,
|    |  95|+		"respondChaseBeyondVision": false,
|  96|  96| 		respondStandGround: false,
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|    |-		respondStandGround: false,
|    |  96|+		"respondStandGround": false,
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|  99|  99| 	"passive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|  97|    |-		respondHoldGround: true,
|    |  97|+		"respondHoldGround": true,
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100|    |-		targetVisibleEnemies: false,
|    | 100|+		"targetVisibleEnemies": false,
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
| 101|    |-		targetAttackersAlways: false,
|    | 101|+		"targetAttackersAlways": false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
| 101| 101| 		targetAttackersAlways: false,
| 102|    |-		respondFlee: true,
|    | 102|+		"respondFlee": true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 100| 100| 		targetVisibleEnemies: false,
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103|    |-		respondChase: false,
|    | 103|+		"respondChase": false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
| 106| 106| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104|    |-		respondChaseBeyondVision: false,
|    | 104|+		"respondChaseBeyondVision": false,
| 105| 105| 		respondStandGround: false,
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105|    |-		respondStandGround: false,
|    | 105|+		"respondStandGround": false,
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
| 108| 108| 	"standground": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
| 106|    |-		respondHoldGround: false,
|    | 106|+		"respondHoldGround": false,
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109|    |-		targetVisibleEnemies: true,
|    | 109|+		"targetVisibleEnemies": true,
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
| 110|    |-		targetAttackersAlways: false,
|    | 110|+		"targetAttackersAlways": false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
| 110| 110| 		targetAttackersAlways: false,
| 111|    |-		respondFlee: false,
|    | 111|+		"respondFlee": false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 109| 109| 		targetVisibleEnemies: true,
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112|    |-		respondChase: false,
|    | 112|+		"respondChase": false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
| 115| 115| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113|    |-		respondChaseBeyondVision: false,
|    | 113|+		"respondChaseBeyondVision": false,
| 114| 114| 		respondStandGround: true,
| 115| 115| 		respondHoldGround: false,
| 116| 116| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114|    |-		respondStandGround: true,
|    | 114|+		"respondStandGround": true,
| 115| 115| 		respondHoldGround: false,
| 116| 116| 	},
| 117| 117| };
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
| 115|    |-		respondHoldGround: false,
|    | 115|+		"respondHoldGround": false,
| 116| 116| 	},
| 117| 117| };
| 118| 118| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 213| 213| 		// Move a tile outside the building
| 214| 214| 		let range = 4;
| 215| 215| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 216|    |-		{
|    | 216|+		
| 217| 217| 			// We've started walking to the given point
| 218| 218| 			this.SetNextState("INDIVIDUAL.WALKING");
| 219|    |-		}
|    | 219|+		
| 220| 220| 		else
| 221| 221| 		{
| 222| 222| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 218| 218| 			this.SetNextState("INDIVIDUAL.WALKING");
| 219| 219| 		}
| 220| 220| 		else
| 221|    |-		{
|    | 221|+		
| 222| 222| 			// We are already at the target, or can't move at all
| 223| 223| 			this.FinishOrder();
| 224|    |-		}
|    | 224|+		
| 225| 225| 	},
| 226| 226| 
| 227| 227| 	// Individual orders:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 323| 323| 
| 324| 324| 		var ok = this.MoveToTarget(this.order.data.target);
| 325| 325| 		if (ok)
| 326|    |-		{
|    | 326|+		
| 327| 327| 			// We've started walking to the given point
| 328| 328| 			if (this.IsAnimal())
| 329| 329| 				this.SetNextState("ANIMAL.WALKING");
| 330| 330| 			else
| 331| 331| 				this.SetNextState("INDIVIDUAL.WALKING");
| 332|    |-		}
|    | 332|+		
| 333| 333| 		else
| 334| 334| 		{
| 335| 335| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 351| 351| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 352| 352| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 353| 353| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 354|    |-		{
|    | 354|+		
| 355| 355| 			// we were already on the shoreline, and have not moved since
| 356| 356| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 357| 357| 				needToMove = false;
| 358|    |-		}
|    | 358|+		
| 359| 359| 
| 360| 360| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 361| 361| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 349| 349| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 350| 350| 		var needToMove = true;
| 351| 351| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 352|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 353|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 352|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 353|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 354| 354| 		{
| 355| 355| 			// we were already on the shoreline, and have not moved since
| 356| 356| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 360| 360| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 361| 361| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 362| 362| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 363|    |-		{
|    | 363|+		
| 364| 364| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 365|    |-		}
|    | 365|+		
| 366| 366| 		else
| 367| 367| 		{
| 368| 368| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 389| 389| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 390| 390| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 391| 391| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 392|    |-		{
|    | 392|+		
| 393| 393| 			// We've started fleeing from the given target
| 394| 394| 			if (this.IsAnimal())
| 395| 395| 				this.SetNextState("ANIMAL.FLEEING");
| 396| 396| 			else
| 397| 397| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 398|    |-		}
|    | 398|+		
| 399| 399| 		else
| 400| 400| 		{
| 401| 401| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 445| 445| 			}
| 446| 446| 
| 447| 447| 			if (this.order.data.attackType == this.oldAttackType)
| 448|    |-			{
|    | 448|+			
| 449| 449| 				if (this.IsAnimal())
| 450| 450| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 451| 451| 				else
| 452| 452| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 453|    |-			}
|    | 453|+			
| 454| 454| 			else
| 455| 455| 			{
| 456| 456| 				if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 452| 452| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 453| 453| 			}
| 454| 454| 			else
| 455|    |-			{
|    | 455|+			
| 456| 456| 				if (this.IsAnimal())
| 457| 457| 					this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
| 458| 458| 				else
| 459| 459| 					this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
| 460|    |-			}
|    | 460|+			
| 461| 461| 			return;
| 462| 462| 		}
| 463| 463| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 590| 590| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 591| 591| 				}
| 592| 592| 				else
| 593|    |-				{
|    | 593|+				
| 594| 594| 					// We couldn't move there, or the target moved away
| 595| 595| 					this.FinishOrder();
| 596|    |-				}
|    | 596|+				
| 597| 597| 				return;
| 598| 598| 			}
| 599| 599| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 603| 603| 
| 604| 604| 		// Try to move within range
| 605| 605| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 606|    |-		{
|    | 606|+		
| 607| 607| 			// We've started walking to the given point
| 608| 608| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 609|    |-		}
|    | 609|+		
| 610| 610| 		else
| 611| 611| 		{
| 612| 612| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 680| 680| 	"Order.Repair": function(msg) {
| 681| 681| 		// Try to move within range
| 682| 682| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 683|    |-		{
|    | 683|+		
| 684| 684| 			// We've started walking to the given point
| 685| 685| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 686|    |-		}
|    | 686|+		
| 687| 687| 		else
| 688| 688| 		{
| 689| 689| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 717| 717| 		}
| 718| 718| 
| 719| 719| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 720|    |-		{
|    | 720|+		
| 721| 721| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 722|    |-		}
|    | 722|+		
| 723| 723| 		else
| 724| 724| 		{
| 725| 725| 			// We do a range check before actually garrisoning
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 855| 855| 			if (!this.CheckTargetAttackRange(target, target))
| 856| 856| 			{
| 857| 857| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 858|    |-				{
|    | 858|+				
| 859| 859| 					if (this.MoveToTargetAttackRange(target, target))
| 860| 860| 					{
| 861| 861| 						this.SetNextState("COMBAT.APPROACHING");
| 862| 862| 						return;
| 863| 863| 					}
| 864|    |-				}
|    | 864|+				
| 865| 865| 				this.FinishOrder();
| 866| 866| 				return;
| 867| 867| 			}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 880| 880| 			}
| 881| 881| 			// Check if we are already in range, otherwise walk there
| 882| 882| 			if (!this.CheckGarrisonRange(msg.data.target))
| 883|    |-			{
|    | 883|+			
| 884| 884| 				if (!this.CheckTargetVisible(msg.data.target))
| 885| 885| 				{
| 886| 886| 					this.FinishOrder();
| 895| 895| 						return;
| 896| 896| 					}
| 897| 897| 				}
| 898|    |-			}
|    | 898|+			
| 899| 899| 
| 900| 900| 			this.SetNextState("GARRISON.GARRISONING");
| 901| 901| 		},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 887| 887| 					return;
| 888| 888| 				}
| 889| 889| 				else
| 890|    |-				{
|    | 890|+				
| 891| 891| 					// Out of range; move there in formation
| 892| 892| 					if (this.MoveToGarrisonRange(msg.data.target))
| 893| 893| 					{
| 894| 894| 						this.SetNextState("GARRISON.APPROACHING");
| 895| 895| 						return;
| 896| 896| 					}
| 897|    |-				}
|    | 897|+				
| 898| 898| 			}
| 899| 899| 
| 900| 900| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 886| 886| 					this.FinishOrder();
| 887| 887| 					return;
| 888| 888| 				}
| 889|    |-				else
| 890|    |-				{
|    | 889|+				
| 891| 890| 					// Out of range; move there in formation
| 892| 891| 					if (this.MoveToGarrisonRange(msg.data.target))
| 893| 892| 					{
| 894| 893| 						this.SetNextState("GARRISON.APPROACHING");
| 895| 894| 						return;
| 896| 895| 					}
| 897|    |-				}
|    | 896|+				
| 898| 897| 			}
| 899| 898| 
| 900| 899| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 913| 913| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 914| 914| 					}
| 915| 915| 					else
| 916|    |-					{
|    | 916|+					
| 917| 917| 						// We couldn't move there, or the target moved away
| 918| 918| 						this.FinishOrder();
| 919|    |-					}
|    | 919|+					
| 920| 920| 					return;
| 921| 921| 				}
| 922| 922| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1134|1134| 			},
|1135|1135| 		},
|1136|1136| 
|1137|    |-		"GARRISON":{
|    |1137|+		"GARRISON": {
|1138|1138| 			"enter": function() {
|1139|1139| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1140|1140| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1315|1315| 			// If the controller handled an order but some members rejected it,
|1316|1316| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1317|1317| 			if (this.orderQueue.length)
|1318|    |-			{
|    |1318|+			
|1319|1319| 				// We're leaving the formation, so stop our FormationWalk order
|1320|1320| 				if (this.FinishOrder())
|1321|1321| 					return;
|1322|    |-			}
|    |1322|+			
|1323|1323| 
|1324|1324| 			// No orders left, we're an individual now
|1325|1325| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1343|1343| 			// Move a tile outside the building
|1344|1344| 			let range = 4;
|1345|1345| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1346|    |-			{
|    |1346|+			
|1347|1347| 				// We've started walking to the given point
|1348|1348| 				this.SetNextState("WALKINGTOPOINT");
|1349|    |-			}
|    |1349|+			
|1350|1350| 			else
|1351|1351| 			{
|1352|1352| 				// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1348|1348| 				this.SetNextState("WALKINGTOPOINT");
|1349|1349| 			}
|1350|1350| 			else
|1351|    |-			{
|    |1351|+			
|1352|1352| 				// We are already at the target, or can't move at all
|1353|1353| 				this.FinishOrder();
|1354|    |-			}
|    |1354|+			
|1355|1355| 		},
|1356|1356| 
|1357|1357| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1366|1366| 		},
|1367|1367| 
|1368|1368| 		"WALKING": {
|1369|    |-			"enter": function () {
|    |1369|+			"enter": function() {
|1370|1370| 				var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
|1371|1371| 				var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
|1372|1372| 				if (cmpFormation && cmpVisual)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1549|1549| 
|1550|1550| 			"LosRangeUpdate": function(msg) {
|1551|1551| 				if (this.GetStance().targetVisibleEnemies)
|1552|    |-				{
|    |1552|+				
|1553|1553| 					// Start attacking one of the newly-seen enemy (if any)
|1554|1554| 					this.AttackEntitiesByPreference(msg.data.added);
|1555|    |-				}
|    |1555|+				
|1556|1556| 			},
|1557|1557| 
|1558|1558| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1577|1577| 		},
|1578|1578| 
|1579|1579| 		"WALKING": {
|1580|    |-			"enter": function () {
|    |1580|+			"enter": function() {
|1581|1581| 				this.SelectAnimation("move");
|1582|1582| 			},
|1583|1583| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1587|1587| 		},
|1588|1588| 
|1589|1589| 		"WALKINGANDFIGHTING": {
|1590|    |-			"enter": function () {
|    |1590|+			"enter": function() {
|1591|1591| 				// Show weapons rather than carried resources.
|1592|1592| 				this.SetAnimationVariant("combat");
|1593|1593| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1609|1609| 		},
|1610|1610| 
|1611|1611| 		"PATROL": {
|1612|    |-			"enter": function () {
|    |1612|+			"enter": function() {
|1613|1613| 				// Memorize the origin position in case that we want to go back
|1614|1614| 				let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|1615|1615| 				if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1653|1653| 			},
|1654|1654| 
|1655|1655| 			"ESCORTING": {
|1656|    |-				"enter": function () {
|    |1656|+				"enter": function() {
|1657|1657| 					// Show weapons rather than carried resources.
|1658|1658| 					this.SetAnimationVariant("combat");
|1659|1659| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1702|1702| 			},
|1703|1703| 
|1704|1704| 			"GUARDING": {
|1705|    |-				"enter": function () {
|    |1705|+				"enter": function() {
|1706|1706| 					this.StartTimer(1000, 1000);
|1707|1707| 					this.SetHeldPositionOnEntity(this.entity);
|1708|1708| 					this.SelectAnimation("idle");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1730|1730| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1731|1731| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1732|1732| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1733|    |-						{
|    |1733|+						
|1734|1734| 							if (this.CanHeal(this.isGuardOf))
|1735|1735| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1736|1736| 							else if (this.CanRepair(this.isGuardOf))
|1737|1737| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1738|    |-						}
|    |1738|+						
|1739|1739| 					}
|1740|1740| 				},
|1741|1741| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1787|1787| 			},
|1788|1788| 
|1789|1789| 			"APPROACHING": {
|1790|    |-				"enter": function () {
|    |1790|+				"enter": function() {
|1791|1791| 					// Show weapons rather than carried resources.
|1792|1792| 					this.SetAnimationVariant("combat");
|1793|1793| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1817|1817| 				"MoveCompleted": function() {
|1818|1818| 
|1819|1819| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1820|    |-					{
|    |1820|+					
|1821|1821| 						// If the unit needs to unpack, do so
|1822|1822| 						if (this.CanUnpack())
|1823|1823| 						{
|1826|1826| 						}
|1827|1827| 						else
|1828|1828| 							this.SetNextState("ATTACKING");
|1829|    |-					}
|    |1829|+					
|1830|1830| 					else
|1831|1831| 					{
|1832|1832| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1824|1824| 							this.PushOrderFront("Unpack", { "force": true });
|1825|1825| 							return;
|1826|1826| 						}
|1827|    |-						else
|1828|    |-							this.SetNextState("ATTACKING");
|    |1827|+						this.SetNextState("ATTACKING");
|1829|1828| 					}
|1830|1829| 					else
|1831|1830| 					{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1828|1828| 							this.SetNextState("ATTACKING");
|1829|1829| 					}
|1830|1830| 					else
|1831|    |-					{
|    |1831|+					
|1832|1832| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1833|1833| 						{
|1834|1834| 							this.SetNextState("APPROACHING");
|1838|1838| 							// Give up
|1839|1839| 							this.FinishOrder();
|1840|1840| 						}
|1841|    |-					}
|    |1841|+					
|1842|1842| 				},
|1843|1843| 			},
|1844|1844| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1830|1830| 					else
|1831|1831| 					{
|1832|1832| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1833|    |-						{
|    |1833|+						
|1834|1834| 							this.SetNextState("APPROACHING");
|1835|    |-						}
|    |1835|+						
|1836|1836| 						else
|1837|1837| 						{
|1838|1838| 							// Give up
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1834|1834| 							this.SetNextState("APPROACHING");
|1835|1835| 						}
|1836|1836| 						else
|1837|    |-						{
|    |1837|+						
|1838|1838| 							// Give up
|1839|1839| 							this.FinishOrder();
|1840|    |-						}
|    |1840|+						
|1841|1841| 					}
|1842|1842| 				},
|1843|1843| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1855|1855| 					}
|1856|1856| 					// Check the target is still alive and attackable
|1857|1857| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1858|    |-					{
|    |1858|+					
|1859|1859| 						// Can't reach it - try to chase after it
|1860|1860| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1861|1861| 						{
|1865|1865| 								return;
|1866|1866| 							}
|1867|1867| 						}
|1868|    |-					}
|    |1868|+					
|1869|1869| 
|1870|1870| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1871|1871| 					this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1858|1858| 					{
|1859|1859| 						// Can't reach it - try to chase after it
|1860|1860| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1861|    |-						{
|    |1861|+						
|1862|1862| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1863|1863| 							{
|1864|1864| 								this.SetNextState("COMBAT.CHASING");
|1865|1865| 								return;
|1866|1866| 							}
|1867|    |-						}
|    |1867|+						
|1868|1868| 					}
|1869|1869| 
|1870|1870| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1895|1895| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1896|1896| 
|1897|1897| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1898|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1898|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1899|1899| 
|1900|1900| 					this.FaceTowardsTarget(this.order.data.target);
|1901|1901| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1969|1969| 
|1970|1970| 						// Can't reach it - try to chase after it
|1971|1971| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1972|    |-						{
|    |1972|+						
|1973|1973| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1974|1974| 							{
|1975|1975| 								this.SetNextState("COMBAT.CHASING");
|1976|1976| 								return;
|1977|1977| 							}
|1978|    |-						}
|    |1978|+						
|1979|1979| 					}
|1980|1980| 
|1981|1981| 					// if we're targetting a formation, find a new member of that formation
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2016|2016| 
|2017|2017| 				"Attacked": function(msg) {
|2018|2018| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2019|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2020|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2019|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2020|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2021|2021| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2022|2022| 				},
|2023|2023| 			},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2023|2023| 			},
|2024|2024| 
|2025|2025| 			"CHASING": {
|2026|    |-				"enter": function () {
|    |2026|+				"enter": function() {
|2027|2027| 					// Show weapons rather than carried resources.
|2028|2028| 					this.SetAnimationVariant("combat");
|2029|2029| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2098|2098| 
|2099|2099| 						// Try to find another nearby target of the same specific type
|2100|2100| 						// Also don't switch to a different type of huntable animal
|2101|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2101|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2102|2102| 							return (
|2103|2103| 								ent != oldTarget
|2104|2104| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2100|2100| 						// Also don't switch to a different type of huntable animal
|2101|2101| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2102|2102| 							return (
|2103|    |-								ent != oldTarget
|2104|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2103|+								ent != oldTarget &&
|    |2104|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2105|2105| 								 || (type.specific == oldType.specific
|2106|2106| 								 && (type.specific != "meat" || oldTemplate == template)))
|2107|2107| 							);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2101|2101| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2102|2102| 							return (
|2103|2103| 								ent != oldTarget
|2104|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2105|    |-								 || (type.specific == oldType.specific
|    |2104|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2105|+								 (type.specific == oldType.specific
|2106|2106| 								 && (type.specific != "meat" || oldTemplate == template)))
|2107|2107| 							);
|2108|2108| 						}, oldTarget);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2102|2102| 							return (
|2103|2103| 								ent != oldTarget
|2104|2104| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2105|    |-								 || (type.specific == oldType.specific
|2106|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2105|+								 || (type.specific == oldType.specific &&
|    |2106|+								 (type.specific != "meat" || oldTemplate == template)))
|2107|2107| 							);
|2108|2108| 						}, oldTarget);
|2109|2109| 						if (nearby)
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2111|2111| 							this.PerformGather(nearby, false, false);
|2112|2112| 							return true;
|2113|2113| 						}
|2114|    |-						else
|2115|    |-						{
|    |2114|+						
|2116|2115| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2117|2116| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2118|2117| 							// to order it to GatherNear the resource position.
|2133|2132| 									return true;
|2134|2133| 								}
|2135|2134| 							}
|2136|    |-						}
|    |2135|+						
|2137|2136| 						return true;
|2138|2137| 					}
|2139|2138| 					return false;
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2123|2123| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2124|2124| 								return true;
|2125|2125| 							}
|2126|    |-							else
|2127|    |-							{
|    |2126|+							
|2128|2127| 								// we're kind of stuck here. Return resource.
|2129|2128| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2130|2129| 								if (nearby)
|2132|2131| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2133|2132| 									return true;
|2134|2133| 								}
|2135|    |-							}
|    |2134|+							
|2136|2135| 						}
|2137|2136| 						return true;
|2138|2137| 					}
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2163|2163| 
|2164|2164| 						// Try to find another nearby target of the same specific type
|2165|2165| 						// Also don't switch to a different type of huntable animal
|2166|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2166|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2167|2167| 							return (
|2168|2168| 								ent != oldTarget
|2169|2169| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2165|2165| 						// Also don't switch to a different type of huntable animal
|2166|2166| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2167|2167| 							return (
|2168|    |-								ent != oldTarget
|2169|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2168|+								ent != oldTarget &&
|    |2169|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2170|2170| 								|| (type.specific == oldType.specific
|2171|2171| 								&& (type.specific != "meat" || oldTemplate == template)))
|2172|2172| 							);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2166|2166| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2167|2167| 							return (
|2168|2168| 								ent != oldTarget
|2169|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2170|    |-								|| (type.specific == oldType.specific
|    |2169|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2170|+								(type.specific == oldType.specific
|2171|2171| 								&& (type.specific != "meat" || oldTemplate == template)))
|2172|2172| 							);
|2173|2173| 						});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2167|2167| 							return (
|2168|2168| 								ent != oldTarget
|2169|2169| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2170|    |-								|| (type.specific == oldType.specific
|2171|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2170|+								|| (type.specific == oldType.specific &&
|    |2171|+								(type.specific != "meat" || oldTemplate == template)))
|2172|2172| 							);
|2173|2173| 						});
|2174|2174| 						if (nearby)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2209|2209| 
|2210|2210| 					// Try to find another nearby target of the same specific type
|2211|2211| 					// Also don't switch to a different type of huntable animal
|2212|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2212|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2213|2213| 						return (
|2214|2214| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2215|2215| 							|| (type.specific == resourceType.specific
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2211|2211| 					// Also don't switch to a different type of huntable animal
|2212|2212| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2213|2213| 						return (
|2214|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2215|    |-							|| (type.specific == resourceType.specific
|    |2214|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2215|+							(type.specific == resourceType.specific
|2216|2216| 							&& (type.specific != "meat" || resourceTemplate == template))
|2217|2217| 						);
|2218|2218| 					});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2212|2212| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2213|2213| 						return (
|2214|2214| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2215|    |-							|| (type.specific == resourceType.specific
|2216|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2215|+							|| (type.specific == resourceType.specific &&
|    |2216|+							(type.specific != "meat" || resourceTemplate == template))
|2217|2217| 						);
|2218|2218| 					});
|2219|2219| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2328|2328| 
|2329|2329| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2330|2330| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2331|    |-					{
|    |2331|+					
|2332|2332| 						// Check we can still reach and gather from the target
|2333|2333| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2334|2334| 						{
|2394|2394| 								return;
|2395|2395| 							}
|2396|2396| 						}
|2397|    |-					}
|    |2397|+					
|2398|2398| 
|2399|2399| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2400|2400| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2418|2418| 
|2419|2419| 					// Try to find a new resource of the same specific type near our current position:
|2420|2420| 					// Also don't switch to a different type of huntable animal
|2421|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2421|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2422|2422| 						return (
|2423|2423| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2424|2424| 							|| (type.specific == resourceType.specific
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2420|2420| 					// Also don't switch to a different type of huntable animal
|2421|2421| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2422|2422| 						return (
|2423|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2424|    |-							|| (type.specific == resourceType.specific
|    |2423|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2424|+							(type.specific == resourceType.specific
|2425|2425| 							&& (type.specific != "meat" || resourceTemplate == template))
|2426|2426| 						);
|2427|2427| 					});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2421|2421| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2422|2422| 						return (
|2423|2423| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2424|    |-							|| (type.specific == resourceType.specific
|2425|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2424|+							|| (type.specific == resourceType.specific &&
|    |2425|+							(type.specific != "meat" || resourceTemplate == template))
|2426|2426| 						);
|2427|2427| 					});
|2428|2428| 					if (nearby)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2462|2462| 			},
|2463|2463| 
|2464|2464| 			"APPROACHING": {
|2465|    |-				"enter": function () {
|    |2465|+				"enter": function() {
|2466|2466| 					this.SelectAnimation("move");
|2467|2467| 					this.StartTimer(1000, 1000);
|2468|2468| 				},
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2508|2508| 					this.StartTimer(prepare, this.healTimers.repeat);
|2509|2509| 
|2510|2510| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2511|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2511|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2512|2512| 
|2513|2513| 					this.FaceTowardsTarget(this.order.data.target);
|2514|2514| 				},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2541|2541| 						}
|2542|2542| 						// Can't reach it - try to chase after it
|2543|2543| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|2544|    |-						{
|    |2544|+						
|2545|2545| 							if (this.MoveToTargetRange(target, IID_Heal))
|2546|2546| 							{
|2547|2547| 								this.SetNextState("HEAL.CHASING");
|2548|2548| 								return;
|2549|2549| 							}
|2550|    |-						}
|    |2550|+						
|2551|2551| 					}
|2552|2552| 					// Can't reach it, healed to max hp or doesn't exist any more - give up
|2553|2553| 					if (this.FinishOrder())
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2563|2563| 				},
|2564|2564| 			},
|2565|2565| 			"CHASING": {
|2566|    |-				"enter": function () {
|    |2566|+				"enter": function() {
|2567|2567| 					this.SelectAnimation("move");
|2568|2568| 					this.StartTimer(1000, 1000);
|2569|2569| 				},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2568|2568| 					this.StartTimer(1000, 1000);
|2569|2569| 				},
|2570|2570| 
|2571|    |-				"leave": function () {
|    |2571|+				"leave": function() {
|2572|2572| 					this.StopTimer();
|2573|2573| 				},
|2574|2574| 				"Timer": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2582|2582| 							this.WalkToHeldPosition();
|2583|2583| 					}
|2584|2584| 				},
|2585|    |-				"MoveCompleted": function () {
|    |2585|+				"MoveCompleted": function() {
|2586|2586| 					this.SetNextState("HEALING");
|2587|2587| 				},
|2588|2588| 			},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2591|2591| 		// Returning to dropsite
|2592|2592| 		"RETURNRESOURCE": {
|2593|2593| 			"APPROACHING": {
|2594|    |-				"enter": function () {
|    |2594|+				"enter": function() {
|2595|2595| 					this.SelectAnimation("move");
|2596|2596| 				},
|2597|2597| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2649|2649| 			},
|2650|2650| 
|2651|2651| 			"APPROACHINGMARKET": {
|2652|    |-				"enter": function () {
|    |2652|+				"enter": function() {
|2653|2653| 					this.SelectAnimation("move");
|2654|2654| 				},
|2655|2655| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2677|2677| 
|2678|2678| 		"REPAIR": {
|2679|2679| 			"APPROACHING": {
|2680|    |-				"enter": function () {
|    |2680|+				"enter": function() {
|2681|2681| 					this.SelectAnimation("move");
|2682|2682| 				},
|2683|2683| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2718|2718| 					{
|2719|2719| 						// The building was already finished/fully repaired before we arrived;
|2720|2720| 						// let the ConstructionFinished handler handle this.
|2721|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2721|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2722|2722| 						return true;
|2723|2723| 					}
|2724|2724| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2718|2718| 					{
|2719|2719| 						// The building was already finished/fully repaired before we arrived;
|2720|2720| 						// let the ConstructionFinished handler handle this.
|2721|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2721|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2722|2722| 						return true;
|2723|2723| 					}
|2724|2724| 
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2758|2758| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2759|2759| 						this.SetNextState("APPROACHING");
|2760|2760| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2761|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2761|+						this.FinishOrder(); // can't approach and isn't in reach
|2762|2762| 				},
|2763|2763| 			},
|2764|2764| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2825|2825| 					var types = cmpResourceDropsite.GetTypes();
|2826|2826| 					// TODO: Slightly undefined behavior here, we don't know what type of resource will be collected,
|2827|2827| 					//   may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that!
|2828|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2828|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2829|2829| 						return (types.indexOf(type.generic) != -1);
|2830|2830| 					}, msg.data.newentity);
|2831|2831| 					if (nearby)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2845|2845| 
|2846|2846| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2847|2847| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2848|    |-				{
|    |2848|+				
|2849|2849| 					// We're already walking to the given point, so add this as a order.
|2850|2850| 					this.WalkToTarget(msg.data.newentity, true);
|2851|    |-				}
|    |2851|+				
|2852|2852| 			},
|2853|2853| 		},
|2854|2854| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2895|2895| 
|2896|2896| 					// Check that we can garrison here
|2897|2897| 					if (this.CanGarrison(target))
|2898|    |-					{
|    |2898|+					
|2899|2899| 						// Check that we're in range of the garrison target
|2900|2900| 						if (this.CheckGarrisonRange(target))
|2901|2901| 						{
|2971|2971| 								return false;
|2972|2972| 							}
|2973|2973| 						}
|2974|    |-					}
|    |2974|+					
|2975|2975| 					// Garrisoning failed for some reason, so finish the order
|2976|2976| 					this.FinishOrder();
|2977|2977| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3088|3088| 		"Attacked": function(msg) {
|3089|3089| 			if (this.template.NaturalBehaviour == "skittish" ||
|3090|3090| 			    this.template.NaturalBehaviour == "passive")
|3091|    |-			{
|    |3091|+			
|3092|3092| 				this.Flee(msg.data.attacker, false);
|3093|    |-			}
|    |3093|+			
|3094|3094| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3095|3095| 			{
|3096|3096| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3097|3097| 					this.Attack(msg.data.attacker, false);
|3098|3098| 			}
|3099|3099| 			else if (this.template.NaturalBehaviour == "domestic")
|3100|    |-			{
|    |3100|+			
|3101|3101| 				// Never flee, stop what we were doing
|3102|3102| 				this.SetNextState("IDLE");
|3103|    |-			}
|    |3103|+			
|3104|3104| 		},
|3105|3105| 
|3106|3106| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3107|3107| 			// Move a tile outside the building
|3108|3108| 			var range = 4;
|3109|3109| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3110|    |-			{
|    |3110|+			
|3111|3111| 				// We've started walking to the given point
|3112|3112| 				this.SetNextState("WALKING");
|3113|    |-			}
|    |3113|+			
|3114|3114| 			else
|3115|3115| 			{
|3116|3116| 				// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3112|3112| 				this.SetNextState("WALKING");
|3113|3113| 			}
|3114|3114| 			else
|3115|    |-			{
|    |3115|+			
|3116|3116| 				// We are already at the target, or can't move at all
|3117|3117| 				this.FinishOrder();
|3118|    |-			}
|    |3118|+			
|3119|3119| 		},
|3120|3120| 
|3121|3121| 		"IDLE": {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3154|3154| 				}
|3155|3155| 				// Start attacking one of the newly-seen enemy (if any)
|3156|3156| 				else if (this.IsDangerousAnimal())
|3157|    |-				{
|    |3157|+				
|3158|3158| 					this.AttackVisibleEntity(msg.data.added);
|3159|    |-				}
|    |3159|+				
|3160|3160| 
|3161|3161| 				// TODO: if two units enter our range together, we'll attack the
|3162|3162| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3197|3197| 				}
|3198|3198| 				// Start attacking one of the newly-seen enemy (if any)
|3199|3199| 				else if (this.template.NaturalBehaviour == "violent")
|3200|    |-				{
|    |3200|+				
|3201|3201| 					this.AttackVisibleEntity(msg.data.added);
|3202|    |-				}
|    |3202|+				
|3203|3203| 			},
|3204|3204| 
|3205|3205| 			"MoveCompleted": function() { },
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3214|3214| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3215|3215| 
|3216|3216| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3217|    |-							// only used for domestic animals
|    |3217|+		// only used for domestic animals
|3218|3218| 	},
|3219|3219| };
|3220|3220| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3273|3273| 
|3274|3274| UnitAI.prototype.IsAnimal = function()
|3275|3275| {
|3276|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3276|+	return (!!this.template.NaturalBehaviour);
|3277|3277| };
|3278|3278| 
|3279|3279| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3311|3311| UnitAI.prototype.GetGarrisonHolder = function()
|3312|3312| {
|3313|3313| 	if (this.IsGarrisoned())
|3314|    |-	{
|    |3314|+	
|3315|3315| 		for (let order of this.orderQueue)
|3316|3316| 			if (order.type == "Garrison" || order.type == "Autogarrison")
|3317|3317| 				return order.data.target;
|3318|    |-	}
|    |3318|+	
|3319|3319| 	return INVALID_ENTITY;
|3320|3320| };
|3321|3321| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3392|3392| 		{
|3393|3393| 			let index = this.GetCurrentState().indexOf(".");
|3394|3394| 			if (index != -1)
|3395|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3395|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3396|3396| 			this.Stop(false);
|3397|3397| 		}
|3398|3398| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3448|3448| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3449|3449| 			continue;
|3450|3450| 		if (i == 0)
|3451|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3451|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3452|3452| 		else
|3453|3453| 			this.orderQueue.splice(i, 1);
|3454|3454| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3448|3448| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3449|3449| 			continue;
|3450|3450| 		if (i == 0)
|3451|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3451|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3452|3452| 		else
|3453|3453| 			this.orderQueue.splice(i, 1);
|3454|3454| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3532|3532| };
|3533|3533| 
|3534|3534| 
|3535|    |-//// FSM linkage functions ////
|    |3535|+// // FSM linkage functions ////
|3536|3536| 
|3537|3537| UnitAI.prototype.SetNextState = function(state)
|3538|3538| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3583|3583| 	if (this.orderQueue.length)
|3584|3584| 	{
|3585|3585| 		let ret = this.UnitFsm.ProcessMessage(this,
|3586|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3586|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3587|3587| 		);
|3588|3588| 
|3589|3589| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3583|3583| 	if (this.orderQueue.length)
|3584|3584| 	{
|3585|3585| 		let ret = this.UnitFsm.ProcessMessage(this,
|3586|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3586|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3587|3587| 		);
|3588|3588| 
|3589|3589| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3596|3596| 		// Otherwise we've successfully processed a new order
|3597|3597| 		return true;
|3598|3598| 	}
|3599|    |-	else
|3600|    |-	{
|    |3599|+	
|3601|3600| 		this.SetNextState("IDLE");
|3602|3601| 
|3603|3602| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3618|3617| 		}
|3619|3618| 
|3620|3619| 		return false;
|3621|    |-	}
|    |3620|+	
|3622|3621| };
|3623|3622| 
|3624|3623| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3635|3635| 	{
|3636|3636| 		this.order = order;
|3637|3637| 		let ret = this.UnitFsm.ProcessMessage(this,
|3638|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3638|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3639|3639| 		);
|3640|3640| 
|3641|3641| 		// If the order was rejected then immediately take it off
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3635|3635| 	{
|3636|3636| 		this.order = order;
|3637|3637| 		let ret = this.UnitFsm.ProcessMessage(this,
|3638|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3638|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3639|3639| 		);
|3640|3640| 
|3641|3641| 		// If the order was rejected then immediately take it off
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3671|3671| 		this.orderQueue.unshift(order);
|3672|3672| 		this.order = order;
|3673|3673| 		let ret = this.UnitFsm.ProcessMessage(this,
|3674|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3674|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3675|3675| 		);
|3676|3676| 
|3677|3677| 		// If the order was rejected then immediately take it off again;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3671|3671| 		this.orderQueue.unshift(order);
|3672|3672| 		this.order = order;
|3673|3673| 		let ret = this.UnitFsm.ProcessMessage(this,
|3674|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3674|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3675|3675| 		);
|3676|3676| 
|3677|3677| 		// If the order was rejected then immediately take it off again;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3705|3705| 				continue;
|3706|3706| 			if (this.orderQueue[i].type == type)
|3707|3707| 				continue;
|3708|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3708|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3709|3709| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3710|3710| 			return;
|3711|3711| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3705|3705| 				continue;
|3706|3706| 			if (this.orderQueue[i].type == type)
|3707|3707| 				continue;
|3708|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3708|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3709|3709| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3710|3710| 			return;
|3711|3711| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3719|3719| {
|3720|3720| 	// Remember the previous work orders to be able to go back to them later if required
|3721|3721| 	if (data && data.force)
|3722|    |-	{
|    |3722|+	
|3723|3723| 		if (this.IsFormationController())
|3724|3724| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3725|3725| 		else
|3726|3726| 			this.UpdateWorkOrders(type);
|3727|    |-	}
|    |3727|+	
|3728|3728| 
|3729|3729| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3730|3730| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3796|3796| 	{
|3797|3797| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3798|3798| 		if (cmpUnitAI)
|3799|    |-		{
|    |3799|+		
|3800|3800| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3801|3801| 			{
|3802|3802| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3805|3805| 					return;
|3806|3806| 				}
|3807|3807| 			}
|3808|    |-		}
|    |3808|+		
|3809|3809| 	}
|3810|3810| 
|3811|3811| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3798|3798| 		if (cmpUnitAI)
|3799|3799| 		{
|3800|3800| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3801|    |-			{
|    |3801|+			
|3802|3802| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3803|3803| 				{
|3804|3804| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3805|3805| 					return;
|3806|3806| 				}
|3807|    |-			}
|    |3807|+			
|3808|3808| 		}
|3809|3809| 	}
|3810|3810| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3810|3810| 
|3811|3811| 	// If nothing found, take the unit orders
|3812|3812| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3813|    |-	{
|    |3813|+	
|3814|3814| 		if (isWorkType(this.orderQueue[i].type))
|3815|3815| 		{
|3816|3816| 			this.workOrders = this.orderQueue.slice(i);
|3817|3817| 			return;
|3818|3818| 		}
|3819|    |-	}
|    |3819|+	
|3820|3820| };
|3821|3821| 
|3822|3822| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3876|3876| 	if (data.timerRepeat === undefined)
|3877|3877| 		this.timer = undefined;
|3878|3878| 
|3879|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3879|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3880|3880| };
|3881|3881| 
|3882|3882| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3876|3876| 	if (data.timerRepeat === undefined)
|3877|3877| 		this.timer = undefined;
|3878|3878| 
|3879|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3879|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3880|3880| };
|3881|3881| 
|3882|3882| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3911|3911| 	this.timer = undefined;
|3912|3912| };
|3913|3913| 
|3914|    |-//// Message handlers /////
|    |3914|+// // Message handlers /////
|3915|3915| 
|3916|3916| UnitAI.prototype.OnMotionChanged = function(msg)
|3917|3917| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3916|3916| UnitAI.prototype.OnMotionChanged = function(msg)
|3917|3917| {
|3918|3918| 	if (msg.starting && !msg.error)
|3919|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3919|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3920|3920| 	else if (!msg.starting || msg.error)
|3921|3921| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3922|3922| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3916|3916| UnitAI.prototype.OnMotionChanged = function(msg)
|3917|3917| {
|3918|3918| 	if (msg.starting && !msg.error)
|3919|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3919|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3920|3920| 	else if (!msg.starting || msg.error)
|3921|3921| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3922|3922| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3918|3918| 	if (msg.starting && !msg.error)
|3919|3919| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3920|3920| 	else if (!msg.starting || msg.error)
|3921|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3921|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3922|3922| };
|3923|3923| 
|3924|3924| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3918|3918| 	if (msg.starting && !msg.error)
|3919|3919| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3920|3920| 	else if (!msg.starting || msg.error)
|3921|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3921|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3922|3922| };
|3923|3923| 
|3924|3924| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3926|3926| 	// TODO: This is a bit inefficient since every unit listens to every
|3927|3927| 	// construction message - ideally we could scope it to only the one we're building
|3928|3928| 
|3929|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3929|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3930|3930| };
|3931|3931| 
|3932|3932| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3926|3926| 	// TODO: This is a bit inefficient since every unit listens to every
|3927|3927| 	// construction message - ideally we could scope it to only the one we're building
|3928|3928| 
|3929|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3929|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3930|3930| };
|3931|3931| 
|3932|3932| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3951|3951| 
|3952|3952| UnitAI.prototype.OnAttacked = function(msg)
|3953|3953| {
|3954|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3954|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3955|3955| };
|3956|3956| 
|3957|3957| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3951|3951| 
|3952|3952| UnitAI.prototype.OnAttacked = function(msg)
|3953|3953| {
|3954|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3954|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3955|3955| };
|3956|3956| 
|3957|3957| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3956|3956| 
|3957|3957| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3959|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3960|3960| };
|3961|3961| 
|3962|3962| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3956|3956| 
|3957|3957| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3958|3958| {
|3959|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3959|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3960|3960| };
|3961|3961| 
|3962|3962| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3961|3961| 
|3962|3962| UnitAI.prototype.OnHealthChanged = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3964|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3965|3965| };
|3966|3966| 
|3967|3967| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3961|3961| 
|3962|3962| UnitAI.prototype.OnHealthChanged = function(msg)
|3963|3963| {
|3964|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3964|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3965|3965| };
|3966|3966| 
|3967|3967| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3967|3967| UnitAI.prototype.OnRangeUpdate = function(msg)
|3968|3968| {
|3969|3969| 	if (msg.tag == this.losRangeQuery)
|3970|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3970|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3971|3971| 	else if (msg.tag == this.losHealRangeQuery)
|3972|3972| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3973|3973| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3967|3967| UnitAI.prototype.OnRangeUpdate = function(msg)
|3968|3968| {
|3969|3969| 	if (msg.tag == this.losRangeQuery)
|3970|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3970|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3971|3971| 	else if (msg.tag == this.losHealRangeQuery)
|3972|3972| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3973|3973| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3969|3969| 	if (msg.tag == this.losRangeQuery)
|3970|3970| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3971|3971| 	else if (msg.tag == this.losHealRangeQuery)
|3972|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3972|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3973|3973| };
|3974|3974| 
|3975|3975| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3969|3969| 	if (msg.tag == this.losRangeQuery)
|3970|3970| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3971|3971| 	else if (msg.tag == this.losHealRangeQuery)
|3972|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3972|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3973|3973| };
|3974|3974| 
|3975|3975| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3974|3974| 
|3975|3975| UnitAI.prototype.OnPackFinished = function(msg)
|3976|3976| {
|3977|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3977|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3978|3978| };
|3979|3979| 
|3980|3980| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3974|3974| 
|3975|3975| UnitAI.prototype.OnPackFinished = function(msg)
|3976|3976| {
|3977|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3977|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3978|3978| };
|3979|3979| 
|3980|3980| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3977|3977| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3978|3978| };
|3979|3979| 
|3980|    |-//// Helper functions to be called by the FSM ////
|    |3980|+// // Helper functions to be called by the FSM ////
|3981|3981| 
|3982|3982| UnitAI.prototype.GetWalkSpeed = function()
|3983|3983| {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4081|4081| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4082|4082| 		return undefined;
|4083|4083| 
|4084|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4084|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4085|4085| 	if (!cmpPosition)
|4086|4086| 		return undefined;
|4087|4087| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4166|4166| 			PlaySound(name, member);
|4167|4167| 	}
|4168|4168| 	else
|4169|    |-	{
|    |4169|+	
|4170|4170| 		// Otherwise use our own sounds
|4171|4171| 		PlaySound(name, this.entity);
|4172|    |-	}
|    |4172|+	
|4173|4173| };
|4174|4174| 
|4175|4175| /*
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4353|4353| 	else
|4354|4354| 		// return false? Or hope you come close enough?
|4355|4355| 		var parabolicMaxRange = 0;
|4356|    |-		//return false;
|    |4356|+		// return false;
|4357|4357| 
|4358|4358| 	// the parabole changes while walking, take something in the middle
|4359|4359| 	var guessedMaxRange = (range.max + parabolicMaxRange)/2;
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4418|4418| 	if (this.IsFormationMember())
|4419|4419| 	{
|4420|4420| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4421|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4422|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4421|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4422|+			cmpFormationUnitAI.order.data.target == target)
|4423|4423| 			return true;
|4424|4424| 	}
|4425|4425| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4538|4538| 	var pos = cmpPosition.GetPosition();
|4539|4539| 	var heldPosition = this.heldPosition;
|4540|4540| 	if (heldPosition === undefined)
|4541|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4541|+		heldPosition = { "x": pos.x, "z": pos.z};
|4542|4542| 
|4543|4543| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4544|4544| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4538|4538| 	var pos = cmpPosition.GetPosition();
|4539|4539| 	var heldPosition = this.heldPosition;
|4540|4540| 	if (heldPosition === undefined)
|4541|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4541|+		heldPosition = {"x": pos.x, "z": pos.z };
|4542|4542| 
|4543|4543| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4544|4544| };
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4586|4586| UnitAI.prototype.AttackEntityInZone = function(ents)
|4587|4587| {
|4588|4588| 	var target = ents.find(target =>
|4589|    |-		this.CanAttack(target)
|4590|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4589|+		this.CanAttack(target) &&
|    |4590|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4591|4591| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4592|4592| 	);
|4593|4593| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4587|4587| {
|4588|4588| 	var target = ents.find(target =>
|4589|4589| 		this.CanAttack(target)
|4590|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4591|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4590|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4591|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4592|4592| 	);
|4593|4593| 	if (!target)
|4594|4594| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4651|4651| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4652|4652| 	if (this.isGuardOf)
|4653|4653| 	{
|4654|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4654|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4655|4655| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4656|4656| 		if (cmpUnitAI && cmpAttack &&
|4657|4657| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4655|4655| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4656|4656| 		if (cmpUnitAI && cmpAttack &&
|4657|4657| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4658|    |-				return false;
|    |4658|+			return false;
|4659|4659| 	}
|4660|4660| 
|4661|4661| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4660|4660| 
|4661|4661| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4662|4662| 	if (this.GetStance().respondHoldGround)
|4663|    |-	{
|    |4663|+	
|4664|4664| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4665|4665| 			return true;
|4666|    |-	}
|    |4666|+	
|4667|4667| 
|4668|4668| 	// Stop if it's left our vision range, unless we're especially persistent
|4669|4669| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4667|4667| 
|4668|4668| 	// Stop if it's left our vision range, unless we're especially persistent
|4669|4669| 	if (!this.GetStance().respondChaseBeyondVision)
|4670|    |-	{
|    |4670|+	
|4671|4671| 		if (!this.CheckTargetIsInVisionRange(target))
|4672|4672| 			return true;
|4673|    |-	}
|    |4673|+	
|4674|4674| 
|4675|4675| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4676|4676| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4698|4698| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4699|4699| 	if (this.isGuardOf)
|4700|4700| 	{
|4701|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4701|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4702|4702| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4703|4703| 		if (cmpUnitAI && cmpAttack &&
|4704|4704| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4711|4711| 	return false;
|4712|4712| };
|4713|4713| 
|4714|    |-//// External interface functions ////
|    |4714|+// // External interface functions ////
|4715|4715| 
|4716|4716| UnitAI.prototype.SetFormationController = function(ent)
|4717|4717| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4721|4721| 	// of our own formation (or ourself if not in formation)
|4722|4722| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4723|4723| 	if (cmpObstruction)
|4724|    |-	{
|    |4724|+	
|4725|4725| 		if (ent == INVALID_ENTITY)
|4726|4726| 			cmpObstruction.SetControlGroup(this.entity);
|4727|4727| 		else
|4728|4728| 			cmpObstruction.SetControlGroup(ent);
|4729|    |-	}
|    |4729|+	
|4730|4730| 
|4731|4731| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4732|4732| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4869|4869| 	// if we already had an old guard order, do nothing if the target is the same
|4870|4870| 	// and the order is running, otherwise remove the previous order
|4871|4871| 	if (this.isGuardOf)
|4872|    |-	{
|    |4872|+	
|4873|4873| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4874|4874| 			return;
|4875|4875| 		else
|4876|4876| 			this.RemoveGuard();
|4877|    |-	}
|    |4877|+	
|4878|4878| 
|4879|4879| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4880|4880| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4872|4872| 	{
|4873|4873| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4874|4874| 			return;
|4875|    |-		else
|4876|    |-			this.RemoveGuard();
|    |4875|+		this.RemoveGuard();
|4877|4876| 	}
|4878|4877| 
|4879|4878| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4914|4914| 		return;
|4915|4915| 
|4916|4916| 	if (this.order.type == "Guard")
|4917|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4917|+		this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"});
|4918|4918| 	else
|4919|4919| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4920|4920| 			if (this.orderQueue[i].type == "Guard")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4914|4914| 		return;
|4915|4915| 
|4916|4916| 	if (this.order.type == "Guard")
|4917|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4917|+		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" });
|4918|4918| 	else
|4919|4919| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4920|4920| 			if (this.orderQueue[i].type == "Guard")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5043|5043| 			this.WalkToTarget(target, queued);
|5044|5044| 		return;
|5045|5045| 	}
|5046|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |5046|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|5047|5047| };
|5048|5048| 
|5049|5049| /**
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5458|5458| 				{
|5459|5459| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5460|5460| 					var targetClasses = this.order.data.targetClasses;
|5461|    |-					if (targetClasses.attack && cmpIdentity
|5462|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5461|+					if (targetClasses.attack && cmpIdentity &&
|    |5462|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5463|5463| 						continue;
|5464|5464| 					if (targetClasses.avoid && cmpIdentity
|5465|5465| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5461|5461| 					if (targetClasses.attack && cmpIdentity
|5462|5462| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5463|5463| 						continue;
|5464|    |-					if (targetClasses.avoid && cmpIdentity
|5465|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5464|+					if (targetClasses.avoid && cmpIdentity &&
|    |5465|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5466|5466| 						continue;
|5467|5467| 					// Only used by the AIs to prevent some choices of targets
|5468|5468| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5484|5484| 		{
|5485|5485| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5486|5486| 			var targetClasses = this.order.data.targetClasses;
|5487|    |-			if (cmpIdentity && targetClasses.attack
|5488|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5487|+			if (cmpIdentity && targetClasses.attack &&
|    |5488|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5489|5489| 				continue;
|5490|5490| 			if (cmpIdentity && targetClasses.avoid
|5491|5491| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5487|5487| 			if (cmpIdentity && targetClasses.attack
|5488|5488| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5489|5489| 				continue;
|5490|    |-			if (cmpIdentity && targetClasses.avoid
|5491|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5490|+			if (cmpIdentity && targetClasses.avoid &&
|    |5491|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5492|5492| 				continue;
|5493|5493| 			// Only used by the AIs to prevent some choices of targets
|5494|5494| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5527|5527| 
|5528|5528| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5529|5529| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5530|    |-	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|    |5530|+	var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5531|5531| 		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5532|5532| 
|5533|5533| 	return targets;
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5528|5528| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5529|5529| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5530|5530| 	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5531|    |-		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|    |5531|+		.sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5532|5532| 
|5533|5533| 	return targets;
|5534|5534| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5617|5617| 
|5618|5618| UnitAI.prototype.SetHeldPosition = function(x, z)
|5619|5619| {
|5620|    |-	this.heldPosition = {"x": x, "z": z};
|    |5620|+	this.heldPosition = { "x": x, "z": z};
|5621|5621| };
|5622|5622| 
|5623|5623| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5617|5617| 
|5618|5618| UnitAI.prototype.SetHeldPosition = function(x, z)
|5619|5619| {
|5620|    |-	this.heldPosition = {"x": x, "z": z};
|    |5620|+	this.heldPosition = {"x": x, "z": z };
|5621|5621| };
|5622|5622| 
|5623|5623| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5644|5644| 	return false;
|5645|5645| };
|5646|5646| 
|5647|    |-//// Helper functions ////
|    |5647|+// // Helper functions ////
|5648|5648| 
|5649|5649| UnitAI.prototype.CanAttack = function(target)
|5650|5650| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5848|5848| 	return (cmpPack && cmpPack.IsPacking());
|5849|5849| };
|5850|5850| 
|5851|    |-//// Formation specific functions ////
|    |5851|+// // Formation specific functions ////
|5852|5852| 
|5853|5853| UnitAI.prototype.IsAttackingAsFormation = function()
|5854|5854| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5853|5853| UnitAI.prototype.IsAttackingAsFormation = function()
|5854|5854| {
|5855|5855| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5856|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5857|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5856|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5857|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5858|5858| };
|5859|5859| 
|5860|5860| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5857|5857| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5858|5858| };
|5859|5859| 
|5860|    |-//// Animal specific functions ////
|    |5860|+// // Animal specific functions ////
|5861|5861| 
|5862|5862| UnitAI.prototype.MoveRandomly = function(distance)
|5863|5863| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2410| »   »   »   »   »   »   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
|3781| »   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
|4573| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4588| »   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
|4634| »   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
|4657| »   »   ····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
|5123| »   var·lastPos·=·undefined;
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'lastPos' to undefined.

binaries/data/mods/public/simulation/components/UnitAI.js
| 353| »   »   ····&&·(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
|1888| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2020| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|2104| »   »   »   »   »   »   »   »   ·&&·((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
|2105| »   »   »   »   »   »   »   »   ·||·(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
|2106| »   »   »   »   »   »   »   »   ·&&·(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
|2129| »   »   »   »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(oldType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|2169| »   »   »   »   »   »   »   »   &&·((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
|2170| »   »   »   »   »   »   »   »   ||·(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
|2171| »   »   »   »   »   »   »   »   &&·(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
|2215| »   »   »   »   »   »   »   ||·(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
|2216| »   »   »   »   »   »   »   &&·(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
|2232| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2424| »   »   »   »   »   »   »   ||·(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
|2425| »   »   »   »   »   »   »   &&·(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
|2445| »   »   »   »   »   var·nearby·=·this.FindNearestDropsite(resourceType.generic);
|    | [NORMAL] JSHintBear:
|    | 'nearby' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4084| »   let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4366| »   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
|4422| »   »   »   &&·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
|4590| »   »   &&·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
|4591| »   »   &&·(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
|5123| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5488| »   »   »   »   &&·!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
|5491| »   »   »   »   &&·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
|5566| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5575| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [MAJOR] JSHintBear:
|    | Too many errors. (93% scanned).

Link to build: https://jenkins.wildfiregames.com/job/differential/28/display/redirect

temple added inline comments.Feb 23 2018, 1:38 AM
binaries/data/mods/public/simulation/templates/template_structure_economic_farmstead.xml
57 ↗(On Diff #5806)

add alerts

binaries/data/mods/public/simulation/templates/template_structure_economic_storehouse.xml
66 ↗(On Diff #5806)

add alerts

This revision was automatically updated to reflect the committed changes.
temple marked 2 inline comments as done.