Page MenuHomeWildfire Games

Fix Soundgroups not playing sounds
ClosedPublic

Authored by Stan on Jan 26 2018, 12:18 AM.

Details

Reviewers
elexis
vladislavbelov
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP21359: Fix units not being able to play sounds when walking and running
Summary

Since rP9055 or so units do not make sounds anymore when walking, and so do horses.
This due to two factors, one the code in UnitAI and in VisualActor not doing his job, and two because actors do not specify event

I'm not sure but I think this will allow buildings to make ambient sounds. Since we can now set the idle tag to play sounds if the building have an idle animation it would probably play it (and since it use the same things than anims it will only be locally) refs https://trac.wildfiregames.com/ticket/1962

TODO :

Adapt sounds so they are not as loud
Adapt sounds so they fit units movement (for now they lag a bit behind)
Decide whether it's a good improvement and should be added or not. If not, we can just fix the code, and remove the walk tags in the template_unit_* files.

Test Plan

Test that I did not break anything (C++ is still new to me)
Test that pikemen and horses now make sounds.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 5189
Build 8868: Vulcan BuildJenkins

Unit TestsFailed

TimeTest
0 msJenkins > cxxtest_debug.xml::Unknown Unit Message ("")
Failed to read test report file /mnt/data/jenkins-phabricator/workspace/differential/cxxtest_debug.xml org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog. at org.dom4j.io.SAXReader.read(SAXReader.java:482)
0 msJenkins > TestAllocators::Unknown Unit Message ("")
0 msJenkins > TestAtlasObjectXML::Unknown Unit Message ("")
0 msJenkins > TestAtlasObjectXML::Unknown Unit Message ("")
0 msJenkins > TestAtlasObjectXML::Unknown Unit Message ("")
View Full Test Results (1 Failed · 309 Passed)

Event Timeline

Stan created this revision.Jan 26 2018, 12:18 AM
Imarok added a subscriber: Imarok.Jan 26 2018, 12:32 AM

Diff created from the wrong rootfolder

Stan updated this revision to Diff 5501.Jan 26 2018, 12:37 AM

Sorry, always forget and this time it's even worse than having ps/trunk cause it did it at the root.

Stan updated this revision to Diff 5515.EditedJan 27 2018, 1:13 PM

Fix a dumb mistake that broke animations.

If someone know why gain seems to be ignored when multiple units are doing the same action I'm interested

Same if someone knows what

event=""
load=""
sound=""

do that'd be great.

Tweaked audio file :

Itms added a subscriber: Itms.Jan 27 2018, 2:41 PM
Itms added inline comments.
binaries/data/mods/public/simulation/components/UnitAI.js
4319

You could add default values so that the calls to SelectAnimation are still correct after removing lines 4344->4350.

source/simulation2/components/CCmpVisualActor.cpp
444

replace the two lines above by wstring_from_utf8(m_AnimName) directly in the call to GetSoundGroup below ?

source/simulation2/components/ICmpSound.cpp
25

extra empty line

source/simulation2/components/ICmpSound.h
28

Copy-paste failure! ?

33

Can't remember, don't we have a way to mark scripted methods as const? (We might not)

source/soundmanager/scripting/SoundGroup.cpp
164

There are spaces here as well.

182

And one here

Stan updated this revision to Diff 5519.Jan 27 2018, 3:58 PM

Fix the wstring cast make the interface const, and fix some whitespaces, bump the modified files year and fix comment remove useless variables
cleanup unitai use default params, remove params for calls with default values.
Add default values for c++ as well
Also, remove a call to select animation which is already called on update which already chooses between walk and run so it's redundant.

Vulcan added a subscriber: Vulcan.Jan 27 2018, 4:03 PM

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

 Exception 
[cURL/7] (https://code.wildfiregames.com/api/differential.querydiffs) <CURLE_COULDNT_CONNECT> The cURL library raised an error while making a request. You may be able to find more information about this error (error code: 7) on the cURL site: http://curl.haxx.se/libcurl/c/libcurl-errors.html#CURLECOULDNTCONNECT
(Run with `--trace` for a full exception trace.)
Executing section Default...
Executing section Source...

source/tools/atlas/GameInterface/ActorViewer.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: ''.

source/tools/atlas/GameInterface/ActorViewer.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: 'MESSAGES_SKIP_STRUCTS'.

source/tools/atlas/GameInterface/ActorViewer.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: '_MSC_VER'.
Executing section JS...

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
|  48| »   let·pos·=·new·Vector2D(4,·5);
|    | [NORMAL] JSHintBear:
|    | 'pos' was used before it was defined.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 122| »   let·cmpFoundation·=·ConstructComponent(foundationEnt,·"Foundation",·{});
|    | [NORMAL] JSHintBear:
|    | 'cmpFoundation' was used before it was defined.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 198| »   "HasConstructionPreview":·()·=>·true,
|    | [MAJOR] JSHintBear:
|    | Expected '}' to match '{' from line 192 and instead saw 'HasConstructionPreview'.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 198| »   "HasConstructionPreview":·()·=>·true,
|    | [MAJOR] JSHintBear:
|    | Expected ']' to match '[' from line 192 and instead saw ':'.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 198| »   "HasConstructionPreview":·()·=>·true,
|    | [NORMAL] JSHintBear:
|    | Expected '(' and instead saw 'true'.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 198| »   "HasConstructionPreview":·()·=>·true,
|    | [MAJOR] JSHintBear:
|    | Expected an identifier and instead saw ','.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 199| }]);
|    | [MAJOR] JSHintBear:
|    | Expected an identifier and instead saw ';'.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 201| testFoundation([newEnt,·IID_TerritoryDecay,·{
|    | [NORMAL] JSHintBear:
|    | Expected ')' and instead saw 'testFoundation'.

binaries/data/mods/public/simulation/components/Foundation.js
| 212| »   »   »   »   »   »   &&·(cmpOwnership.GetOwner()·==·0·||·cmpFoundationOwnership·&&·cmpOwnership.GetOwner()·==·cmpFoundationOwnership.GetOwner()))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/Foundation.js
| 253| »   »   »   var·cmpFoundationOwnership·=·Engine.QueryInterface(this.entity,·IID_Ownership);
|    | [NORMAL] JSHintBear:
|    | 'cmpFoundationOwnership' is already defined.

binaries/data/mods/public/simulation/components/Foundation.js
| 327| »   »   var·pos·=·cmpPosition.GetPosition2D();
|    | [NORMAL] JSHintBear:
|    | 'pos' is already defined.

binaries/data/mods/public/simulation/components/Foundation.js
| 329| »   »   var·rot·=·cmpPosition.GetRotation();
|    | [NORMAL] JSHintBear:
|    | 'rot' is already defined.

binaries/data/mods/public/simulation/components/Health.js
| 117| »   »   ||·this.GetHitpoints()·<=·0
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/Health.js
| 118| »   »   ||·this.GetHitpoints()·>=·this.GetMaxHitpoints());
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/Health.js
| 171| »   var·cmpTimer·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_Timer);
|    | [NORMAL] JSHintBear:
|    | 'cmpTimer' is already defined.

binaries/data/mods/publi

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).............................................................................................................................................................................................................................ERROR: JavaScript error: simulation/components/tests/test_Foundation.js line 198
SyntaxError: missing } after property list
  

In TestComponentScripts::test_scripts:
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Test failed: L"Running script simulation/components/tests/test_Foundation.js"
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Assertion failed: scriptInterface.LoadScript(pathname, content)
.......................................................................................
Failed 1 and Skipped 0 of 309 tests
Success rate: 99%
Running debug tests...
Running cxxtest tests (309 tests).............................................................................................................................................................................................................................ERROR: JavaScript error: simulation/components/tests/test_Foundation.js line 198
SyntaxError: missing } after property list
  

In TestComponentScripts::test_scripts:
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Test failed: L"Running script simulation/components/tests/test_Foundation.js"
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Assertion failed: scriptInterface.LoadScript(pathname, content)
.......................................................................................
Failed 1 and Skipped 0 of 309 tests
Success rate: 99%
Checking XML files...
Relax-NG validity error : Extra element animations in interleave
/public/art/variants/biped/pikeman_base.xml:0: Relax-NG validity error : Element variant failed to validate content
Stan added a reviewer: Itms.Feb 4 2018, 7:39 PM
Stan removed a reviewer: Itms.Feb 18 2018, 5:09 PM
Stan added a reviewer: Restricted Owners Package.
vladislavbelov added a comment.EditedFeb 24 2018, 6:01 PM

I think about naming, because we can have other types of sounds together.

source/simulation2/components/ICmpSound.cpp
24

Why we don't have an alphabet order here and in few ICmp*-files?

36

Can it crash for any bad case?

source/simulation2/components/ICmpSound.h
26

Should be

the functions

?

32
GetSoundGroup(const std::wstring& soundName);
source/soundmanager/scripting/SoundGroup.cpp
180

Maybe nullptr here and in other places? :)

211

You like static_cast, no?

Stan updated this revision to Diff 5919.Feb 24 2018, 6:50 PM

Use static_cast
reorder includes
fix comment,
make parameter const
use nullptr

vladislavbelov accepted this revision.Feb 24 2018, 6:58 PM
This revision is now accepted and ready to land.Feb 24 2018, 6:58 PM
Stan marked 13 inline comments as done.Feb 24 2018, 7:14 PM
Stan added inline comments.
source/simulation2/components/ICmpSound.cpp
36

It's handled by the code below. The only case it would crash is if it returned nullptr, but I don't think it's possible, since it returns a std::wstring in everycase, been it empty. If the function doesn't exist it works as well.

Stan closed this revision.Feb 24 2018, 7:15 PM
Stan marked an inline comment as done.

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

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

source/tools/atlas/GameInterface/ActorViewer.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: ''.

source/tools/atlas/GameInterface/ActorViewer.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: 'MESSAGES_SKIP_STRUCTS'.

source/tools/atlas/GameInterface/ActorViewer.cpp
|  33| #include·"graphics/Terrain.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Invalid number of character ({) when these macros are defined: '_MSC_VER'.
Executing section JS...
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_Pack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_Pack.js
| 128| 128| TS_ASSERT_EQUALS(cmpPack.timer, 7);
| 129| 129| TS_ASSERT(timerActivated);
| 130| 130| 
| 131|    |-// Cancel 
|    | 131|+// Cancel
| 132| 132| cmpPack.CancelPack();
| 133| 133| 
| 134| 134| TS_ASSERT(!cmpPack.IsPacking());
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_Pack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_Pack.js
| 132| 132| cmpPack.CancelPack();
| 133| 133| 
| 134| 134| TS_ASSERT(!cmpPack.IsPacking());
| 135|    |-TS_ASSERT_EQUALS(cmpPack.GetElapsedTime(), 0)
|    | 135|+TS_ASSERT_EQUALS(cmpPack.GetElapsedTime(), 0);
| 136| 136| TS_ASSERT_EQUALS(cmpPack.GetProgress(), 0);
| 137| 137| TS_ASSERT_EQUALS(cmpPack.timer, undefined);
| 138| 138| TS_ASSERT(!timerActivated);

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  46| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/tests/test_Pack.js
| 135| TS_ASSERT_EQUALS(cmpPack.GetElapsedTime(),·0)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
|    | [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/Foundation.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Foundation.js
| 210| 210| 					// If obstructing fauna is gaia or our own but doesn't have UnitAI, just destroy it
| 211| 211| 					var cmpOwnership = Engine.QueryInterface(ent, IID_Ownership);
| 212| 212| 					var cmpIdentity = Engine.QueryInterface(ent, IID_Identity);
| 213|    |-					if (cmpOwnership && cmpIdentity && cmpIdentity.HasClass("Animal")
| 214|    |-						&& (cmpOwnership.GetOwner() == 0 || cmpFoundationOwnership && cmpOwnership.GetOwner() == cmpFoundationOwnership.GetOwner()))
|    | 213|+					if (cmpOwnership && cmpIdentity && cmpIdentity.HasClass("Animal") &&
|    | 214|+						(cmpOwnership.GetOwner() == 0 || cmpFoundationOwnership && cmpOwnership.GetOwner() == cmpFoundationOwnership.GetOwner()))
| 215| 215| 						Engine.DestroyEntity(ent);
| 216| 216| 				}
| 217| 217| 

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

binaries/data/mods/public/simulation/components/Foundation.js
| 214| »   »   »   »   »   »   &&·(cmpOwnership.GetOwner()·==·0·||·cmpFoundationOwnership·&&·cmpOwnership.GetOwner()·==·cmpFoundationOwnership.GetOwner()))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/Foundation.js
| 255| »   »   »   var·cmpFoundationOwnership·=·Engine.QueryInterface(this.entity,·IID_Ownership);
|    | [NORMAL] JSHintBear:
|    | 'cmpFoundationOwnership' is already defined.

binaries/data/mods/public/simulation/components/Foundation.js
| 329| »   »   var·pos·=·cmpPosition.GetPosition2D();
|    | [NORMAL] JSHintBear:
|    | 'pos' is already defined.

binaries/data/mods/public/simulation/components/Foundation.js
| 331| »   »   var·rot·=·cmpPosition.GetRotation();
|    | [NORMAL] JSHintBear:
|    | 'rot' is already defined.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 197| »   "HasConstructionPreview":·()·=>·true,
|    | [MAJOR] ESLintBear:
|    | Parsing error: Unexpected token "HasConstructionPreview"

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
|  47| »   let·pos·=·new·Vector2D(4,·5);
|    | [NORMAL] JSHintBear:
|    | 'pos' was used before it was defined.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 121| »   let·cmpFoundation·=·ConstructComponent(foundationEnt,·"Foundation",·{});
|    | [NORMAL] JSHintBear:
|    | 'cmpFoundation' was used before it was defined.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 197| »   "HasConstructionPreview":·()·=>·true,
|    | [MAJOR] JSHintBear:
|    | Expected '}' to match '{' from line 191 and instead saw 'HasConstructionPreview'.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 197| »   "HasConstructionPreview":·()·=>·true,
|    | [MAJOR] JSHintBear:
|    | Expected ']' to match '[' from line 191 and instead saw ':'.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 197| »   "HasConstructionPreview":·()·=>·true,
|    | [NORMAL] JSHintBear:
|    | Expected '(' and instead saw 'true'.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 197| »   "HasConstructionPreview":·()·=>·true,
|    | [MAJOR] JSHintBear:
|    | Expected an identifier and instead saw ','.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 198| }]);
|    | [MAJOR] JSHintBear:
|    | Expected an identifier and instead saw ';'.

binaries/data/mods/public/simulation/components/tests/test_Foundation.js
| 200| testFoundation([newEnt,·IID_TerritoryDecay,·{
|    | [NORMAL] JSHintBear:
|    | Expected ')' and instead saw 'testFoundation'.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|  64|  64| 	this.UpdateActor();
|  65|  65| };
|  66|  66| 
|  67|    |-//// Interface functions ////
|    |  67|+// // Interface functions ////
|  68|  68| 
|  69|  69| /**
|  70|  70|  * Returns the current hitpoint value.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|  96|  96| 
|  97|  97| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|  98|  98| 	if (cmpRangeManager)
|  99|    |-	{
|    |  99|+	
| 100| 100| 		if (this.hitpoints < this.GetMaxHitpoints())
| 101| 101| 			cmpRangeManager.SetEntityFlag(this.entity, "injured", true);
| 102| 102| 		else
| 103| 103| 			cmpRangeManager.SetEntityFlag(this.entity, "injured", false);
| 104|    |-	}
|    | 104|+	
| 105| 105| 
| 106| 106| 	this.RegisterHealthChanged(old);
| 107| 107| };
|    | [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/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
| 113| 113| 
| 114| 114| Health.prototype.IsUnhealable = function()
| 115| 115| {
| 116|    |-	return (this.template.Unhealable == "true"
| 117|    |-		|| this.GetHitpoints() <= 0
|    | 116|+	return (this.template.Unhealable == "true" ||
|    | 117|+		this.GetHitpoints() <= 0
| 118| 118| 		|| this.GetHitpoints() >= this.GetMaxHitpoints());
| 119| 119| };
| 120| 120| 
|    | [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/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
| 114| 114| Health.prototype.IsUnhealable = function()
| 115| 115| {
| 116| 116| 	return (this.template.Unhealable == "true"
| 117|    |-		|| this.GetHitpoints() <= 0
| 118|    |-		|| this.GetHitpoints() >= this.GetMaxHitpoints());
|    | 117|+		|| this.GetHitpoints() <= 0 ||
|    | 118|+		this.GetHitpoints() >= this.GetMaxHitpoints());
| 119| 119| };
| 120| 120| 
| 121| 121| Health.prototype.GetIdleRegenRate = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
| 258| 258| 		cmpFogging.Activate();
| 259| 259| 
| 260| 260| 	if (this.hitpoints == this.GetMaxHitpoints())
| 261|    |-		return {"old": this.hitpoints, "new":this.hitpoints};
|    | 261|+		return { "old": this.hitpoints, "new":this.hitpoints};
| 262| 262| 
| 263| 263| 	// If we're already dead, don't allow resurrection
| 264| 264| 	if (this.hitpoints == 0)
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'new'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
| 258| 258| 		cmpFogging.Activate();
| 259| 259| 
| 260| 260| 	if (this.hitpoints == this.GetMaxHitpoints())
| 261|    |-		return {"old": this.hitpoints, "new":this.hitpoints};
|    | 261|+		return {"old": this.hitpoints, "new": this.hitpoints};
| 262| 262| 
| 263| 263| 	// If we're already dead, don't allow resurrection
| 264| 264| 	if (this.hitpoints == 0)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
| 258| 258| 		cmpFogging.Activate();
| 259| 259| 
| 260| 260| 	if (this.hitpoints == this.GetMaxHitpoints())
| 261|    |-		return {"old": this.hitpoints, "new":this.hitpoints};
|    | 261|+		return {"old": this.hitpoints, "new":this.hitpoints };
| 262| 262| 
| 263| 263| 	// If we're already dead, don't allow resurrection
| 264| 264| 	if (this.hitpoints == 0)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
| 276| 276| 
| 277| 277| 	this.RegisterHealthChanged(old);
| 278| 278| 
| 279|    |-	return { "old": old, "new": this.hitpoints};
|    | 279|+	return { "old": old, "new": this.hitpoints };
| 280| 280| };
| 281| 281| 
| 282| 282| //// Private functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Health.js
| 279| 279| 	return { "old": old, "new": this.hitpoints};
| 280| 280| };
| 281| 281| 
| 282|    |-//// Private functions ////
|    | 282|+// // Private functions ////
| 283| 283| 
| 284| 284| Health.prototype.CreateCorpse = function(leaveResources)
| 285| 285| {

binaries/data/mods/public/simulation/components/Health.js
| 117| »   »   ||·this.GetHitpoints()·<=·0
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/Health.js
| 118| »   »   ||·this.GetHitpoints()·>=·this.GetMaxHitpoints());
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/Health.js
| 171| »   var·cmpTimer·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_Timer);
|    | [NORMAL] JSHintBear:
|    | 'cmpTimer' is already defined.

binaries/data/mods/public/simulation/components/Health.js
| 230| »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.
|    | [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
|1610|1610| 		},
|1611|1611| 
|1612|1612| 		"PATROL": {
|1613|    |-			"enter": function () {
|    |1613|+			"enter": function() {
|1614|1614| 				// Memorize the origin position in case that we want to go back
|1615|1615| 				let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|1616|1616| 				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
|1656|1656| 			},
|1657|1657| 
|1658|1658| 			"ESCORTING": {
|1659|    |-				"enter": function () {
|    |1659|+				"enter": function() {
|1660|1660| 					// Show weapons rather than carried resources.
|1661|1661| 					this.SetAnimationVariant("combat");
|1662|1662| 
|    | [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
|1706|1706| 			},
|1707|1707| 
|1708|1708| 			"GUARDING": {
|1709|    |-				"enter": function () {
|    |1709|+				"enter": function() {
|1710|1710| 					this.StartTimer(1000, 1000);
|1711|1711| 					this.SetHeldPositionOnEntity(this.entity);
|1712|1712| 					this.SetAnimationVariant("combat");
|    | [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
|1735|1735| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1736|1736| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1737|1737| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1738|    |-						{
|    |1738|+						
|1739|1739| 							if (this.CanHeal(this.isGuardOf))
|1740|1740| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1741|1741| 							else if (this.CanRepair(this.isGuardOf))
|1742|1742| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1743|    |-						}
|    |1743|+						
|1744|1744| 					}
|1745|1745| 				},
|1746|1746| 
|    | [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
|1793|1793| 			},
|1794|1794| 
|1795|1795| 			"APPROACHING": {
|1796|    |-				"enter": function () {
|    |1796|+				"enter": function() {
|1797|1797| 					// Show weapons rather than carried resources.
|1798|1798| 					this.SetAnimationVariant("combat");
|1799|1799| 
|    | [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
|1823|1823| 				"MoveCompleted": function() {
|1824|1824| 
|1825|1825| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1826|    |-					{
|    |1826|+					
|1827|1827| 						// If the unit needs to unpack, do so
|1828|1828| 						if (this.CanUnpack())
|1829|1829| 						{
|1832|1832| 						}
|1833|1833| 						else
|1834|1834| 							this.SetNextState("ATTACKING");
|1835|    |-					}
|    |1835|+					
|1836|1836| 					else
|1837|1837| 					{
|1838|1838| 						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
|1830|1830| 							this.PushOrderFront("Unpack", { "force": true });
|1831|1831| 							return;
|1832|1832| 						}
|1833|    |-						else
|1834|    |-							this.SetNextState("ATTACKING");
|    |1833|+						this.SetNextState("ATTACKING");
|1835|1834| 					}
|1836|1835| 					else
|1837|1836| 					{
|    | [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("ATTACKING");
|1835|1835| 					}
|1836|1836| 					else
|1837|    |-					{
|    |1837|+					
|1838|1838| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1839|1839| 						{
|1840|1840| 							this.SetNextState("APPROACHING");
|1844|1844| 							// Give up
|1845|1845| 							this.FinishOrder();
|1846|1846| 						}
|1847|    |-					}
|    |1847|+					
|1848|1848| 				},
|1849|1849| 			},
|1850|1850| 
|    | [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
|1836|1836| 					else
|1837|1837| 					{
|1838|1838| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1839|    |-						{
|    |1839|+						
|1840|1840| 							this.SetNextState("APPROACHING");
|1841|    |-						}
|    |1841|+						
|1842|1842| 						else
|1843|1843| 						{
|1844|1844| 							// 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
|1840|1840| 							this.SetNextState("APPROACHING");
|1841|1841| 						}
|1842|1842| 						else
|1843|    |-						{
|    |1843|+						
|1844|1844| 							// Give up
|1845|1845| 							this.FinishOrder();
|1846|    |-						}
|    |1846|+						
|1847|1847| 					}
|1848|1848| 				},
|1849|1849| 			},
|    | [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
|1861|1861| 					}
|1862|1862| 					// Check the target is still alive and attackable
|1863|1863| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1864|    |-					{
|    |1864|+					
|1865|1865| 						// Can't reach it - try to chase after it
|1866|1866| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1867|1867| 						{
|1871|1871| 								return;
|1872|1872| 							}
|1873|1873| 						}
|1874|    |-					}
|    |1874|+					
|1875|1875| 
|1876|1876| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1877|1877| 					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
|1864|1864| 					{
|1865|1865| 						// Can't reach it - try to chase after it
|1866|1866| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1867|    |-						{
|    |1867|+						
|1868|1868| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1869|1869| 							{
|1870|1870| 								this.SetNextState("COMBAT.CHASING");
|1871|1871| 								return;
|1872|1872| 							}
|1873|    |-						}
|    |1873|+						
|1874|1874| 					}
|1875|1875| 
|1876|1876| 					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
|1902|1902| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1903|1903| 
|1904|1904| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1905|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1905|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1906|1906| 
|1907|1907| 					this.FaceTowardsTarget(this.order.data.target);
|1908|1908| 
|    | [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
|1977|1977| 
|1978|1978| 						// Can't reach it - try to chase after it
|1979|1979| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1980|    |-						{
|    |1980|+						
|1981|1981| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1982|1982| 							{
|1983|1983| 								this.SetNextState("COMBAT.CHASING");
|1984|1984| 								return;
|1985|1985| 							}
|1986|    |-						}
|    |1986|+						
|1987|1987| 					}
|1988|1988| 
|1989|1989| 					// 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
|2024|2024| 
|2025|2025| 				"Attacked": function(msg) {
|2026|2026| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2027|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2028|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2027|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2028|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2029|2029| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2030|2030| 				},
|2031|2031| 			},
|    | [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
|2031|2031| 			},
|2032|2032| 
|2033|2033| 			"CHASING": {
|2034|    |-				"enter": function () {
|    |2034|+				"enter": function() {
|2035|2035| 					// Show weapons rather than carried resources.
|2036|2036| 					this.SetAnimationVariant("combat");
|2037|2037| 
|    | [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
|2106|2106| 
|2107|2107| 						// Try to find another nearby target of the same specific type
|2108|2108| 						// Also don't switch to a different type of huntable animal
|2109|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2109|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2110|2110| 							return (
|2111|2111| 								ent != oldTarget
|2112|2112| 								 && ((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
|2108|2108| 						// Also don't switch to a different type of huntable animal
|2109|2109| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2110|2110| 							return (
|2111|    |-								ent != oldTarget
|2112|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2111|+								ent != oldTarget &&
|    |2112|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2113|2113| 								 || (type.specific == oldType.specific
|2114|2114| 								 && (type.specific != "meat" || oldTemplate == template)))
|2115|2115| 							);
|    | [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
|2109|2109| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2110|2110| 							return (
|2111|2111| 								ent != oldTarget
|2112|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2113|    |-								 || (type.specific == oldType.specific
|    |2112|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2113|+								 (type.specific == oldType.specific
|2114|2114| 								 && (type.specific != "meat" || oldTemplate == template)))
|2115|2115| 							);
|2116|2116| 						}, 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
|2110|2110| 							return (
|2111|2111| 								ent != oldTarget
|2112|2112| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2113|    |-								 || (type.specific == oldType.specific
|2114|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2113|+								 || (type.specific == oldType.specific &&
|    |2114|+								 (type.specific != "meat" || oldTemplate == template)))
|2115|2115| 							);
|2116|2116| 						}, oldTarget);
|2117|2117| 						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
|2119|2119| 							this.PerformGather(nearby, false, false);
|2120|2120| 							return true;
|2121|2121| 						}
|2122|    |-						else
|2123|    |-						{
|    |2122|+						
|2124|2123| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2125|2124| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2126|2125| 							// to order it to GatherNear the resource position.
|2141|2140| 									return true;
|2142|2141| 								}
|2143|2142| 							}
|2144|    |-						}
|    |2143|+						
|2145|2144| 						return true;
|2146|2145| 					}
|2147|2146| 					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
|2131|2131| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2132|2132| 								return true;
|2133|2133| 							}
|2134|    |-							else
|2135|    |-							{
|    |2134|+							
|2136|2135| 								// we're kind of stuck here. Return resource.
|2137|2136| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2138|2137| 								if (nearby)
|2140|2139| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2141|2140| 									return true;
|2142|2141| 								}
|2143|    |-							}
|    |2142|+							
|2144|2143| 						}
|2145|2144| 						return true;
|2146|2145| 					}
|    | [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
|2171|2171| 
|2172|2172| 						// Try to find another nearby target of the same specific type
|2173|2173| 						// Also don't switch to a different type of huntable animal
|2174|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2174|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2175|2175| 							return (
|2176|2176| 								ent != oldTarget
|2177|2177| 								&& ((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
|2173|2173| 						// Also don't switch to a different type of huntable animal
|2174|2174| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2175|2175| 							return (
|2176|    |-								ent != oldTarget
|2177|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2176|+								ent != oldTarget &&
|    |2177|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2178|2178| 								|| (type.specific == oldType.specific
|2179|2179| 								&& (type.specific != "meat" || oldTemplate == template)))
|2180|2180| 							);
|    | [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
|2174|2174| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2175|2175| 							return (
|2176|2176| 								ent != oldTarget
|2177|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2178|    |-								|| (type.specific == oldType.specific
|    |2177|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2178|+								(type.specific == oldType.specific
|2179|2179| 								&& (type.specific != "meat" || oldTemplate == template)))
|2180|2180| 							);
|2181|2181| 						});
|    | [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
|2175|2175| 							return (
|2176|2176| 								ent != oldTarget
|2177|2177| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2178|    |-								|| (type.specific == oldType.specific
|2179|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2178|+								|| (type.specific == oldType.specific &&
|    |2179|+								(type.specific != "meat" || oldTemplate == template)))
|2180|2180| 							);
|2181|2181| 						});
|2182|2182| 						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
|2218|2218| 
|2219|2219| 					// Try to find another nearby target of the same specific type
|2220|2220| 					// Also don't switch to a different type of huntable animal
|2221|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2221|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2222|2222| 						return (
|2223|2223| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2224|2224| 							|| (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
|2220|2220| 					// Also don't switch to a different type of huntable animal
|2221|2221| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2222|2222| 						return (
|2223|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2224|    |-							|| (type.specific == resourceType.specific
|    |2223|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2224|+							(type.specific == resourceType.specific
|2225|2225| 							&& (type.specific != "meat" || resourceTemplate == template))
|2226|2226| 						);
|2227|2227| 					});
|    | [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
|2221|2221| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2222|2222| 						return (
|2223|2223| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2224|    |-							|| (type.specific == resourceType.specific
|2225|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2224|+							|| (type.specific == resourceType.specific &&
|    |2225|+							(type.specific != "meat" || resourceTemplate == template))
|2226|2226| 						);
|2227|2227| 					});
|2228|2228| 
|    | [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
|2337|2337| 
|2338|2338| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2339|2339| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2340|    |-					{
|    |2340|+					
|2341|2341| 						// Check we can still reach and gather from the target
|2342|2342| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2343|2343| 						{
|2403|2403| 								return;
|2404|2404| 							}
|2405|2405| 						}
|2406|    |-					}
|    |2406|+					
|2407|2407| 
|2408|2408| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2409|2409| 
|    | [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
|2427|2427| 
|2428|2428| 					// Try to find a new resource of the same specific type near our current position:
|2429|2429| 					// Also don't switch to a different type of huntable animal
|2430|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2430|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2431|2431| 						return (
|2432|2432| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2433|2433| 							|| (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
|2429|2429| 					// Also don't switch to a different type of huntable animal
|2430|2430| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2431|2431| 						return (
|2432|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2433|    |-							|| (type.specific == resourceType.specific
|    |2432|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2433|+							(type.specific == resourceType.specific
|2434|2434| 							&& (type.specific != "meat" || resourceTemplate == template))
|2435|2435| 						);
|2436|2436| 					});
|    | [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
|2430|2430| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2431|2431| 						return (
|2432|2432| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2433|    |-							|| (type.specific == resourceType.specific
|2434|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2433|+							|| (type.specific == resourceType.specific &&
|    |2434|+							(type.specific != "meat" || resourceTemplate == template))
|2435|2435| 						);
|2436|2436| 					});
|2437|2437| 					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
|2471|2471| 			},
|2472|2472| 
|2473|2473| 			"APPROACHING": {
|2474|    |-				"enter": function () {
|    |2474|+				"enter": function() {
|2475|2475| 					this.SelectAnimation("move");
|2476|2476| 					this.StartTimer(1000, 1000);
|2477|2477| 				},
|    | [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
|2517|2517| 					this.StartTimer(prepare, this.healTimers.repeat);
|2518|2518| 
|2519|2519| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2520|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2520|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2521|2521| 
|2522|2522| 					this.FaceTowardsTarget(this.order.data.target);
|2523|2523| 				},
|    | [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
|2550|2550| 						}
|2551|2551| 						// Can't reach it - try to chase after it
|2552|2552| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|2553|    |-						{
|    |2553|+						
|2554|2554| 							if (this.MoveToTargetRange(target, IID_Heal))
|2555|2555| 							{
|2556|2556| 								this.SetNextState("HEAL.CHASING");
|2557|2557| 								return;
|2558|2558| 							}
|2559|    |-						}
|    |2559|+						
|2560|2560| 					}
|2561|2561| 					// Can't reach it, healed to max hp or doesn't exist any more - give up
|2562|2562| 					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
|2572|2572| 				},
|2573|2573| 			},
|2574|2574| 			"CHASING": {
|2575|    |-				"enter": function () {
|    |2575|+				"enter": function() {
|2576|2576| 					this.SelectAnimation("move");
|2577|2577| 					this.StartTimer(1000, 1000);
|2578|2578| 				},
|    | [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
|2577|2577| 					this.StartTimer(1000, 1000);
|2578|2578| 				},
|2579|2579| 
|2580|    |-				"leave": function () {
|    |2580|+				"leave": function() {
|2581|2581| 					this.StopTimer();
|2582|2582| 				},
|2583|2583| 				"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
|2591|2591| 							this.WalkToHeldPosition();
|2592|2592| 					}
|2593|2593| 				},
|2594|    |-				"MoveCompleted": function () {
|    |2594|+				"MoveCompleted": function() {
|2595|2595| 					this.SetNextState("HEALING");
|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
|2600|2600| 		// Returning to dropsite
|2601|2601| 		"RETURNRESOURCE": {
|2602|2602| 			"APPROACHING": {
|2603|    |-				"enter": function () {
|    |2603|+				"enter": function() {
|2604|2604| 					this.SelectAnimation("move");
|2605|2605| 				},
|2606|2606| 
|    | [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
|2658|2658| 			},
|2659|2659| 
|2660|2660| 			"APPROACHINGMARKET": {
|2661|    |-				"enter": function () {
|    |2661|+				"enter": function() {
|2662|2662| 					this.SelectAnimation("move");
|2663|2663| 				},
|2664|2664| 
|    | [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
|2686|2686| 
|2687|2687| 		"REPAIR": {
|2688|2688| 			"APPROACHING": {
|2689|    |-				"enter": function () {
|    |2689|+				"enter": function() {
|2690|2690| 					this.SelectAnimation("move");
|2691|2691| 				},
|2692|2692| 
|    | [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
|2727|2727| 					{
|2728|2728| 						// The building was already finished/fully repaired before we arrived;
|2729|2729| 						// let the ConstructionFinished handler handle this.
|2730|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2730|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2731|2731| 						return true;
|2732|2732| 					}
|2733|2733| 
|    | [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
|2727|2727| 					{
|2728|2728| 						// The building was already finished/fully repaired before we arrived;
|2729|2729| 						// let the ConstructionFinished handler handle this.
|2730|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2730|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2731|2731| 						return true;
|2732|2732| 					}
|2733|2733| 
|    | [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
|2767|2767| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2768|2768| 						this.SetNextState("APPROACHING");
|2769|2769| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2770|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2770|+						this.FinishOrder(); // can't approach and isn't in reach
|2771|2771| 				},
|2772|2772| 			},
|2773|2773| 
|    | [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
|2834|2834| 					var types = cmpResourceDropsite.GetTypes();
|2835|2835| 					// TODO: Slightly undefined behavior here, we don't know what type of resource will be collected,
|2836|2836| 					//   may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that!
|2837|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2837|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2838|2838| 						return (types.indexOf(type.generic) != -1);
|2839|2839| 					}, msg.data.newentity);
|2840|2840| 					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
|2854|2854| 
|2855|2855| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2856|2856| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2857|    |-				{
|    |2857|+				
|2858|2858| 					// We're already walking to the given point, so add this as a order.
|2859|2859| 					this.WalkToTarget(msg.data.newentity, true);
|2860|    |-				}
|    |2860|+				
|2861|2861| 			},
|2862|2862| 		},
|2863|2863| 
|    | [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
|2904|2904| 
|2905|2905| 					// Check that we can garrison here
|2906|2906| 					if (this.CanGarrison(target))
|2907|    |-					{
|    |2907|+					
|2908|2908| 						// Check that we're in range of the garrison target
|2909|2909| 						if (this.CheckGarrisonRange(target))
|2910|2910| 						{
|2980|2980| 								return false;
|2981|2981| 							}
|2982|2982| 						}
|2983|    |-					}
|    |2983|+					
|2984|2984| 					// Garrisoning failed for some reason, so finish the order
|2985|2985| 					this.FinishOrder();
|2986|2986| 					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
|3097|3097| 		"Attacked": function(msg) {
|3098|3098| 			if (this.template.NaturalBehaviour == "skittish" ||
|3099|3099| 			    this.template.NaturalBehaviour == "passive")
|3100|    |-			{
|    |3100|+			
|3101|3101| 				this.Flee(msg.data.attacker, false);
|3102|    |-			}
|    |3102|+			
|3103|3103| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3104|3104| 			{
|3105|3105| 				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
|3106|3106| 					this.Attack(msg.data.attacker, false);
|3107|3107| 			}
|3108|3108| 			else if (this.template.NaturalBehaviour == "domestic")
|3109|    |-			{
|    |3109|+			
|3110|3110| 				// Never flee, stop what we were doing
|3111|3111| 				this.SetNextState("IDLE");
|3112|    |-			}
|    |3112|+			
|3113|3113| 		},
|3114|3114| 
|3115|3115| 		"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
|3116|3116| 			// Move a tile outside the building
|3117|3117| 			var range = 4;
|3118|3118| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3119|    |-			{
|    |3119|+			
|3120|3120| 				// We've started walking to the given point
|3121|3121| 				this.SetNextState("WALKING");
|3122|    |-			}
|    |3122|+			
|3123|3123| 			else
|3124|3124| 			{
|3125|3125| 				// 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
|3121|3121| 				this.SetNextState("WALKING");
|3122|3122| 			}
|3123|3123| 			else
|3124|    |-			{
|    |3124|+			
|3125|3125| 				// We are already at the target, or can't move at all
|3126|3126| 				this.FinishOrder();
|3127|    |-			}
|    |3127|+			
|3128|3128| 		},
|3129|3129| 
|3130|3130| 		"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
|3163|3163| 				}
|3164|3164| 				// Start attacking one of the newly-seen enemy (if any)
|3165|3165| 				else if (this.IsDangerousAnimal())
|3166|    |-				{
|    |3166|+				
|3167|3167| 					this.AttackVisibleEntity(msg.data.added);
|3168|    |-				}
|    |3168|+				
|3169|3169| 
|3170|3170| 				// TODO: if two units enter our range together, we'll attack the
|3171|3171| 				// 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
|3206|3206| 				}
|3207|3207| 				// Start attacking one of the newly-seen enemy (if any)
|3208|3208| 				else if (this.template.NaturalBehaviour == "violent")
|3209|    |-				{
|    |3209|+				
|3210|3210| 					this.AttackVisibleEntity(msg.data.added);
|3211|    |-				}
|    |3211|+				
|3212|3212| 			},
|3213|3213| 
|3214|3214| 			"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
|3223|3223| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3224|3224| 
|3225|3225| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3226|    |-							// only used for domestic animals
|    |3226|+		// only used for domestic animals
|3227|3227| 	},
|3228|3228| };
|3229|3229| 
|    | [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
|3280|3280| 
|3281|3281| UnitAI.prototype.IsAnimal = function()
|3282|3282| {
|3283|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3283|+	return (!!this.template.NaturalBehaviour);
|3284|3284| };
|3285|3285| 
|3286|3286| 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
|3318|3318| UnitAI.prototype.GetGarrisonHolder = function()
|3319|3319| {
|3320|3320| 	if (this.IsGarrisoned())
|3321|    |-	{
|    |3321|+	
|3322|3322| 		for (let order of this.orderQueue)
|3323|3323| 			if (order.type == "Garrison" || order.type == "Autogarrison")
|3324|3324| 				return order.data.target;
|3325|    |-	}
|    |3325|+	
|3326|3326| 	return INVALID_ENTITY;
|3327|3327| };
|3328|3328| 
|    | [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
|3399|3399| 		{
|3400|3400| 			let index = this.GetCurrentState().indexOf(".");
|3401|3401| 			if (index != -1)
|3402|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3402|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3403|3403| 			this.Stop(false);
|3404|3404| 		}
|3405|3405| 
|    | [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
|3455|3455| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3456|3456| 			continue;
|3457|3457| 		if (i == 0)
|3458|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3458|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3459|3459| 		else
|3460|3460| 			this.orderQueue.splice(i, 1);
|3461|3461| 		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
|3455|3455| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3456|3456| 			continue;
|3457|3457| 		if (i == 0)
|3458|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3458|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3459|3459| 		else
|3460|3460| 			this.orderQueue.splice(i, 1);
|3461|3461| 		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
|3539|3539| };
|3540|3540| 
|3541|3541| 
|3542|    |-//// FSM linkage functions ////
|    |3542|+// // FSM linkage functions ////
|3543|3543| 
|3544|3544| UnitAI.prototype.SetNextState = function(state)
|3545|3545| {
|    | [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
|3590|3590| 	if (this.orderQueue.length)
|3591|3591| 	{
|3592|3592| 		let ret = this.UnitFsm.ProcessMessage(this,
|3593|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3593|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3594|3594| 		);
|3595|3595| 
|3596|3596| 		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
|3590|3590| 	if (this.orderQueue.length)
|3591|3591| 	{
|3592|3592| 		let ret = this.UnitFsm.ProcessMessage(this,
|3593|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3593|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3594|3594| 		);
|3595|3595| 
|3596|3596| 		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
|3603|3603| 		// Otherwise we've successfully processed a new order
|3604|3604| 		return true;
|3605|3605| 	}
|3606|    |-	else
|3607|    |-	{
|    |3606|+	
|3608|3607| 		this.SetNextState("IDLE");
|3609|3608| 
|3610|3609| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3625|3624| 		}
|3626|3625| 
|3627|3626| 		return false;
|3628|    |-	}
|    |3627|+	
|3629|3628| };
|3630|3629| 
|3631|3630| /**
|    | [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
|3642|3642| 	{
|3643|3643| 		this.order = order;
|3644|3644| 		let ret = this.UnitFsm.ProcessMessage(this,
|3645|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3645|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3646|3646| 		);
|3647|3647| 
|3648|3648| 		// 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
|3642|3642| 	{
|3643|3643| 		this.order = order;
|3644|3644| 		let ret = this.UnitFsm.ProcessMessage(this,
|3645|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3645|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3646|3646| 		);
|3647|3647| 
|3648|3648| 		// 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
|3678|3678| 		this.orderQueue.unshift(order);
|3679|3679| 		this.order = order;
|3680|3680| 		let ret = this.UnitFsm.ProcessMessage(this,
|3681|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3681|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3682|3682| 		);
|3683|3683| 
|3684|3684| 		// 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
|3678|3678| 		this.orderQueue.unshift(order);
|3679|3679| 		this.order = order;
|3680|3680| 		let ret = this.UnitFsm.ProcessMessage(this,
|3681|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3681|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3682|3682| 		);
|3683|3683| 
|3684|3684| 		// 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
|3712|3712| 				continue;
|3713|3713| 			if (this.orderQueue[i].type == type)
|3714|3714| 				continue;
|3715|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3715|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3716|3716| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3717|3717| 			return;
|3718|3718| 		}
|    | [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
|3712|3712| 				continue;
|3713|3713| 			if (this.orderQueue[i].type == type)
|3714|3714| 				continue;
|3715|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3715|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3716|3716| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3717|3717| 			return;
|3718|3718| 		}
|    | [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
|3726|3726| {
|3727|3727| 	// Remember the previous work orders to be able to go back to them later if required
|3728|3728| 	if (data && data.force)
|3729|    |-	{
|    |3729|+	
|3730|3730| 		if (this.IsFormationController())
|3731|3731| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3732|3732| 		else
|3733|3733| 			this.UpdateWorkOrders(type);
|3734|    |-	}
|    |3734|+	
|3735|3735| 
|3736|3736| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3737|3737| 
|    | [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
|3803|3803| 	{
|3804|3804| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3805|3805| 		if (cmpUnitAI)
|3806|    |-		{
|    |3806|+		
|3807|3807| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3808|3808| 			{
|3809|3809| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3812|3812| 					return;
|3813|3813| 				}
|3814|3814| 			}
|3815|    |-		}
|    |3815|+		
|3816|3816| 	}
|3817|3817| 
|3818|3818| 	// 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
|3805|3805| 		if (cmpUnitAI)
|3806|3806| 		{
|3807|3807| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3808|    |-			{
|    |3808|+			
|3809|3809| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3810|3810| 				{
|3811|3811| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3812|3812| 					return;
|3813|3813| 				}
|3814|    |-			}
|    |3814|+			
|3815|3815| 		}
|3816|3816| 	}
|3817|3817| 
|    | [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
|3817|3817| 
|3818|3818| 	// If nothing found, take the unit orders
|3819|3819| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3820|    |-	{
|    |3820|+	
|3821|3821| 		if (isWorkType(this.orderQueue[i].type))
|3822|3822| 		{
|3823|3823| 			this.workOrders = this.orderQueue.slice(i);
|3824|3824| 			return;
|3825|3825| 		}
|3826|    |-	}
|    |3826|+	
|3827|3827| };
|3828|3828| 
|3829|3829| 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
|3883|3883| 	if (data.timerRepeat === undefined)
|3884|3884| 		this.timer = undefined;
|3885|3885| 
|3886|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3886|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3887|3887| };
|3888|3888| 
|3889|3889| /**
|    | [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
|3883|3883| 	if (data.timerRepeat === undefined)
|3884|3884| 		this.timer = undefined;
|3885|3885| 
|3886|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3886|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3887|3887| };
|3888|3888| 
|3889|3889| /**
|    | [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
|3918|3918| 	this.timer = undefined;
|3919|3919| };
|3920|3920| 
|3921|    |-//// Message handlers /////
|    |3921|+// // Message handlers /////
|3922|3922| 
|3923|3923| UnitAI.prototype.OnMotionChanged = function(msg)
|3924|3924| {
|    | [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
|3923|3923| UnitAI.prototype.OnMotionChanged = function(msg)
|3924|3924| {
|3925|3925| 	if (msg.starting && !msg.error)
|3926|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3926|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3927|3927| 	else if (!msg.starting || msg.error)
|3928|3928| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3929|3929| };
|    | [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
|3923|3923| UnitAI.prototype.OnMotionChanged = function(msg)
|3924|3924| {
|3925|3925| 	if (msg.starting && !msg.error)
|3926|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3926|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3927|3927| 	else if (!msg.starting || msg.error)
|3928|3928| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3929|3929| };
|    | [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
|3925|3925| 	if (msg.starting && !msg.error)
|3926|3926| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3927|3927| 	else if (!msg.starting || msg.error)
|3928|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3928|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3929|3929| };
|3930|3930| 
|3931|3931| 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
|3925|3925| 	if (msg.starting && !msg.error)
|3926|3926| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3927|3927| 	else if (!msg.starting || msg.error)
|3928|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3928|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3929|3929| };
|3930|3930| 
|3931|3931| 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
|3933|3933| 	// TODO: This is a bit inefficient since every unit listens to every
|3934|3934| 	// construction message - ideally we could scope it to only the one we're building
|3935|3935| 
|3936|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3936|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3937|3937| };
|3938|3938| 
|3939|3939| 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
|3933|3933| 	// TODO: This is a bit inefficient since every unit listens to every
|3934|3934| 	// construction message - ideally we could scope it to only the one we're building
|3935|3935| 
|3936|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3936|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3937|3937| };
|3938|3938| 
|3939|3939| 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
|3958|3958| 
|3959|3959| UnitAI.prototype.OnAttacked = function(msg)
|3960|3960| {
|3961|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3961|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3962|3962| };
|3963|3963| 
|3964|3964| 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
|3958|3958| 
|3959|3959| UnitAI.prototype.OnAttacked = function(msg)
|3960|3960| {
|3961|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3961|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3962|3962| };
|3963|3963| 
|3964|3964| 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
|3963|3963| 
|3964|3964| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3965|3965| {
|3966|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3966|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3967|3967| };
|3968|3968| 
|3969|3969| 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
|3963|3963| 
|3964|3964| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3965|3965| {
|3966|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3966|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3967|3967| };
|3968|3968| 
|3969|3969| 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
|3968|3968| 
|3969|3969| UnitAI.prototype.OnHealthChanged = function(msg)
|3970|3970| {
|3971|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3971|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3972|3972| };
|3973|3973| 
|3974|3974| 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
|3968|3968| 
|3969|3969| UnitAI.prototype.OnHealthChanged = function(msg)
|3970|3970| {
|3971|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3971|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3972|3972| };
|3973|3973| 
|3974|3974| 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
|3974|3974| UnitAI.prototype.OnRangeUpdate = function(msg)
|3975|3975| {
|3976|3976| 	if (msg.tag == this.losRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3978|3978| 	else if (msg.tag == this.losHealRangeQuery)
|3979|3979| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3980|3980| };
|    | [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| UnitAI.prototype.OnRangeUpdate = function(msg)
|3975|3975| {
|3976|3976| 	if (msg.tag == this.losRangeQuery)
|3977|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3977|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3978|3978| 	else if (msg.tag == this.losHealRangeQuery)
|3979|3979| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3980|3980| };
|    | [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
|3976|3976| 	if (msg.tag == this.losRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3978|3978| 	else if (msg.tag == this.losHealRangeQuery)
|3979|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3979|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3980|3980| };
|3981|3981| 
|3982|3982| 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
|3976|3976| 	if (msg.tag == this.losRangeQuery)
|3977|3977| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3978|3978| 	else if (msg.tag == this.losHealRangeQuery)
|3979|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3979|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3980|3980| };
|3981|3981| 
|3982|3982| 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
|3981|3981| 
|3982|3982| UnitAI.prototype.OnPackFinished = function(msg)
|3983|3983| {
|3984|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3984|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3985|3985| };
|3986|3986| 
|3987|3987| //// 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
|3981|3981| 
|3982|3982| UnitAI.prototype.OnPackFinished = function(msg)
|3983|3983| {
|3984|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3984|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3985|3985| };
|3986|3986| 
|3987|3987| //// 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
|3984|3984| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3985|3985| };
|3986|3986| 
|3987|    |-//// Helper functions to be called by the FSM ////
|    |3987|+// // Helper functions to be called by the FSM ////
|3988|3988| 
|3989|3989| UnitAI.prototype.GetWalkSpeed = function()
|3990|3990| {
|    | [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
|4088|4088| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4089|4089| 		return undefined;
|4090|4090| 
|4091|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4091|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4092|4092| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4093|4093| 		return undefined;
|4094|4094| 
|    | [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
|4173|4173| 			PlaySound(name, member);
|4174|4174| 	}
|4175|4175| 	else
|4176|    |-	{
|    |4176|+	
|4177|4177| 		// Otherwise use our own sounds
|4178|4178| 		PlaySound(name, this.entity);
|4179|    |-	}
|    |4179|+	
|4180|4180| };
|4181|4181| 
|4182|4182| /*
|    | [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
|4342|4342| 	else
|4343|4343| 		// return false? Or hope you come close enough?
|4344|4344| 		var parabolicMaxRange = 0;
|4345|    |-		//return false;
|    |4345|+		// return false;
|4346|4346| 
|4347|4347| 	// the parabole changes while walking, take something in the middle
|4348|4348| 	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
|4407|4407| 	if (this.IsFormationMember())
|4408|4408| 	{
|4409|4409| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4410|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4411|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4410|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4411|+			cmpFormationUnitAI.order.data.target == target)
|4412|4412| 			return true;
|4413|4413| 	}
|4414|4414| 
|    | [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
|4527|4527| 	var pos = cmpPosition.GetPosition();
|4528|4528| 	var heldPosition = this.heldPosition;
|4529|4529| 	if (heldPosition === undefined)
|4530|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4530|+		heldPosition = { "x": pos.x, "z": pos.z};
|4531|4531| 
|4532|4532| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4533|4533| };
|    | [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
|4527|4527| 	var pos = cmpPosition.GetPosition();
|4528|4528| 	var heldPosition = this.heldPosition;
|4529|4529| 	if (heldPosition === undefined)
|4530|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4530|+		heldPosition = {"x": pos.x, "z": pos.z };
|4531|4531| 
|4532|4532| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4533|4533| };
|    | [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
|4575|4575| UnitAI.prototype.AttackEntityInZone = function(ents)
|4576|4576| {
|4577|4577| 	var target = ents.find(target =>
|4578|    |-		this.CanAttack(target)
|4579|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4578|+		this.CanAttack(target) &&
|    |4579|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4580|4580| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4581|4581| 	);
|4582|4582| 	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
|4576|4576| {
|4577|4577| 	var target = ents.find(target =>
|4578|4578| 		this.CanAttack(target)
|4579|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4580|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4579|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4580|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4581|4581| 	);
|4582|4582| 	if (!target)
|4583|4583| 		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
|4640|4640| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4641|4641| 	if (this.isGuardOf)
|4642|4642| 	{
|4643|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4643|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4644|4644| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4645|4645| 		if (cmpUnitAI && cmpAttack &&
|4646|4646| 		    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
|4644|4644| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4645|4645| 		if (cmpUnitAI && cmpAttack &&
|4646|4646| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4647|    |-				return false;
|    |4647|+			return false;
|4648|4648| 	}
|4649|4649| 
|4650|4650| 	// 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
|4649|4649| 
|4650|4650| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4651|4651| 	if (this.GetStance().respondHoldGround)
|4652|    |-	{
|    |4652|+	
|4653|4653| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4654|4654| 			return true;
|4655|    |-	}
|    |4655|+	
|4656|4656| 
|4657|4657| 	// Stop if it's left our vision range, unless we're especially persistent
|4658|4658| 	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
|4656|4656| 
|4657|4657| 	// Stop if it's left our vision range, unless we're especially persistent
|4658|4658| 	if (!this.GetStance().respondChaseBeyondVision)
|4659|    |-	{
|    |4659|+	
|4660|4660| 		if (!this.CheckTargetIsInVisionRange(target))
|4661|4661| 			return true;
|4662|    |-	}
|    |4662|+	
|4663|4663| 
|4664|4664| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4665|4665| 	// 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
|4687|4687| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4688|4688| 	if (this.isGuardOf)
|4689|4689| 	{
|4690|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4690|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4691|4691| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4692|4692| 		if (cmpUnitAI && cmpAttack &&
|4693|4693| 		    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
|4700|4700| 	return false;
|4701|4701| };
|4702|4702| 
|4703|    |-//// External interface functions ////
|    |4703|+// // External interface functions ////
|4704|4704| 
|4705|4705| UnitAI.prototype.SetFormationController = function(ent)
|4706|4706| {
|    | [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
|4710|4710| 	// of our own formation (or ourself if not in formation)
|4711|4711| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4712|4712| 	if (cmpObstruction)
|4713|    |-	{
|    |4713|+	
|4714|4714| 		if (ent == INVALID_ENTITY)
|4715|4715| 			cmpObstruction.SetControlGroup(this.entity);
|4716|4716| 		else
|4717|4717| 			cmpObstruction.SetControlGroup(ent);
|4718|    |-	}
|    |4718|+	
|4719|4719| 
|4720|4720| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4721|4721| 	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
|4853|4853| 	// if we already had an old guard order, do nothing if the target is the same
|4854|4854| 	// and the order is running, otherwise remove the previous order
|4855|4855| 	if (this.isGuardOf)
|4856|    |-	{
|    |4856|+	
|4857|4857| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4858|4858| 			return;
|4859|4859| 		else
|4860|4860| 			this.RemoveGuard();
|4861|    |-	}
|    |4861|+	
|4862|4862| 
|4863|4863| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4864|4864| };
|    | [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
|4856|4856| 	{
|4857|4857| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4858|4858| 			return;
|4859|    |-		else
|4860|    |-			this.RemoveGuard();
|    |4859|+		this.RemoveGuard();
|4861|4860| 	}
|4862|4861| 
|4863|4862| 	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
|4898|4898| 		return;
|4899|4899| 
|4900|4900| 	if (this.order.type == "Guard")
|4901|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4901|+		this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"});
|4902|4902| 	else
|4903|4903| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4904|4904| 			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
|4898|4898| 		return;
|4899|4899| 
|4900|4900| 	if (this.order.type == "Guard")
|4901|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4901|+		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" });
|4902|4902| 	else
|4903|4903| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4904|4904| 			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
|5027|5027| 			this.WalkToTarget(target, queued);
|5028|5028| 		return;
|5029|5029| 	}
|5030|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |5030|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|5031|5031| };
|5032|5032| 
|5033|5033| /**
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /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
|5176|5176| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5177|5177| 	{
|5178|5178| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5179|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5179|+		if (cmpTrader.HasBothMarkets() &&
|5180|5180| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5181|5181| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5182|5182| 		{
|    | [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
|5457|5457| 				{
|5458|5458| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5459|5459| 					var targetClasses = this.order.data.targetClasses;
|5460|    |-					if (targetClasses.attack && cmpIdentity
|5461|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5460|+					if (targetClasses.attack && cmpIdentity &&
|    |5461|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5462|5462| 						continue;
|5463|5463| 					if (targetClasses.avoid && cmpIdentity
|5464|5464| 						&& 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
|5460|5460| 					if (targetClasses.attack && cmpIdentity
|5461|5461| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5462|5462| 						continue;
|5463|    |-					if (targetClasses.avoid && cmpIdentity
|5464|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5463|+					if (targetClasses.avoid && cmpIdentity &&
|    |5464|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5465|5465| 						continue;
|5466|5466| 					// Only used by the AIs to prevent some choices of targets
|5467|5467| 					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
|5483|5483| 		{
|5484|5484| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5485|5485| 			var targetClasses = this.order.data.targetClasses;
|5486|    |-			if (cmpIdentity && targetClasses.attack
|5487|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5486|+			if (cmpIdentity && targetClasses.attack &&
|    |5487|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5488|5488| 				continue;
|5489|5489| 			if (cmpIdentity && targetClasses.avoid
|5490|5490| 				&& 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
|5486|5486| 			if (cmpIdentity && targetClasses.attack
|5487|5487| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5488|5488| 				continue;
|5489|    |-			if (cmpIdentity && targetClasses.avoid
|5490|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5489|+			if (cmpIdentity && targetClasses.avoid &&
|    |5490|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5491|5491| 				continue;
|5492|5492| 			// Only used by the AIs to prevent some choices of targets
|5493|5493| 			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
|5526|5526| 
|5527|5527| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5528|5528| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5529|    |-	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|    |5529|+	var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5530|5530| 		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5531|5531| 
|5532|5532| 	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
|5527|5527| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5528|5528| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5529|5529| 	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5530|    |-		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|    |5530|+		.sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5531|5531| 
|5532|5532| 	return targets;
|5533|5533| };
|    | [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
|5616|5616| 
|5617|5617| UnitAI.prototype.SetHeldPosition = function(x, z)
|5618|5618| {
|5619|    |-	this.heldPosition = {"x": x, "z": z};
|    |5619|+	this.heldPosition = { "x": x, "z": z};
|5620|5620| };
|5621|5621| 
|5622|5622| 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
|5616|5616| 
|5617|5617| UnitAI.prototype.SetHeldPosition = function(x, z)
|5618|5618| {
|5619|    |-	this.heldPosition = {"x": x, "z": z};
|    |5619|+	this.heldPosition = {"x": x, "z": z };
|5620|5620| };
|5621|5621| 
|5622|5622| 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
|5643|5643| 	return false;
|5644|5644| };
|5645|5645| 
|5646|    |-//// Helper functions ////
|    |5646|+// // Helper functions ////
|5647|5647| 
|5648|5648| UnitAI.prototype.CanAttack = function(target)
|5649|5649| {
|    | [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
|5847|5847| 	return (cmpPack && cmpPack.IsPacking());
|5848|5848| };
|5849|5849| 
|5850|    |-//// Formation specific functions ////
|    |5850|+// // Formation specific functions ////
|5851|5851| 
|5852|5852| UnitAI.prototype.IsAttackingAsFormation = function()
|5853|5853| {
|    | [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
|5852|5852| UnitAI.prototype.IsAttackingAsFormation = function()
|5853|5853| {
|5854|5854| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5855|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5856|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5855|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5856|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5857|5857| };
|5858|5858| 
|5859|5859| //// 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
|5856|5856| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5857|5857| };
|5858|5858| 
|5859|    |-//// Animal specific functions ////
|    |5859|+// // Animal specific functions ////
|5860|5860| 
|5861|5861| UnitAI.prototype.MoveRandomly = function(distance)
|5862|5862| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2419| »   »   »   »   »   »   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
|3788| »   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
|4562| »   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
|4577| »   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
|4623| »   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
|4646| »   »   ····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
|5107| »   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
|1894| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4355| »   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
|4411| »   »   »   &&·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
|4579| »   »   &&·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
|4580| »   »   &&·(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
|5107| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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