Page MenuHomeWildfire Games

Enable garrisoning on gates / fix movement of units with visible garrison points
ClosedPublic

Authored by wraitii on Mar 27 2018, 2:43 AM.

Details

Reviewers
temple
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP23710: Enable garrisoning on gates / fix movement of units with visible garrison points
Trac Tickets
#2679
#5151
Summary

This addresses two related issues:

  • Units visibly garrisoned on gates keep the gate open.
  • Units visibly garrisoned on entities keep their pathfinding blocker flags.

The second is fixed by switching gates to look for "block movement" flag, instead of block-construction, and by removing the "block-movement" flag of visibly garrisoned entities.
This also fixes #5151 .

The first is fixed by changing some logic to consider the ability of units to move.
Add a "SetImmobile" function to UnitAI, to mark a unit as incapable of moving (though it theoretically could).
Change from IsTurret checks to use that function instead.
Packing logic is kept separate as it's trickier.

With this, gates can subscribe to those events and can choose to ignore units that can't move (since it makes no sense to open the gate for those), fixing the issue.

Attached is a small replay of some cases that wouldn't work properly on SVN.

Test Plan

Review code.

Event Timeline

temple created this revision.Mar 27 2018, 2:43 AM
temple edited the summary of this revision. (Show Details)
Stan added a comment.EditedMar 27 2018, 7:18 AM

Thanks so much for working on this.

Stan awarded a token.Mar 27 2018, 7:19 AM
temple added inline comments.May 1 2018, 5:32 PM
binaries/data/mods/public/simulation/components/Gate.js
69โ€“70
wraitii added a reviewer: Restricted Owners Package.May 14 2018, 11:53 AM
Imarok added a subscriber: Imarok.May 14 2018, 1:04 PM
Imarok added inline comments.
binaries/data/mods/public/simulation/components/Gate.js
69โ€“70

There is a ticket now: #5151

wraitii requested changes to this revision.May 14 2018, 1:37 PM
wraitii added a subscriber: wraitii.

Nice bug.

My input:

  • This happens because we don't move visible-garrisoned units out of the world. This makes sense if these are somewhat independent, for example in the case of autonomous drones and so on.
  • It should probably be a GarrisonHolder property whether garrisoning removes your "collision" or not.

Thus the correct way to fix this, imo, is to add a parameter to GarrisonHolder (and other components that have the same behaviour), instead of changing Gate. We may want buildings where visible garrison points are obstructions.

On the precise mechanism, calling the pathfinder seems reasonable enough.

This revision now requires changes to proceed.May 14 2018, 1:37 PM
wraitii added inline comments.May 14 2018, 1:52 PM
binaries/data/mods/public/simulation/components/Gate.js
171

This seems unrelated?

Read this better, there's two things here. On the "remove obstruction" part, see above.

These units should indeed not be counted towards opening the gate. I think however your current method won't work: say we have two garrisoned gates very close to each other, I think they'll get counted. The distinctive criteria here is that garrisoned units cannot move, they're static. I'm not entirely sure that's easily transatable in code though, maybe we need to add a "CutMyLegsOff" to CmpUnitMotion like we have "moveOutOfWorld" for CmpPosition.

binaries/data/mods/public/simulation/components/Gate.js
171

Ah right no I understand now.

wraitii commandeered this revision.Jul 13 2019, 7:40 PM
wraitii edited reviewers, added: temple; removed: wraitii.
wraitii updated this revision to Diff 8862.Jul 13 2019, 7:43 PM

More involved fix involving four things:

  • Gates open for units blocking movement, not construction (my opinion is that this overall makes more sense too).
  • Gates open only if units nearby 'can move', a new unitAI state
  • UnitAI keeps track of whether it can move or not. Packing moves the entity to Immobile, garrisoning too.
  • Garrison holders remove the obstruction of garrisoned entities (this is the incidental fix for #5151)

Also use the opportunity to use this "AbleToMove" function in UnitAI elsewhere.
Regarding my above comment - if we want buildings where visible obstruction points _are_ obstructions, we'll handle that then.

This correctly handles the case of two gates close to each other with visible garrison units inside each of them, unlike the previous patch.

wraitii updated the Trac tickets for this revision.Jul 13 2019, 7:44 PM

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

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

Nescio added a subscriber: Nescio.May 21 2020, 7:12 PM

@wraitii, this looks promising; any idea when it'll be finished? Being able to garrison units on gates without interfering with opening and closing would certainly be a great improvement.

wraitii updated this revision to Diff 11976.May 22 2020, 5:23 PM
wraitii retitled this revision from Enable garrisoning on gates to Enable garrisoning on gates / fix movement of units with visible garrison points.
wraitii edited the summary of this revision. (Show Details)
wraitii edited the test plan for this revision. (Show Details)

Rebase and slight rework.

See summary.

This patches only adds the ability to Iberia (cause I forgot to do it for the others), I'll do that before committing.

Owners added a subscriber: Restricted Owners Package.May 22 2020, 5:23 PM

Mh, the turret code is actually newer than my "AbleToMove" changes and technically it's useless right now, but I guess I'll leave it in since it could be useful to freeze a unit or something.

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

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

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1674/display/redirect

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

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

This patches only adds the ability to Iberia (cause I forgot to do it for the others), I'll do that before committing.

Perhaps it's better if you focus this patch on the necessary mechanics changes. The template changes can be done in a separate patch afterwards, also because gates can have different heights than wall segments.

Freagarach added inline comments.
binaries/data/mods/public/simulation/components/Gate.js
155

==?

273โ€“274

let

274โ€“275

(Object not needed.)

binaries/data/mods/public/simulation/components/UnitAI.js
4577โ€“4579

One could move it to before the type-check?

5368

+. (And above.)

Stan added inline comments.May 25 2020, 6:02 PM
binaries/data/mods/public/simulation/components/Gate.js
155

probably return this.allies.some(ent => this.ignoreList.indexOf(ent) === -1); would be nicer.

wraitii updated this revision to Diff 12026.May 26 2020, 12:43 PM
wraitii marked 3 inline comments as done.

Perhaps it's better if you focus this patch on the necessary mechanics changes.

Many thanks for D2760, I'll commit it alongside this.


Address comments.

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

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

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1712/display/redirect

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

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

Many thanks for D2760, I'll commit it alongside this.

Again, wouldn't it be better to do this patch without the simulation template changes, and afterwards commit D2760 separately? That would make it clearer which part is the issue if people raise concerns.
Also, when units on walls no longer interfere with gates, then another thing that will be possible is visible garrison slots on wall towers; do you also want a patch for that?

Many thanks for D2760, I'll commit it alongside this.

Also, when units on walls no longer interfere with gates, then another thing that will be possible is visible garrison slots on wall towers; do you also want a patch for that?

Sorry, I wasn't quite clear but I meant I would commit this in two commits, yes.
I'm OK with visible garrison slots on wall towers, yes.

binaries/data/mods/public/simulation/components/Gate.js
155

I don't really care for our "no ===" convention. It's faster.
I switched to a some indeed.

Sorry, I wasn't quite clear but I meant I would commit this in two commits, yes.
I'm OK with visible garrison slots on wall towers, yes.

Great! Here you go: D2769.

wraitii updated this revision to Diff 12045.May 29 2020, 7:13 PM

Fix tests & remove template changes that Nescio re-introduces in D2760.
Will commit once CI is reasonably green.

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1727/display/redirect

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

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

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

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

wraitii updated this revision to Diff 12052.May 30 2020, 7:48 AM

Fix my own test from yesterday's commit, failed to notice it because GitHub has some lag.

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

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpObstruction.h
|  29| classยทICmpObstructionยท:ยทpublicยทIComponent
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classICmpObstruction:' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/tests/test_ObstructionManager.h
|  23| classยทMockObstructionยท:ยทpublicยทICmpObstruction
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classMockObstruction:' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/ICmpObstruction.cpp
|   1| /*ยทCopyrightยท(C)ยท2018ยทWildfireยทGames.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2018"
Executing section JS...
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetInterval' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 118| 118| 
| 119| 119| 
| 120| 120| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 121|    |-		SetInterval: function() { },
|    | 121|+		"SetInterval": function() { },
| 122| 122| 		SetTimeout: function() { },
| 123| 123| 	});
| 124| 124| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetTimeout' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 119| 119| 
| 120| 120| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 121| 121| 		SetInterval: function() { },
| 122|    |-		SetTimeout: function() { },
|    | 122|+		"SetTimeout": function() { },
| 123| 123| 	});
| 124| 124| 
| 125| 125| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CreateActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 123| 123| 	});
| 124| 124| 
| 125| 125| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 126|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 126|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 127| 127| 			return 1;
| 128| 128| 		},
| 129| 129| 		EnableActiveQuery: function(id) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'EnableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 126| 126| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 127| 127| 			return 1;
| 128| 128| 		},
| 129|    |-		EnableActiveQuery: function(id) { },
|    | 129|+		"EnableActiveQuery": function(id) { },
| 130| 130| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 131| 131| 		DisableActiveQuery: function(id) { },
| 132| 132| 		GetEntityFlagMask: function(identifier) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'ResetActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 127| 127| 			return 1;
| 128| 128| 		},
| 129| 129| 		EnableActiveQuery: function(id) { },
| 130|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 130|+		"ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; },
| 131| 131| 		DisableActiveQuery: function(id) { },
| 132| 132| 		GetEntityFlagMask: function(identifier) { },
| 133| 133| 	});
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 127| 127| 			return 1;
| 128| 128| 		},
| 129| 129| 		EnableActiveQuery: function(id) { },
| 130|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 130|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
| 131| 131| 		DisableActiveQuery: function(id) { },
| 132| 132| 		GetEntityFlagMask: function(identifier) { },
| 133| 133| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'DisableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 128| 128| 		},
| 129| 129| 		EnableActiveQuery: function(id) { },
| 130| 130| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 131|    |-		DisableActiveQuery: function(id) { },
|    | 131|+		"DisableActiveQuery": function(id) { },
| 132| 132| 		GetEntityFlagMask: function(identifier) { },
| 133| 133| 	});
| 134| 134| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEntityFlagMask' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 129| 129| 		EnableActiveQuery: function(id) { },
| 130| 130| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 131| 131| 		DisableActiveQuery: function(id) { },
| 132|    |-		GetEntityFlagMask: function(identifier) { },
|    | 132|+		"GetEntityFlagMask": function(identifier) { },
| 133| 133| 	});
| 134| 134| 
| 135| 135| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetCurrentTemplateName' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 133| 133| 	});
| 134| 134| 
| 135| 135| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 136|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 136|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 137| 137| 	});
| 138| 138| 
| 139| 139| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPlayerByID' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 137| 137| 	});
| 138| 138| 
| 139| 139| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 140|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 140|+		"GetPlayerByID": function(id) { return playerEntity; },
| 141| 141| 		GetNumPlayers: function() { return 2; },
| 142| 142| 	});
| 143| 143| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetNumPlayers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 138| 138| 
| 139| 139| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 140| 140| 		GetPlayerByID: function(id) { return playerEntity; },
| 141|    |-		GetNumPlayers: function() { return 2; },
|    | 141|+		"GetNumPlayers": function() { return 2; },
| 142| 142| 	});
| 143| 143| 
| 144| 144| 	AddMock(playerEntity, IID_Player, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAlly' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 142| 142| 	});
| 143| 143| 
| 144| 144| 	AddMock(playerEntity, IID_Player, {
| 145|    |-		IsAlly: function() { return false; },
|    | 145|+		"IsAlly": function() { return false; },
| 146| 146| 		IsEnemy: function() { return true; },
| 147| 147| 		GetEnemies: function() { return [2]; },
| 148| 148| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsEnemy' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 143| 143| 
| 144| 144| 	AddMock(playerEntity, IID_Player, {
| 145| 145| 		IsAlly: function() { return false; },
| 146|    |-		IsEnemy: function() { return true; },
|    | 146|+		"IsEnemy": function() { return true; },
| 147| 147| 		GetEnemies: function() { return [2]; },
| 148| 148| 	});
| 149| 149| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEnemies' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 144| 144| 	AddMock(playerEntity, IID_Player, {
| 145| 145| 		IsAlly: function() { return false; },
| 146| 146| 		IsEnemy: function() { return true; },
| 147|    |-		GetEnemies: function() { return [2]; },
|    | 147|+		"GetEnemies": function() { return [2]; },
| 148| 148| 	});
| 149| 149| 
| 150| 150| 	AddMock(SYSTEM_ENTITY, IID_ObstructionManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetClassesList' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 154| 154| 	var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 155| 155| 
| 156| 156| 	AddMock(unit, IID_Identity, {
| 157|    |-		GetClassesList: function() { return []; },
|    | 157|+		"GetClassesList": function() { return []; },
| 158| 158| 	});
| 159| 159| 
| 160| 160| 	AddMock(unit, IID_Ownership, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetOwner' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 158| 158| 	});
| 159| 159| 
| 160| 160| 	AddMock(unit, IID_Ownership, {
| 161|    |-		GetOwner: function() { return 1; },
|    | 161|+		"GetOwner": function() { return 1; },
| 162| 162| 	});
| 163| 163| 
| 164| 164| 	AddMock(unit, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 162| 162| 	});
| 163| 163| 
| 164| 164| 	AddMock(unit, IID_Position, {
| 165|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 165|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 166| 166| 		GetPosition: function() { return new Vector3D(); },
| 167| 167| 		GetPosition2D: function() { return new Vector2D(); },
| 168| 168| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 163| 163| 
| 164| 164| 	AddMock(unit, IID_Position, {
| 165| 165| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 166|    |-		GetPosition: function() { return new Vector3D(); },
|    | 166|+		"GetPosition": function() { return new Vector3D(); },
| 167| 167| 		GetPosition2D: function() { return new Vector2D(); },
| 168| 168| 		GetRotation: function() { return { "y": 0 }; },
| 169| 169| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 164| 164| 	AddMock(unit, IID_Position, {
| 165| 165| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 166| 166| 		GetPosition: function() { return new Vector3D(); },
| 167|    |-		GetPosition2D: function() { return new Vector2D(); },
|    | 167|+		"GetPosition2D": function() { return new Vector2D(); },
| 168| 168| 		GetRotation: function() { return { "y": 0 }; },
| 169| 169| 		IsInWorld: function() { return true; },
| 170| 170| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 165| 165| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 166| 166| 		GetPosition: function() { return new Vector3D(); },
| 167| 167| 		GetPosition2D: function() { return new Vector2D(); },
| 168|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 168|+		"GetRotation": function() { return { "y": 0 }; },
| 169| 169| 		IsInWorld: function() { return true; },
| 170| 170| 	});
| 171| 171| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 166| 166| 		GetPosition: function() { return new Vector3D(); },
| 167| 167| 		GetPosition2D: function() { return new Vector2D(); },
| 168| 168| 		GetRotation: function() { return { "y": 0 }; },
| 169|    |-		IsInWorld: function() { return true; },
|    | 169|+		"IsInWorld": function() { return true; },
| 170| 170| 	});
| 171| 171| 
| 172| 172| 	AddMock(unit, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 179| 179| 	});
| 180| 180| 
| 181| 181| 	AddMock(unit, IID_Vision, {
| 182|    |-		GetRange: function() { return 10; },
|    | 182|+		"GetRange": function() { return 10; },
| 183| 183| 	});
| 184| 184| 
| 185| 185| 	AddMock(unit, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 183| 183| 	});
| 184| 184| 
| 185| 185| 	AddMock(unit, IID_Attack, {
| 186|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 186|+		"GetRange": function() { return { "max": 10, "min": 0}; },
| 187| 187| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 188| 188| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 189| 189| 		GetPreference: function(t) { return 0; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 183| 183| 	});
| 184| 184| 
| 185| 185| 	AddMock(unit, IID_Attack, {
| 186|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 186|+		GetRange: function() { return { "max": 10, "min": 0 }; },
| 187| 187| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 188| 188| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 189| 189| 		GetPreference: function(t) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetFullAttackRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 184| 184| 
| 185| 185| 	AddMock(unit, IID_Attack, {
| 186| 186| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 187|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 187|+		"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 188| 188| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 189| 189| 		GetPreference: function(t) { return 0; },
| 190| 190| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 184| 184| 
| 185| 185| 	AddMock(unit, IID_Attack, {
| 186| 186| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 187|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 187|+		GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 188| 188| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 189| 189| 		GetPreference: function(t) { return 0; },
| 190| 190| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetBestAttackAgainst' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 185| 185| 	AddMock(unit, IID_Attack, {
| 186| 186| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 187| 187| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 188|    |-		GetBestAttackAgainst: function(t) { return "melee"; },
|    | 188|+		"GetBestAttackAgainst": function(t) { return "melee"; },
| 189| 189| 		GetPreference: function(t) { return 0; },
| 190| 190| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 191| 191| 		CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 186| 186| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 187| 187| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 188| 188| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 189|    |-		GetPreference: function(t) { return 0; },
|    | 189|+		"GetPreference": function(t) { return 0; },
| 190| 190| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 191| 191| 		CanAttack: function(v) { return true; },
| 192| 192| 		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTimers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 187| 187| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 188| 188| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 189| 189| 		GetPreference: function(t) { return 0; },
| 190|    |-		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 190|+		"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 191| 191| 		CanAttack: function(v) { return true; },
| 192| 192| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 193| 193| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttack' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 188| 188| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 189| 189| 		GetPreference: function(t) { return 0; },
| 190| 190| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 191|    |-		CanAttack: function(v) { return true; },
|    | 191|+		"CanAttack": function(v) { return true; },
| 192| 192| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 193| 193| 	});
| 194| 194| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CompareEntitiesByPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 189| 189| 		GetPreference: function(t) { return 0; },
| 190| 190| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 191| 191| 		CanAttack: function(v) { return true; },
| 192|    |-		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 192|+		"CompareEntitiesByPreference": function(a, b) { return 0; },
| 193| 193| 	});
| 194| 194| 
| 195| 195| 	unitAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 200| 200| 	if (mode == 1)
| 201| 201| 	{
| 202| 202| 		AddMock(enemy, IID_Health, {
| 203|    |-			GetHitpoints: function() { return 10; },
|    | 203|+			"GetHitpoints": function() { return 10; },
| 204| 204| 		});
| 205| 205| 		AddMock(enemy, IID_UnitAI, {
| 206| 206| 			IsAnimal: function() { return false; }
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAnimal' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 203| 203| 			GetHitpoints: function() { return 10; },
| 204| 204| 		});
| 205| 205| 		AddMock(enemy, IID_UnitAI, {
| 206|    |-			IsAnimal: function() { return false; }
|    | 206|+			"IsAnimal": function() { return false; }
| 207| 207| 		});
| 208| 208| 	}
| 209| 209| 	else if (mode == 2)
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 208| 208| 	}
| 209| 209| 	else if (mode == 2)
| 210| 210| 		AddMock(enemy, IID_Health, {
| 211|    |-			GetHitpoints: function() { return 0; },
|    | 211|+			"GetHitpoints": function() { return 0; },
| 212| 212| 		});
| 213| 213| 
| 214| 214| 	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 211| 211| 			GetHitpoints: function() { return 0; },
| 212| 212| 		});
| 213| 213| 
| 214|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 214|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 215| 215| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 216| 216| 
| 217| 217| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 211| 211| 			GetHitpoints: function() { return 0; },
| 212| 212| 		});
| 213| 213| 
| 214|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 214|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 215| 215| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 216| 216| 
| 217| 217| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'JumpTo' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 215| 215| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 216| 216| 
| 217| 217| 	AddMock(controller, IID_Position, {
| 218|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 218|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 219| 219| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 220| 220| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 221| 221| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 216| 216| 
| 217| 217| 	AddMock(controller, IID_Position, {
| 218| 218| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 219|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 219|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 220| 220| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 221| 221| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 222| 222| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 217| 217| 	AddMock(controller, IID_Position, {
| 218| 218| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 219| 219| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 220|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 220|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 221| 221| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 222| 222| 		GetRotation: function() { return { "y": 0 }; },
| 223| 223| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 218| 218| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 219| 219| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 220| 220| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 221|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 221|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 222| 222| 		GetRotation: function() { return { "y": 0 }; },
| 223| 223| 		IsInWorld: function() { return true; },
| 224| 224| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 219| 219| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 220| 220| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 221| 221| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 222|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 222|+		"GetRotation": function() { return { "y": 0 }; },
| 223| 223| 		IsInWorld: function() { return true; },
| 224| 224| 	});
| 225| 225| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 220| 220| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 221| 221| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 222| 222| 		GetRotation: function() { return { "y": 0 }; },
| 223|    |-		IsInWorld: function() { return true; },
|    | 223|+		"IsInWorld": function() { return true; },
| 224| 224| 	});
| 225| 225| 
| 226| 226| 	AddMock(controller, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetInterval' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 271| 271| 	var unitAIs = [];
| 272| 272| 
| 273| 273| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 274|    |-		SetInterval: function() { },
|    | 274|+		"SetInterval": function() { },
| 275| 275| 		SetTimeout: function() { },
| 276| 276| 	});
| 277| 277| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'SetTimeout' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 272| 272| 
| 273| 273| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 274| 274| 		SetInterval: function() { },
| 275|    |-		SetTimeout: function() { },
|    | 275|+		"SetTimeout": function() { },
| 276| 276| 	});
| 277| 277| 
| 278| 278| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CreateActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 277| 277| 
| 278| 278| 
| 279| 279| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 280|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 280|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 281| 281| 			return 1;
| 282| 282| 		},
| 283| 283| 		EnableActiveQuery: function(id) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'EnableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 280| 280| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 281| 281| 			return 1;
| 282| 282| 		},
| 283|    |-		EnableActiveQuery: function(id) { },
|    | 283|+		"EnableActiveQuery": function(id) { },
| 284| 284| 		ResetActiveQuery: function(id) { return [enemy]; },
| 285| 285| 		DisableActiveQuery: function(id) { },
| 286| 286| 		GetEntityFlagMask: function(identifier) { },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'ResetActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 281| 281| 			return 1;
| 282| 282| 		},
| 283| 283| 		EnableActiveQuery: function(id) { },
| 284|    |-		ResetActiveQuery: function(id) { return [enemy]; },
|    | 284|+		"ResetActiveQuery": function(id) { return [enemy]; },
| 285| 285| 		DisableActiveQuery: function(id) { },
| 286| 286| 		GetEntityFlagMask: function(identifier) { },
| 287| 287| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'DisableActiveQuery' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 282| 282| 		},
| 283| 283| 		EnableActiveQuery: function(id) { },
| 284| 284| 		ResetActiveQuery: function(id) { return [enemy]; },
| 285|    |-		DisableActiveQuery: function(id) { },
|    | 285|+		"DisableActiveQuery": function(id) { },
| 286| 286| 		GetEntityFlagMask: function(identifier) { },
| 287| 287| 	});
| 288| 288| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEntityFlagMask' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 283| 283| 		EnableActiveQuery: function(id) { },
| 284| 284| 		ResetActiveQuery: function(id) { return [enemy]; },
| 285| 285| 		DisableActiveQuery: function(id) { },
| 286|    |-		GetEntityFlagMask: function(identifier) { },
|    | 286|+		"GetEntityFlagMask": function(identifier) { },
| 287| 287| 	});
| 288| 288| 
| 289| 289| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetCurrentTemplateName' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 287| 287| 	});
| 288| 288| 
| 289| 289| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 290|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 290|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 291| 291| 	});
| 292| 292| 
| 293| 293| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPlayerByID' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 291| 291| 	});
| 292| 292| 
| 293| 293| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 294|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 294|+		"GetPlayerByID": function(id) { return playerEntity; },
| 295| 295| 		GetNumPlayers: function() { return 2; },
| 296| 296| 	});
| 297| 297| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetNumPlayers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 292| 292| 
| 293| 293| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 294| 294| 		GetPlayerByID: function(id) { return playerEntity; },
| 295|    |-		GetNumPlayers: function() { return 2; },
|    | 295|+		"GetNumPlayers": function() { return 2; },
| 296| 296| 	});
| 297| 297| 
| 298| 298| 	AddMock(SYSTEM_ENTITY, IID_ObstructionManager, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsAlly' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 300| 300| 	});
| 301| 301| 
| 302| 302| 	AddMock(playerEntity, IID_Player, {
| 303|    |-		IsAlly: function() { return false; },
|    | 303|+		"IsAlly": function() { return false; },
| 304| 304| 		IsEnemy: function() { return true; },
| 305| 305| 		GetEnemies: function() { return [2]; },
| 306| 306| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsEnemy' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 301| 301| 
| 302| 302| 	AddMock(playerEntity, IID_Player, {
| 303| 303| 		IsAlly: function() { return false; },
| 304|    |-		IsEnemy: function() { return true; },
|    | 304|+		"IsEnemy": function() { return true; },
| 305| 305| 		GetEnemies: function() { return [2]; },
| 306| 306| 	});
| 307| 307| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetEnemies' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 302| 302| 	AddMock(playerEntity, IID_Player, {
| 303| 303| 		IsAlly: function() { return false; },
| 304| 304| 		IsEnemy: function() { return true; },
| 305|    |-		GetEnemies: function() { return [2]; },
|    | 305|+		"GetEnemies": function() { return [2]; },
| 306| 306| 	});
| 307| 307| 
| 308| 308| 	// create units
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetClassesList' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 313| 313| 		var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 314| 314| 
| 315| 315| 		AddMock(unit + i, IID_Identity, {
| 316|    |-			GetClassesList: function() { return []; },
|    | 316|+			"GetClassesList": function() { return []; },
| 317| 317| 		});
| 318| 318| 
| 319| 319| 		AddMock(unit + i, IID_Ownership, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetOwner' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 317| 317| 		});
| 318| 318| 
| 319| 319| 		AddMock(unit + i, IID_Ownership, {
| 320|    |-			GetOwner: function() { return 1; },
|    | 320|+			"GetOwner": function() { return 1; },
| 321| 321| 		});
| 322| 322| 
| 323| 323| 		AddMock(unit + i, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 321| 321| 		});
| 322| 322| 
| 323| 323| 		AddMock(unit + i, IID_Position, {
| 324|    |-			GetTurretParent: function() { return INVALID_ENTITY; },
|    | 324|+			"GetTurretParent": function() { return INVALID_ENTITY; },
| 325| 325| 			GetPosition: function() { return new Vector3D(); },
| 326| 326| 			GetPosition2D: function() { return new Vector2D(); },
| 327| 327| 			GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 322| 322| 
| 323| 323| 		AddMock(unit + i, IID_Position, {
| 324| 324| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 325|    |-			GetPosition: function() { return new Vector3D(); },
|    | 325|+			"GetPosition": function() { return new Vector3D(); },
| 326| 326| 			GetPosition2D: function() { return new Vector2D(); },
| 327| 327| 			GetRotation: function() { return { "y": 0 }; },
| 328| 328| 			IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 323| 323| 		AddMock(unit + i, IID_Position, {
| 324| 324| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 325| 325| 			GetPosition: function() { return new Vector3D(); },
| 326|    |-			GetPosition2D: function() { return new Vector2D(); },
|    | 326|+			"GetPosition2D": function() { return new Vector2D(); },
| 327| 327| 			GetRotation: function() { return { "y": 0 }; },
| 328| 328| 			IsInWorld: function() { return true; },
| 329| 329| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 324| 324| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 325| 325| 			GetPosition: function() { return new Vector3D(); },
| 326| 326| 			GetPosition2D: function() { return new Vector2D(); },
| 327|    |-			GetRotation: function() { return { "y": 0 }; },
|    | 327|+			"GetRotation": function() { return { "y": 0 }; },
| 328| 328| 			IsInWorld: function() { return true; },
| 329| 329| 		});
| 330| 330| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 325| 325| 			GetPosition: function() { return new Vector3D(); },
| 326| 326| 			GetPosition2D: function() { return new Vector2D(); },
| 327| 327| 			GetRotation: function() { return { "y": 0 }; },
| 328|    |-			IsInWorld: function() { return true; },
|    | 328|+			"IsInWorld": function() { return true; },
| 329| 329| 		});
| 330| 330| 
| 331| 331| 		AddMock(unit + i, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 338| 338| 		});
| 339| 339| 
| 340| 340| 		AddMock(unit + i, IID_Vision, {
| 341|    |-			GetRange: function() { return 10; },
|    | 341|+			"GetRange": function() { return 10; },
| 342| 342| 		});
| 343| 343| 
| 344| 344| 		AddMock(unit + i, IID_Attack, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 342| 342| 		});
| 343| 343| 
| 344| 344| 		AddMock(unit + i, IID_Attack, {
| 345|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 345|+			"GetRange": function() { return {"max":10, "min": 0}; },
| 346| 346| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 342| 342| 		});
| 343| 343| 
| 344| 344| 		AddMock(unit + i, IID_Attack, {
| 345|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 345|+			GetRange: function() { return { "max":10, "min": 0}; },
| 346| 346| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'max'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 342| 342| 		});
| 343| 343| 
| 344| 344| 		AddMock(unit + i, IID_Attack, {
| 345|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 345|+			GetRange: function() { return {"max": 10, "min": 0}; },
| 346| 346| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 342| 342| 		});
| 343| 343| 
| 344| 344| 		AddMock(unit + i, IID_Attack, {
| 345|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 345|+			GetRange: function() { return {"max":10, "min": 0 }; },
| 346| 346| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetFullAttackRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 343| 343| 
| 344| 344| 		AddMock(unit + i, IID_Attack, {
| 345| 345| 			GetRange: function() { return {"max":10, "min": 0}; },
| 346|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 346|+			"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 349| 349| 			CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 343| 343| 
| 344| 344| 		AddMock(unit + i, IID_Attack, {
| 345| 345| 			GetRange: function() { return {"max":10, "min": 0}; },
| 346|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 346|+			GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 349| 349| 			CanAttack: function(v) { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetBestAttackAgainst' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 344| 344| 		AddMock(unit + i, IID_Attack, {
| 345| 345| 			GetRange: function() { return {"max":10, "min": 0}; },
| 346| 346| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 347|    |-			GetBestAttackAgainst: function(t) { return "melee"; },
|    | 347|+			"GetBestAttackAgainst": function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 349| 349| 			CanAttack: function(v) { return true; },
| 350| 350| 			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTimers' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 345| 345| 			GetRange: function() { return {"max":10, "min": 0}; },
| 346| 346| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348|    |-			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 348|+			"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 349| 349| 			CanAttack: function(v) { return true; },
| 350| 350| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 351| 351| 		});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttack' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 346| 346| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 349|    |-			CanAttack: function(v) { return true; },
|    | 349|+			"CanAttack": function(v) { return true; },
| 350| 350| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 351| 351| 		});
| 352| 352| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CompareEntitiesByPreference' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 347| 347| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 348| 348| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 349| 349| 			CanAttack: function(v) { return true; },
| 350|    |-			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 350|+			"CompareEntitiesByPreference": function(a, b) { return 0; },
| 351| 351| 		});
| 352| 352| 
| 353| 353| 		unitAI.OnCreate();
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetHitpoints' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 359| 359| 
| 360| 360| 	// create enemy
| 361| 361| 	AddMock(enemy, IID_Health, {
| 362|    |-		GetHitpoints: function() { return 40; },
|    | 362|+		"GetHitpoints": function() { return 40; },
| 363| 363| 	});
| 364| 364| 
| 365| 365| 	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 362| 362| 		GetHitpoints: function() { return 40; },
| 363| 363| 	});
| 364| 364| 
| 365|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 365|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 366| 366| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 367| 367| 
| 368| 368| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 362| 362| 		GetHitpoints: function() { return 40; },
| 363| 363| 	});
| 364| 364| 
| 365|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 365|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 366| 366| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 367| 367| 
| 368| 368| 	AddMock(controller, IID_Position, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetTurretParent' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 366| 366| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 367| 367| 
| 368| 368| 	AddMock(controller, IID_Position, {
| 369|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 369|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 370| 370| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 371| 371| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 372| 372| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'JumpTo' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 367| 367| 
| 368| 368| 	AddMock(controller, IID_Position, {
| 369| 369| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 370|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 370|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 371| 371| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 372| 372| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 373| 373| 		GetRotation: function() { return { "y": 0 }; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 368| 368| 	AddMock(controller, IID_Position, {
| 369| 369| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 370| 370| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 371|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 371|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 372| 372| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 373| 373| 		GetRotation: function() { return { "y": 0 }; },
| 374| 374| 		IsInWorld: function() { return true; },
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetPosition2D' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 369| 369| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 370| 370| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 371| 371| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 372|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 372|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 373| 373| 		GetRotation: function() { return { "y": 0 }; },
| 374| 374| 		IsInWorld: function() { return true; },
| 375| 375| 	});
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRotation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 370| 370| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 371| 371| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 372| 372| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 373|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 373|+		"GetRotation": function() { return { "y": 0 }; },
| 374| 374| 		IsInWorld: function() { return true; },
| 375| 375| 	});
| 376| 376| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'IsInWorld' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 371| 371| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 372| 372| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 373| 373| 		GetRotation: function() { return { "y": 0 }; },
| 374|    |-		IsInWorld: function() { return true; },
|    | 374|+		"IsInWorld": function() { return true; },
| 375| 375| 	});
| 376| 376| 
| 377| 377| 	AddMock(controller, IID_UnitMotion, {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'GetRange' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 384| 384| 	});
| 385| 385| 
| 386| 386| 	AddMock(controller, IID_Attack, {
| 387|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 387|+		"GetRange": function() { return {"max":10, "min": 0}; },
| 388| 388| 		CanAttackAsFormation: function() { return false; },
| 389| 389| 	});
| 390| 390| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 384| 384| 	});
| 385| 385| 
| 386| 386| 	AddMock(controller, IID_Attack, {
| 387|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 387|+		GetRange: function() { return { "max":10, "min": 0}; },
| 388| 388| 		CanAttackAsFormation: function() { return false; },
| 389| 389| 	});
| 390| 390| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'max'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 384| 384| 	});
| 385| 385| 
| 386| 386| 	AddMock(controller, IID_Attack, {
| 387|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 387|+		GetRange: function() { return {"max": 10, "min": 0}; },
| 388| 388| 		CanAttackAsFormation: function() { return false; },
| 389| 389| 	});
| 390| 390| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 384| 384| 	});
| 385| 385| 
| 386| 386| 	AddMock(controller, IID_Attack, {
| 387|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 387|+		GetRange: function() { return {"max":10, "min": 0 }; },
| 388| 388| 		CanAttackAsFormation: function() { return false; },
| 389| 389| 	});
| 390| 390| 
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'CanAttackAsFormation' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 385| 385| 
| 386| 386| 	AddMock(controller, IID_Attack, {
| 387| 387| 		GetRange: function() { return {"max":10, "min": 0}; },
| 388|    |-		CanAttackAsFormation: function() { return false; },
|    | 388|+		"CanAttackAsFormation": function() { return false; },
| 389| 389| 	});
| 390| 390| 
| 391| 391| 	controllerAI.OnCreate();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 397| 397| 	for (var ent of unitAIs)
| 398| 398| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 399| 399| 
| 400|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 400|+	controllerAI.MoveIntoFormation({ "name": "Circle"});
| 401| 401| 
| 402| 402| 	// let all units be in position
| 403| 403| 	for (var ent of unitAIs)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 397| 397| 	for (var ent of unitAIs)
| 398| 398| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 399| 399| 
| 400|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 400|+	controllerAI.MoveIntoFormation({"name": "Circle" });
| 401| 401| 
| 402| 402| 	// let all units be in position
| 403| 403| 	for (var ent of unitAIs)

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 130| ยป   ยป   ResetActiveQuery:ยทfunction(id)ยท{ยทifยท(modeยท==ยท0)ยทreturnยท[];ยทelseยทreturnยท[enemy];ยท},
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Closing curly brace appears on the same line as the subsequent block.

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 309| ยป   forยท(varยทiยท=ยท0;ยทiยท<ยทunitCount;ยทi++)ยท{
|    | [NORMAL] ESLintBear (brace-rules/brace-on-same-line):
|    | Opening curly brace appears on the same line as controlling statement.

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

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

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

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 407| ยป   ยป   TS_ASSERT_EQUALS(unitAI.fsmStateName,ยท"INDIVIDUAL.COMBAT.ATTACKING");
|    | [NORMAL] JSHintBear:
|    | 'unitAI' used out of scope.
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 795| 795| 					this.FinishOrder();
| 796| 796| 					return;
| 797| 797| 				}
| 798|    |-				else
| 799|    |-				{
|    | 798|+				
| 800| 799| 					this.SetNextState("GARRISON.APPROACHING");
| 801| 800| 					return;
| 802|    |-				}
|    | 801|+				
| 803| 802| 			}
| 804| 803| 
| 805| 804| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1067|1067| 			},
|1068|1068| 		},
|1069|1069| 
|1070|    |-		"GARRISON":{
|    |1070|+		"GARRISON": {
|1071|1071| 			"APPROACHING": {
|1072|1072| 				"enter": function() {
|1073|1073| 					if (!this.MoveToGarrisonRange(this.order.data.target))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2047|2047| 
|2048|2048| 				"Attacked": function(msg) {
|2049|2049| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2050|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2051|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2050|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2051|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2052|2052| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2053|2053| 				},
|2054|2054| 			},
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2206|2206| 					"MovementUpdate": function(msg) {
|2207|2207| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2208|2208| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2209|    |-						if (msg.likelyFailure || 
|    |2209|+						if (msg.likelyFailure ||
|2210|2210| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2211|2211| 							!msg.obstructed && this.CheckRange(this.order.data))
|2212|2212| 							this.FinishOrder();
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2848|2848| 					{
|2849|2849| 						// The building was already finished/fully repaired before we arrived;
|2850|2850| 						// let the ConstructionFinished handler handle this.
|2851|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2851|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2852|2852| 						return true;
|2853|2853| 					}
|2854|2854| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2848|2848| 					{
|2849|2849| 						// The building was already finished/fully repaired before we arrived;
|2850|2850| 						// let the ConstructionFinished handler handle this.
|2851|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2851|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2852|2852| 						return true;
|2853|2853| 					}
|2854|2854| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3147|3147| 				this.StopTimer();
|3148|3148| 				this.ResetAnimation();
|3149|3149| 				if (this.formationAnimationVariant)
|3150|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3150|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3151|3151| 				else
|3152|3152| 					this.SetDefaultAnimationVariant();
|3153|3153| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3373|3373| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3374|3374| 
|3375|3375| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3376|    |-							// only used for domestic animals
|    |3376|+		// only used for domestic animals
|3377|3377| 
|3378|3378| 		// Reuse the same garrison behaviour for animals.
|3379|3379| 		"GARRISON": "INDIVIDUAL.GARRISON",
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3436|3436| 
|3437|3437| UnitAI.prototype.IsAnimal = function()
|3438|3438| {
|3439|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3439|+	return (!!this.template.NaturalBehaviour);
|3440|3440| };
|3441|3441| 
|3442|3442| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3576|3576| 		{
|3577|3577| 			let index = this.GetCurrentState().indexOf(".");
|3578|3578| 			if (index != -1)
|3579|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3579|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3580|3580| 			this.Stop(false);
|3581|3581| 		}
|3582|3582| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3632|3632| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3633|3633| 			continue;
|3634|3634| 		if (i == 0)
|3635|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3635|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3636|3636| 		else
|3637|3637| 			this.orderQueue.splice(i, 1);
|3638|3638| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3632|3632| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3633|3633| 			continue;
|3634|3634| 		if (i == 0)
|3635|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3635|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3636|3636| 		else
|3637|3637| 			this.orderQueue.splice(i, 1);
|3638|3638| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3719|3719| };
|3720|3720| 
|3721|3721| 
|3722|    |-//// FSM linkage functions ////
|    |3722|+// // FSM linkage functions ////
|3723|3723| 
|3724|3724| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3725|3725| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3890|3890| 				continue;
|3891|3891| 			if (this.orderQueue[i].type == type)
|3892|3892| 				continue;
|3893|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3893|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3894|3894| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3895|3895| 			return;
|3896|3896| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3890|3890| 				continue;
|3891|3891| 			if (this.orderQueue[i].type == type)
|3892|3892| 				continue;
|3893|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3893|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3894|3894| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3895|3895| 			return;
|3896|3896| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4131|4131| 	if (data.timerRepeat === undefined)
|4132|4132| 		this.timer = undefined;
|4133|4133| 
|4134|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4134|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4135|4135| };
|4136|4136| 
|4137|4137| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4131|4131| 	if (data.timerRepeat === undefined)
|4132|4132| 		this.timer = undefined;
|4133|4133| 
|4134|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4134|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4135|4135| };
|4136|4136| 
|4137|4137| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4176|4176| 	// TODO: This is a bit inefficient since every unit listens to every
|4177|4177| 	// construction message - ideally we could scope it to only the one we're building
|4178|4178| 
|4179|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4179|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4180|4180| };
|4181|4181| 
|4182|4182| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4176|4176| 	// TODO: This is a bit inefficient since every unit listens to every
|4177|4177| 	// construction message - ideally we could scope it to only the one we're building
|4178|4178| 
|4179|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4179|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4180|4180| };
|4181|4181| 
|4182|4182| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4215|4215| 	if (msg.fromStatusEffect)
|4216|4216| 		return;
|4217|4217| 
|4218|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4218|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4219|4219| };
|4220|4220| 
|4221|4221| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4215|4215| 	if (msg.fromStatusEffect)
|4216|4216| 		return;
|4217|4217| 
|4218|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4218|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4219|4219| };
|4220|4220| 
|4221|4221| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4220|4220| 
|4221|4221| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4222|4222| {
|4223|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4223|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4224|4224| };
|4225|4225| 
|4226|4226| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4220|4220| 
|4221|4221| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4222|4222| {
|4223|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4223|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4224|4224| };
|4225|4225| 
|4226|4226| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4225|4225| 
|4226|4226| UnitAI.prototype.OnHealthChanged = function(msg)
|4227|4227| {
|4228|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4228|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4229|4229| };
|4230|4230| 
|4231|4231| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4225|4225| 
|4226|4226| UnitAI.prototype.OnHealthChanged = function(msg)
|4227|4227| {
|4228|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4228|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4229|4229| };
|4230|4230| 
|4231|4231| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4231|4231| UnitAI.prototype.OnRangeUpdate = function(msg)
|4232|4232| {
|4233|4233| 	if (msg.tag == this.losRangeQuery)
|4234|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4234|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4235|4235| 	else if (msg.tag == this.losHealRangeQuery)
|4236|4236| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4237|4237| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4231|4231| UnitAI.prototype.OnRangeUpdate = function(msg)
|4232|4232| {
|4233|4233| 	if (msg.tag == this.losRangeQuery)
|4234|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4234|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4235|4235| 	else if (msg.tag == this.losHealRangeQuery)
|4236|4236| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4237|4237| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4233|4233| 	if (msg.tag == this.losRangeQuery)
|4234|4234| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4235|4235| 	else if (msg.tag == this.losHealRangeQuery)
|4236|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4236|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4237|4237| };
|4238|4238| 
|4239|4239| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4233|4233| 	if (msg.tag == this.losRangeQuery)
|4234|4234| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4235|4235| 	else if (msg.tag == this.losHealRangeQuery)
|4236|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4236|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4237|4237| };
|4238|4238| 
|4239|4239| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4238|4238| 
|4239|4239| UnitAI.prototype.OnPackFinished = function(msg)
|4240|4240| {
|4241|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4241|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4242|4242| };
|4243|4243| 
|4244|4244| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4238|4238| 
|4239|4239| UnitAI.prototype.OnPackFinished = function(msg)
|4240|4240| {
|4241|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4241|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4242|4242| };
|4243|4243| 
|4244|4244| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4241|4241| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4242|4242| };
|4243|4243| 
|4244|    |-//// Helper functions to be called by the FSM ////
|    |4244|+// // Helper functions to be called by the FSM ////
|4245|4245| 
|4246|4246| UnitAI.prototype.GetWalkSpeed = function()
|4247|4247| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4956|4956| UnitAI.prototype.AttackEntityInZone = function(ents)
|4957|4957| {
|4958|4958| 	var target = ents.find(target =>
|4959|    |-		this.CanAttack(target)
|4960|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4959|+		this.CanAttack(target) &&
|    |4960|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4961|4961| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4962|4962| 	);
|4963|4963| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4957|4957| {
|4958|4958| 	var target = ents.find(target =>
|4959|4959| 		this.CanAttack(target)
|4960|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4961|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4960|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4961|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4962|4962| 	);
|4963|4963| 	if (!target)
|4964|4964| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5023|5023| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|5024|5024| 	if (this.isGuardOf)
|5025|5025| 	{
|5026|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5026|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5027|5027| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5027|5027| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5028|5028| 		if (cmpUnitAI && cmpAttack &&
|5029|5029| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|5030|    |-				return false;
|    |5030|+			return false;
|5031|5031| 	}
|5032|5032| 
|5033|5033| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5065|5065| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5066|5066| 	if (this.isGuardOf)
|5067|5067| 	{
|5068|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5068|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5069|5069| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5070|5070| 		if (cmpUnitAI && cmpAttack &&
|5071|5071| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5078|5078| 	return false;
|5079|5079| };
|5080|5080| 
|5081|    |-//// External interface functions ////
|    |5081|+// // External interface functions ////
|5082|5082| 
|5083|5083| UnitAI.prototype.SetFormationController = function(ent)
|5084|5084| {
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5234|5234| 	{
|5235|5235| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5236|5236| 			return;
|5237|    |-		else
|5238|    |-			this.RemoveGuard();
|    |5237|+		this.RemoveGuard();
|5239|5238| 	}
|5240|5239| 
|5241|5240| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5568|5568| 
|5569|5569| 	if (this.IsFormationController())
|5570|5570| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5571|    |-}
|    |5571|+};
|5572|5572| /**
|5573|5573|  * Adds trade order to the queue. Either walk to the first market, or
|5574|5574|  * start a new route. Not forced, so it can be interrupted by attacks.
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5589|5589| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5590|5590| 	{
|5591|5591| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5592|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5592|+		if (cmpTrader.HasBothMarkets() &&
|5593|5593| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5594|5594| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5595|5595| 		{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5870|5870| 				{
|5871|5871| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5872|5872| 					var targetClasses = this.order.data.targetClasses;
|5873|    |-					if (targetClasses.attack && cmpIdentity
|5874|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5873|+					if (targetClasses.attack && cmpIdentity &&
|    |5874|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5875|5875| 						continue;
|5876|5876| 					if (targetClasses.avoid && cmpIdentity
|5877|5877| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5873|5873| 					if (targetClasses.attack && cmpIdentity
|5874|5874| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5875|5875| 						continue;
|5876|    |-					if (targetClasses.avoid && cmpIdentity
|5877|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5876|+					if (targetClasses.avoid && cmpIdentity &&
|    |5877|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5878|5878| 						continue;
|5879|5879| 					// Only used by the AIs to prevent some choices of targets
|5880|5880| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5896|5896| 		{
|5897|5897| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5898|5898| 			var targetClasses = this.order.data.targetClasses;
|5899|    |-			if (cmpIdentity && targetClasses.attack
|5900|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5899|+			if (cmpIdentity && targetClasses.attack &&
|    |5900|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5901|5901| 				continue;
|5902|5902| 			if (cmpIdentity && targetClasses.avoid
|5903|5903| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5899|5899| 			if (cmpIdentity && targetClasses.attack
|5900|5900| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5901|5901| 				continue;
|5902|    |-			if (cmpIdentity && targetClasses.avoid
|5903|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5902|+			if (cmpIdentity && targetClasses.avoid &&
|    |5903|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5904|5904| 				continue;
|5905|5905| 			// Only used by the AIs to prevent some choices of targets
|5906|5906| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6059|6059| 
|6060|6060| UnitAI.prototype.SetHeldPosition = function(x, z)
|6061|6061| {
|6062|    |-	this.heldPosition = {"x": x, "z": z};
|    |6062|+	this.heldPosition = { "x": x, "z": z};
|6063|6063| };
|6064|6064| 
|6065|6065| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6059|6059| 
|6060|6060| UnitAI.prototype.SetHeldPosition = function(x, z)
|6061|6061| {
|6062|    |-	this.heldPosition = {"x": x, "z": z};
|    |6062|+	this.heldPosition = {"x": x, "z": z };
|6063|6063| };
|6064|6064| 
|6065|6065| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6086|6086| 	return false;
|6087|6087| };
|6088|6088| 
|6089|    |-//// Helper functions ////
|    |6089|+// // Helper functions ////
|6090|6090| 
|6091|6091| /**
|6092|6092|  * General getter for ranges.
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6105|6105| 		return undefined;
|6106|6106| 
|6107|6107| 	return component.GetRange(type);
|6108|    |-}
|    |6108|+};
|6109|6109| 
|6110|6110| UnitAI.prototype.CanAttack = function(target)
|6111|6111| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6273|6273| 	return cmpPack && cmpPack.IsPacking();
|6274|6274| };
|6275|6275| 
|6276|    |-//// Formation specific functions ////
|    |6276|+// // Formation specific functions ////
|6277|6277| 
|6278|6278| UnitAI.prototype.IsAttackingAsFormation = function()
|6279|6279| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6278|6278| UnitAI.prototype.IsAttackingAsFormation = function()
|6279|6279| {
|6280|6280| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6281|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6282|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6281|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6282|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6283|6283| };
|6284|6284| 
|6285|6285| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|6282|6282| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6283|6283| };
|6284|6284| 
|6285|    |-//// Animal specific functions ////
|    |6285|+// // Animal specific functions ////
|6286|6286| 
|6287|6287| UnitAI.prototype.MoveRandomly = function(distance)
|6288|6288| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4036| ยป   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
|4943| ยป   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
|4958| ยป   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
|5006| ยป   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
|5029| ยป   ยป   ยทยทยทยท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
|2051| ยป   ยป   ยป   ยป   ยป   ยป   &&ยท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
|3150| ยป   ยป   ยป   ยป   ยป   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4960| ยป   ยป   &&ยท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
|4961| ยป   ยป   &&ยท(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
|5571| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|5874| ยป   ยป   ยป   ยป   ยป   ยป   &&ยท!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
|5877| ยป   ยป   ยป   ยป   ยป   ยป   &&ยท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
|5890| ยป   varยทtargetsยท=ยทthis.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5891| ยป   forยท(varยทtargยทofยทtargets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5898| ยป   ยป   ยป   varยทtargetClassesยท=ยทthis.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5900| ยป   ยป   ยป   ยป   &&ยท!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
|5903| ยป   ยป   ยป   ยป   &&ยท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
|6108| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|6282| ยป   ยป   &&ยทthis.GetCurrentState()ยท==ยท"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

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

This revision was not accepted when it landed; it landed in state Needs Review.May 30 2020, 11:18 AM
This revision was automatically updated to reflect the committed changes.
wraitii added a subscriber: Itms.May 31 2020, 7:08 PM

@Itms It seems we can now set up 're-openable diffs' which would be rather convenient here, see https://stackoverflow.com/questions/13633031/how-to-reopen-differential-review-in-phabricator