Page MenuHomeWildfire Games

Trigger an exit-reentry when the target entity of an order is renamed
ClosedPublic

Authored by wraitii on May 16 2020, 3:06 PM.

Details

Summary

This fixes a class of bugs related to entity renaming (upgrade, promotion, construction, mirages).
It is essentially the same spirit as rP22023.

UnitAI properly update orders to use the new target, but the currently active FSM state was not running any check that the new target was valid (nor, in fact, handling anything specially). The simplest fix is to exit-reenter.
By processing a message, this can be overwritten easily should there be cases where we want to handle that explicitly.

This can be seen as a stronger variant of rP23449, fixing related issues in other cases.

UnitMotion is still not made aware of entity renaming, as the leave-enter makes it irrelevant in practice. It still may be a good idea to implement that someday.


With regards to information leak (a concern here because units might bet renaming information that they should not have):

  • Mirages are correct-by-design
  • States for which this is relevant should already react to a unit going in FoW. Indeed, combat states already do this.
  • The OG bug is that UnitMotion should fail to track a target that is no longer visible, but that is currently unimplemented. Relying on incorrect behaviour sounds broken, and I this does not change UnitAI states significantly from their current behaviour (units might stop where they would have carried on moving before in rare cases).

Chasing was fixed in rP23566.


Fixes the concern raised at rP20393. Fixes #5584.


As reported by Freagarach: https://code.wildfiregames.com/rP22526#38783
As reported by bb: https://code.wildfiregames.com/rP20393#33645

Other, unreported variants of this issue likely exist (I have not found any from a rapid search on Trac).

I have added a test case for bb's example, as well as 2 other cases. This is not exhaustive, but it validates that we are not doing anything too odd.

Test Plan

Agree with the implementation of the fix.

Event Timeline

wraitii created this revision.May 16 2020, 3:06 PM

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

Linter detected issues:
Executing section Source...
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
| 117| 117| 
| 118| 118| 
| 119| 119| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 120|    |-		SetInterval: function() { },
|    | 120|+		"SetInterval": function() { },
| 121| 121| 		SetTimeout: function() { },
| 122| 122| 	});
| 123| 123| 
|    | [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
| 118| 118| 
| 119| 119| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 120| 120| 		SetInterval: function() { },
| 121|    |-		SetTimeout: function() { },
|    | 121|+		"SetTimeout": function() { },
| 122| 122| 	});
| 123| 123| 
| 124| 124| 	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
| 122| 122| 	});
| 123| 123| 
| 124| 124| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 125|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 125|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		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
| 125| 125| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 126| 126| 			return 1;
| 127| 127| 		},
| 128|    |-		EnableActiveQuery: function(id) { },
|    | 128|+		"EnableActiveQuery": function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		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
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 129|+		"ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
|    | [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
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 129|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
|    | [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
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130|    |-		DisableActiveQuery: function(id) { },
|    | 130|+		"DisableActiveQuery": function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
| 133| 133| 
|    | [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
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131|    |-		GetEntityFlagMask: function(identifier) { },
|    | 131|+		"GetEntityFlagMask": function(identifier) { },
| 132| 132| 	});
| 133| 133| 
| 134| 134| 	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
| 132| 132| 	});
| 133| 133| 
| 134| 134| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 135|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 135|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 136| 136| 	});
| 137| 137| 
| 138| 138| 	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
| 136| 136| 	});
| 137| 137| 
| 138| 138| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 139|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 139|+		"GetPlayerByID": function(id) { return playerEntity; },
| 140| 140| 		GetNumPlayers: function() { return 2; },
| 141| 141| 	});
| 142| 142| 
|    | [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
| 137| 137| 
| 138| 138| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 139| 139| 		GetPlayerByID: function(id) { return playerEntity; },
| 140|    |-		GetNumPlayers: function() { return 2; },
|    | 140|+		"GetNumPlayers": function() { return 2; },
| 141| 141| 	});
| 142| 142| 
| 143| 143| 	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
| 141| 141| 	});
| 142| 142| 
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144|    |-		IsAlly: function() { return false; },
|    | 144|+		"IsAlly": function() { return false; },
| 145| 145| 		IsEnemy: function() { return true; },
| 146| 146| 		GetEnemies: function() { return [2]; },
| 147| 147| 	});
|    | [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
| 142| 142| 
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144| 144| 		IsAlly: function() { return false; },
| 145|    |-		IsEnemy: function() { return true; },
|    | 145|+		"IsEnemy": function() { return true; },
| 146| 146| 		GetEnemies: function() { return [2]; },
| 147| 147| 	});
| 148| 148| 
|    | [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
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144| 144| 		IsAlly: function() { return false; },
| 145| 145| 		IsEnemy: function() { return true; },
| 146|    |-		GetEnemies: function() { return [2]; },
|    | 146|+		"GetEnemies": function() { return [2]; },
| 147| 147| 	});
| 148| 148| 
| 149| 149| 	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
| 153| 153| 	var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 154| 154| 
| 155| 155| 	AddMock(unit, IID_Identity, {
| 156|    |-		GetClassesList: function() { return []; },
|    | 156|+		"GetClassesList": function() { return []; },
| 157| 157| 	});
| 158| 158| 
| 159| 159| 	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
| 157| 157| 	});
| 158| 158| 
| 159| 159| 	AddMock(unit, IID_Ownership, {
| 160|    |-		GetOwner: function() { return 1; },
|    | 160|+		"GetOwner": function() { return 1; },
| 161| 161| 	});
| 162| 162| 
| 163| 163| 	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
| 161| 161| 	});
| 162| 162| 
| 163| 163| 	AddMock(unit, IID_Position, {
| 164|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 164|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		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
| 162| 162| 
| 163| 163| 	AddMock(unit, IID_Position, {
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165|    |-		GetPosition: function() { return new Vector3D(); },
|    | 165|+		"GetPosition": function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168| 168| 		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
| 163| 163| 	AddMock(unit, IID_Position, {
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166|    |-		GetPosition2D: function() { return new Vector2D(); },
|    | 166|+		"GetPosition2D": function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168| 168| 		IsInWorld: function() { return true; },
| 169| 169| 	});
|    | [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
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 167|+		"GetRotation": function() { return { "y": 0 }; },
| 168| 168| 		IsInWorld: function() { return true; },
| 169| 169| 	});
| 170| 170| 
|    | [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
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168|    |-		IsInWorld: function() { return true; },
|    | 168|+		"IsInWorld": function() { return true; },
| 169| 169| 	});
| 170| 170| 
| 171| 171| 	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
| 178| 178| 	});
| 179| 179| 
| 180| 180| 	AddMock(unit, IID_Vision, {
| 181|    |-		GetRange: function() { return 10; },
|    | 181|+		"GetRange": function() { return 10; },
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	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
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 185|+		"GetRange": function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		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
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 185|+		GetRange: function() { return { "max": 10, "min": 0 }; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		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
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 186|+		"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		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
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 186|+		GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		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
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187|    |-		GetBestAttackAgainst: function(t) { return "melee"; },
|    | 187|+		"GetBestAttackAgainst": function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		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
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188|    |-		GetPreference: function(t) { return 0; },
|    | 188|+		"GetPreference": function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191| 191| 		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
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189|    |-		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 189|+		"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191| 191| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 192| 192| 	});
|    | [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
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190|    |-		CanAttack: function(v) { return true; },
|    | 190|+		"CanAttack": function(v) { return true; },
| 191| 191| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 192| 192| 	});
| 193| 193| 
|    | [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
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191|    |-		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 191|+		"CompareEntitiesByPreference": function(a, b) { return 0; },
| 192| 192| 	});
| 193| 193| 
| 194| 194| 	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
| 199| 199| 	if (mode == 1)
| 200| 200| 	{
| 201| 201| 		AddMock(enemy, IID_Health, {
| 202|    |-			GetHitpoints: function() { return 10; },
|    | 202|+			"GetHitpoints": function() { return 10; },
| 203| 203| 		});
| 204| 204| 		AddMock(enemy, IID_UnitAI, {
| 205| 205| 			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
| 202| 202| 			GetHitpoints: function() { return 10; },
| 203| 203| 		});
| 204| 204| 		AddMock(enemy, IID_UnitAI, {
| 205|    |-			IsAnimal: function() { return false; }
|    | 205|+			"IsAnimal": function() { return false; }
| 206| 206| 		});
| 207| 207| 	}
| 208| 208| 	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
| 207| 207| 	}
| 208| 208| 	else if (mode == 2)
| 209| 209| 		AddMock(enemy, IID_Health, {
| 210|    |-			GetHitpoints: function() { return 0; },
|    | 210|+			"GetHitpoints": function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213| 213| 	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
| 210| 210| 			GetHitpoints: function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 213|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	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
| 210| 210| 			GetHitpoints: function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 213|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	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
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	AddMock(controller, IID_Position, {
| 217|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 217|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		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
| 215| 215| 
| 216| 216| 	AddMock(controller, IID_Position, {
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 218|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		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
| 216| 216| 	AddMock(controller, IID_Position, {
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 219|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222| 222| 		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
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 220|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222| 222| 		IsInWorld: function() { return true; },
| 223| 223| 	});
|    | [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
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 221|+		"GetRotation": function() { return { "y": 0 }; },
| 222| 222| 		IsInWorld: function() { return true; },
| 223| 223| 	});
| 224| 224| 
|    | [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
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222|    |-		IsInWorld: function() { return true; },
|    | 222|+		"IsInWorld": function() { return true; },
| 223| 223| 	});
| 224| 224| 
| 225| 225| 	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
| 270| 270| 	var unitAIs = [];
| 271| 271| 
| 272| 272| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 273|    |-		SetInterval: function() { },
|    | 273|+		"SetInterval": function() { },
| 274| 274| 		SetTimeout: function() { },
| 275| 275| 	});
| 276| 276| 
|    | [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
| 271| 271| 
| 272| 272| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 273| 273| 		SetInterval: function() { },
| 274|    |-		SetTimeout: function() { },
|    | 274|+		"SetTimeout": function() { },
| 275| 275| 	});
| 276| 276| 
| 277| 277| 
|    | [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
| 276| 276| 
| 277| 277| 
| 278| 278| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 279|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 279|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 280| 280| 			return 1;
| 281| 281| 		},
| 282| 282| 		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
| 279| 279| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 280| 280| 			return 1;
| 281| 281| 		},
| 282|    |-		EnableActiveQuery: function(id) { },
|    | 282|+		"EnableActiveQuery": function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285| 285| 		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
| 280| 280| 			return 1;
| 281| 281| 		},
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283|    |-		ResetActiveQuery: function(id) { return [enemy]; },
|    | 283|+		"ResetActiveQuery": function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285| 285| 		GetEntityFlagMask: function(identifier) { },
| 286| 286| 	});
|    | [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
| 281| 281| 		},
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284|    |-		DisableActiveQuery: function(id) { },
|    | 284|+		"DisableActiveQuery": function(id) { },
| 285| 285| 		GetEntityFlagMask: function(identifier) { },
| 286| 286| 	});
| 287| 287| 
|    | [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
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285|    |-		GetEntityFlagMask: function(identifier) { },
|    | 285|+		"GetEntityFlagMask": function(identifier) { },
| 286| 286| 	});
| 287| 287| 
| 288| 288| 	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
| 286| 286| 	});
| 287| 287| 
| 288| 288| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 289|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 289|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 290| 290| 	});
| 291| 291| 
| 292| 292| 	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
| 290| 290| 	});
| 291| 291| 
| 292| 292| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 293|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 293|+		"GetPlayerByID": function(id) { return playerEntity; },
| 294| 294| 		GetNumPlayers: function() { return 2; },
| 295| 295| 	});
| 296| 296| 
|    | [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
| 291| 291| 
| 292| 292| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 293| 293| 		GetPlayerByID: function(id) { return playerEntity; },
| 294|    |-		GetNumPlayers: function() { return 2; },
|    | 294|+		"GetNumPlayers": function() { return 2; },
| 295| 295| 	});
| 296| 296| 
| 297| 297| 	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
| 299| 299| 	});
| 300| 300| 
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302|    |-		IsAlly: function() { return false; },
|    | 302|+		"IsAlly": function() { return false; },
| 303| 303| 		IsEnemy: function() { return true; },
| 304| 304| 		GetEnemies: function() { return [2]; },
| 305| 305| 	});
|    | [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
| 300| 300| 
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302| 302| 		IsAlly: function() { return false; },
| 303|    |-		IsEnemy: function() { return true; },
|    | 303|+		"IsEnemy": function() { return true; },
| 304| 304| 		GetEnemies: function() { return [2]; },
| 305| 305| 	});
| 306| 306| 
|    | [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
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302| 302| 		IsAlly: function() { return false; },
| 303| 303| 		IsEnemy: function() { return true; },
| 304|    |-		GetEnemies: function() { return [2]; },
|    | 304|+		"GetEnemies": function() { return [2]; },
| 305| 305| 	});
| 306| 306| 
| 307| 307| 	// 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
| 312| 312| 		var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 313| 313| 
| 314| 314| 		AddMock(unit + i, IID_Identity, {
| 315|    |-			GetClassesList: function() { return []; },
|    | 315|+			"GetClassesList": function() { return []; },
| 316| 316| 		});
| 317| 317| 
| 318| 318| 		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
| 316| 316| 		});
| 317| 317| 
| 318| 318| 		AddMock(unit + i, IID_Ownership, {
| 319|    |-			GetOwner: function() { return 1; },
|    | 319|+			"GetOwner": function() { return 1; },
| 320| 320| 		});
| 321| 321| 
| 322| 322| 		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
| 320| 320| 		});
| 321| 321| 
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323|    |-			GetTurretParent: function() { return INVALID_ENTITY; },
|    | 323|+			"GetTurretParent": function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			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
| 321| 321| 
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324|    |-			GetPosition: function() { return new Vector3D(); },
|    | 324|+			"GetPosition": function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327| 327| 			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
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325|    |-			GetPosition2D: function() { return new Vector2D(); },
|    | 325|+			"GetPosition2D": function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327| 327| 			IsInWorld: function() { return true; },
| 328| 328| 		});
|    | [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
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326|    |-			GetRotation: function() { return { "y": 0 }; },
|    | 326|+			"GetRotation": function() { return { "y": 0 }; },
| 327| 327| 			IsInWorld: function() { return true; },
| 328| 328| 		});
| 329| 329| 
|    | [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
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327|    |-			IsInWorld: function() { return true; },
|    | 327|+			"IsInWorld": function() { return true; },
| 328| 328| 		});
| 329| 329| 
| 330| 330| 		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
| 337| 337| 		});
| 338| 338| 
| 339| 339| 		AddMock(unit + i, IID_Vision, {
| 340|    |-			GetRange: function() { return 10; },
|    | 340|+			"GetRange": function() { return 10; },
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			"GetRange": function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return { "max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return {"max": 10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return {"max":10, "min": 0 }; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 345|+			"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			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
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 345|+			GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			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
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346|    |-			GetBestAttackAgainst: function(t) { return "melee"; },
|    | 346|+			"GetBestAttackAgainst": function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349| 349| 			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
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347|    |-			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 347|+			"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349| 349| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 350| 350| 		});
|    | [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
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348|    |-			CanAttack: function(v) { return true; },
|    | 348|+			"CanAttack": function(v) { return true; },
| 349| 349| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 350| 350| 		});
| 351| 351| 
|    | [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
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349|    |-			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 349|+			"CompareEntitiesByPreference": function(a, b) { return 0; },
| 350| 350| 		});
| 351| 351| 
| 352| 352| 		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
| 358| 358| 
| 359| 359| 	// create enemy
| 360| 360| 	AddMock(enemy, IID_Health, {
| 361|    |-		GetHitpoints: function() { return 40; },
|    | 361|+		"GetHitpoints": function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364| 364| 	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
| 361| 361| 		GetHitpoints: function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 364|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	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
| 361| 361| 		GetHitpoints: function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 364|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	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
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	AddMock(controller, IID_Position, {
| 368|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 368|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		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
| 366| 366| 
| 367| 367| 	AddMock(controller, IID_Position, {
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 369|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		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
| 367| 367| 	AddMock(controller, IID_Position, {
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 370|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373| 373| 		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
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 371|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373| 373| 		IsInWorld: function() { return true; },
| 374| 374| 	});
|    | [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
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 372|+		"GetRotation": function() { return { "y": 0 }; },
| 373| 373| 		IsInWorld: function() { return true; },
| 374| 374| 	});
| 375| 375| 
|    | [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
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373|    |-		IsInWorld: function() { return true; },
|    | 373|+		"IsInWorld": function() { return true; },
| 374| 374| 	});
| 375| 375| 
| 376| 376| 	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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		"GetRange": function() { return {"max":10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return { "max":10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return {"max": 10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return {"max":10, "min": 0 }; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386| 386| 		GetRange: function() { return {"max":10, "min": 0}; },
| 387|    |-		CanAttackAsFormation: function() { return false; },
|    | 387|+		"CanAttackAsFormation": function() { return false; },
| 388| 388| 	});
| 389| 389| 
| 390| 390| 	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
| 396| 396| 	for (var ent of unitAIs)
| 397| 397| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 398| 398| 
| 399|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 399|+	controllerAI.MoveIntoFormation({ "name": "Circle"});
| 400| 400| 
| 401| 401| 	// let all units be in position
| 402| 402| 	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
| 396| 396| 	for (var ent of unitAIs)
| 397| 397| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 398| 398| 
| 399|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 399|+	controllerAI.MoveIntoFormation({"name": "Circle" });
| 400| 400| 
| 401| 401| 	// let all units be in position
| 402| 402| 	for (var ent of unitAIs)

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 129| »   »   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
| 308| »   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
| 402| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

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

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 397| »   »   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
| 406| »   »   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
|2049|2049| 
|2050|2050| 				"Attacked": function(msg) {
|2051|2051| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2052|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2053|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2052|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2053|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2054|2054| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2055|2055| 				},
|2056|2056| 			},
|    | [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
|2208|2208| 					"MovementUpdate": function(msg) {
|2209|2209| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2210|2210| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2211|    |-						if (msg.likelyFailure || 
|    |2211|+						if (msg.likelyFailure ||
|2212|2212| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2213|2213| 							!msg.obstructed && this.CheckRange(this.order.data))
|2214|2214| 							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
|2850|2850| 					{
|2851|2851| 						// The building was already finished/fully repaired before we arrived;
|2852|2852| 						// let the ConstructionFinished handler handle this.
|2853|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2853|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2854|2854| 						return true;
|2855|2855| 					}
|2856|2856| 
|    | [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
|2850|2850| 					{
|2851|2851| 						// The building was already finished/fully repaired before we arrived;
|2852|2852| 						// let the ConstructionFinished handler handle this.
|2853|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2853|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2854|2854| 						return true;
|2855|2855| 					}
|2856|2856| 
|    | [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
|3148|3148| 				this.StopTimer();
|3149|3149| 				this.ResetAnimation();
|3150|3150| 				if (this.formationAnimationVariant)
|3151|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3151|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3152|3152| 				else
|3153|3153| 					this.SetDefaultAnimationVariant();
|3154|3154| 				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
|3374|3374| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3375|3375| 
|3376|3376| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3377|    |-							// only used for domestic animals
|    |3377|+		// only used for domestic animals
|3378|3378| 
|3379|3379| 		// Reuse the same garrison behaviour for animals.
|3380|3380| 		"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
|3552|3552| 		{
|3553|3553| 			let index = this.GetCurrentState().indexOf(".");
|3554|3554| 			if (index != -1)
|3555|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3555|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3556|3556| 			this.Stop(false);
|3557|3557| 		}
|3558|3558| 
|    | [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
|3608|3608| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3609|3609| 			continue;
|3610|3610| 		if (i == 0)
|3611|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3611|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3612|3612| 		else
|3613|3613| 			this.orderQueue.splice(i, 1);
|3614|3614| 		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
|3608|3608| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3609|3609| 			continue;
|3610|3610| 		if (i == 0)
|3611|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3611|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3612|3612| 		else
|3613|3613| 			this.orderQueue.splice(i, 1);
|3614|3614| 		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
|3695|3695| };
|3696|3696| 
|3697|3697| 
|3698|    |-//// FSM linkage functions ////
|    |3698|+// // FSM linkage functions ////
|3699|3699| 
|3700|3700| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3701|3701| 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
|3866|3866| 				continue;
|3867|3867| 			if (this.orderQueue[i].type == type)
|3868|3868| 				continue;
|3869|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3869|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3870|3870| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3871|3871| 			return;
|3872|3872| 		}
|    | [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
|3866|3866| 				continue;
|3867|3867| 			if (this.orderQueue[i].type == type)
|3868|3868| 				continue;
|3869|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3869|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3870|3870| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3871|3871| 			return;
|3872|3872| 		}
|    | [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
|4108|4108| 	if (data.timerRepeat === undefined)
|4109|4109| 		this.timer = undefined;
|4110|4110| 
|4111|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4111|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4112|4112| };
|4113|4113| 
|4114|4114| /**
|    | [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
|4108|4108| 	if (data.timerRepeat === undefined)
|4109|4109| 		this.timer = undefined;
|4110|4110| 
|4111|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4111|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4112|4112| };
|4113|4113| 
|4114|4114| /**
|    | [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
|4153|4153| 	// TODO: This is a bit inefficient since every unit listens to every
|4154|4154| 	// construction message - ideally we could scope it to only the one we're building
|4155|4155| 
|4156|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4156|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4157|4157| };
|4158|4158| 
|4159|4159| 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
|4153|4153| 	// TODO: This is a bit inefficient since every unit listens to every
|4154|4154| 	// construction message - ideally we could scope it to only the one we're building
|4155|4155| 
|4156|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4156|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4157|4157| };
|4158|4158| 
|4159|4159| 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
|4185|4185| 	if (msg.fromStatusEffect)
|4186|4186| 		return;
|4187|4187| 
|4188|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4188|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4189|4189| };
|4190|4190| 
|4191|4191| 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
|4185|4185| 	if (msg.fromStatusEffect)
|4186|4186| 		return;
|4187|4187| 
|4188|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4188|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4189|4189| };
|4190|4190| 
|4191|4191| 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
|4190|4190| 
|4191|4191| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4192|4192| {
|4193|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4193|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4194|4194| };
|4195|4195| 
|4196|4196| 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
|4190|4190| 
|4191|4191| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4192|4192| {
|4193|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4193|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4194|4194| };
|4195|4195| 
|4196|4196| 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
|4195|4195| 
|4196|4196| UnitAI.prototype.OnHealthChanged = function(msg)
|4197|4197| {
|4198|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4198|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4199|4199| };
|4200|4200| 
|4201|4201| 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
|4195|4195| 
|4196|4196| UnitAI.prototype.OnHealthChanged = function(msg)
|4197|4197| {
|4198|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4198|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4199|4199| };
|4200|4200| 
|4201|4201| 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
|4201|4201| UnitAI.prototype.OnRangeUpdate = function(msg)
|4202|4202| {
|4203|4203| 	if (msg.tag == this.losRangeQuery)
|4204|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4204|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4205|4205| 	else if (msg.tag == this.losHealRangeQuery)
|4206|4206| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4207|4207| };
|    | [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
|4201|4201| UnitAI.prototype.OnRangeUpdate = function(msg)
|4202|4202| {
|4203|4203| 	if (msg.tag == this.losRangeQuery)
|4204|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4204|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4205|4205| 	else if (msg.tag == this.losHealRangeQuery)
|4206|4206| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4207|4207| };
|    | [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
|4203|4203| 	if (msg.tag == this.losRangeQuery)
|4204|4204| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4205|4205| 	else if (msg.tag == this.losHealRangeQuery)
|4206|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4206|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4207|4207| };
|4208|4208| 
|4209|4209| 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
|4203|4203| 	if (msg.tag == this.losRangeQuery)
|4204|4204| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4205|4205| 	else if (msg.tag == this.losHealRangeQuery)
|4206|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4206|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4207|4207| };
|4208|4208| 
|4209|4209| 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
|4208|4208| 
|4209|4209| UnitAI.prototype.OnPackFinished = function(msg)
|4210|4210| {
|4211|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4211|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4212|4212| };
|4213|4213| 
|4214|4214| //// 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
|4208|4208| 
|4209|4209| UnitAI.prototype.OnPackFinished = function(msg)
|4210|4210| {
|4211|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4211|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4212|4212| };
|4213|4213| 
|4214|4214| //// 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
|4211|4211| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4212|4212| };
|4213|4213| 
|4214|    |-//// Helper functions to be called by the FSM ////
|    |4214|+// // Helper functions to be called by the FSM ////
|4215|4215| 
|4216|4216| UnitAI.prototype.GetWalkSpeed = function()
|4217|4217| {
|    | [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
|4923|4923| UnitAI.prototype.AttackEntityInZone = function(ents)
|4924|4924| {
|4925|4925| 	var target = ents.find(target =>
|4926|    |-		this.CanAttack(target)
|4927|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4926|+		this.CanAttack(target) &&
|    |4927|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4928|4928| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4929|4929| 	);
|4930|4930| 	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
|4924|4924| {
|4925|4925| 	var target = ents.find(target =>
|4926|4926| 		this.CanAttack(target)
|4927|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4928|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4927|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4928|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4929|4929| 	);
|4930|4930| 	if (!target)
|4931|4931| 		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
|4990|4990| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4991|4991| 	if (this.isGuardOf)
|4992|4992| 	{
|4993|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4993|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4994|4994| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4995|4995| 		if (cmpUnitAI && cmpAttack &&
|4996|4996| 		    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
|4994|4994| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4995|4995| 		if (cmpUnitAI && cmpAttack &&
|4996|4996| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4997|    |-				return false;
|    |4997|+			return false;
|4998|4998| 	}
|4999|4999| 
|5000|5000| 	// 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
|5032|5032| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5033|5033| 	if (this.isGuardOf)
|5034|5034| 	{
|5035|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5035|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5036|5036| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5037|5037| 		if (cmpUnitAI && cmpAttack &&
|5038|5038| 		    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
|5045|5045| 	return false;
|5046|5046| };
|5047|5047| 
|5048|    |-//// External interface functions ////
|    |5048|+// // External interface functions ////
|5049|5049| 
|5050|5050| UnitAI.prototype.SetFormationController = function(ent)
|5051|5051| {
|    | [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
|5201|5201| 	{
|5202|5202| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5203|5203| 			return;
|5204|    |-		else
|5205|    |-			this.RemoveGuard();
|    |5204|+		this.RemoveGuard();
|5206|5205| 	}
|5207|5206| 
|5208|5207| 	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
|5532|5532| 
|5533|5533| 	if (this.IsFormationController())
|5534|5534| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5535|    |-}
|    |5535|+};
|5536|5536| /**
|5537|5537|  * Adds trade order to the queue. Either walk to the first market, or
|5538|5538|  * 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
|5553|5553| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5554|5554| 	{
|5555|5555| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5556|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5556|+		if (cmpTrader.HasBothMarkets() &&
|5557|5557| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5558|5558| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5559|5559| 		{
|    | [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
|5834|5834| 				{
|5835|5835| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5836|5836| 					var targetClasses = this.order.data.targetClasses;
|5837|    |-					if (targetClasses.attack && cmpIdentity
|5838|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5837|+					if (targetClasses.attack && cmpIdentity &&
|    |5838|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5839|5839| 						continue;
|5840|5840| 					if (targetClasses.avoid && cmpIdentity
|5841|5841| 						&& 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
|5837|5837| 					if (targetClasses.attack && cmpIdentity
|5838|5838| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5839|5839| 						continue;
|5840|    |-					if (targetClasses.avoid && cmpIdentity
|5841|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5840|+					if (targetClasses.avoid && cmpIdentity &&
|    |5841|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5842|5842| 						continue;
|5843|5843| 					// Only used by the AIs to prevent some choices of targets
|5844|5844| 					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
|5860|5860| 		{
|5861|5861| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5862|5862| 			var targetClasses = this.order.data.targetClasses;
|5863|    |-			if (cmpIdentity && targetClasses.attack
|5864|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5863|+			if (cmpIdentity && targetClasses.attack &&
|    |5864|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5865|5865| 				continue;
|5866|5866| 			if (cmpIdentity && targetClasses.avoid
|5867|5867| 				&& 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
|5863|5863| 			if (cmpIdentity && targetClasses.attack
|5864|5864| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5865|5865| 				continue;
|5866|    |-			if (cmpIdentity && targetClasses.avoid
|5867|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5866|+			if (cmpIdentity && targetClasses.avoid &&
|    |5867|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5868|5868| 				continue;
|5869|5869| 			// Only used by the AIs to prevent some choices of targets
|5870|5870| 			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
|6006|6006| 
|6007|6007| UnitAI.prototype.SetHeldPosition = function(x, z)
|6008|6008| {
|6009|    |-	this.heldPosition = {"x": x, "z": z};
|    |6009|+	this.heldPosition = { "x": x, "z": z};
|6010|6010| };
|6011|6011| 
|6012|6012| 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
|6006|6006| 
|6007|6007| UnitAI.prototype.SetHeldPosition = function(x, z)
|6008|6008| {
|6009|    |-	this.heldPosition = {"x": x, "z": z};
|    |6009|+	this.heldPosition = {"x": x, "z": z };
|6010|6010| };
|6011|6011| 
|6012|6012| 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
|6033|6033| 	return false;
|6034|6034| };
|6035|6035| 
|6036|    |-//// Helper functions ////
|    |6036|+// // Helper functions ////
|6037|6037| 
|6038|6038| /**
|6039|6039|  * 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
|6052|6052| 		return undefined;
|6053|6053| 
|6054|6054| 	return component.GetRange(type);
|6055|    |-}
|    |6055|+};
|6056|6056| 
|6057|6057| UnitAI.prototype.CanAttack = function(target)
|6058|6058| {
|    | [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
|6220|6220| 	return cmpPack && cmpPack.IsPacking();
|6221|6221| };
|6222|6222| 
|6223|    |-//// Formation specific functions ////
|    |6223|+// // Formation specific functions ////
|6224|6224| 
|6225|6225| UnitAI.prototype.IsAttackingAsFormation = function()
|6226|6226| {
|    | [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
|6225|6225| UnitAI.prototype.IsAttackingAsFormation = function()
|6226|6226| {
|6227|6227| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6228|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6229|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6228|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6229|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6230|6230| };
|6231|6231| 
|6232|6232| //// 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
|6229|6229| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6230|6230| };
|6231|6231| 
|6232|    |-//// Animal specific functions ////
|    |6232|+// // Animal specific functions ////
|6233|6233| 
|6234|6234| UnitAI.prototype.MoveRandomly = function(distance)
|6235|6235| {

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
|4013| »   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
|4910| »   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
|4925| »   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
|4973| »   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
|4996| »   »   ····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
|2053| »   »   »   »   »   »   &&·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
|3151| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4927| »   »   &&·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
|4928| »   »   &&·(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
|5535| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5864| »   »   »   »   &&·!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
|5867| »   »   »   »   &&·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
|6055| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|6229| »   »   &&·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/2127/display/redirect

As an addendum, some thoughts I had while debugging this:

Concern -> UnitMotion does not read EntityRenamed events, so it fails to carry on in those cases, breaking unitAI somewhat often.

Most C++ components do not need this as they don't really need to ensure continuity then can simply delete old data and parse data for the new entity. In that respect, UnitMotion appears special.

The other candidate I can find is RallypointRenderer, but these are re-created regularly from the GUI/JS components.

The question is then whether subsribing unitMotion makes sense.
Entities are currently renamed on upgrade, promotion, and on construction.
The construction case, for example, currently works because it is handled specially by unitAI.
Chasing was fixed by Angen in https://code.wildfiregames.com/rP23566

This leaves a number of states that currently don't work, such as Garrisoning.

The fact is, failing to move will lead to unitAI behaviour, which is probably better than silently pretending we can still carry on an order we might not be able to pull off.
wraitii updated this revision to Diff 11875.May 16 2020, 3:32 PM

Only do this for the current order, as an optimisation.

(As noted by bb on IRC).

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

Linter detected issues:
Executing section Source...
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
| 117| 117| 
| 118| 118| 
| 119| 119| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 120|    |-		SetInterval: function() { },
|    | 120|+		"SetInterval": function() { },
| 121| 121| 		SetTimeout: function() { },
| 122| 122| 	});
| 123| 123| 
|    | [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
| 118| 118| 
| 119| 119| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 120| 120| 		SetInterval: function() { },
| 121|    |-		SetTimeout: function() { },
|    | 121|+		"SetTimeout": function() { },
| 122| 122| 	});
| 123| 123| 
| 124| 124| 	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
| 122| 122| 	});
| 123| 123| 
| 124| 124| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 125|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 125|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		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
| 125| 125| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 126| 126| 			return 1;
| 127| 127| 		},
| 128|    |-		EnableActiveQuery: function(id) { },
|    | 128|+		"EnableActiveQuery": function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		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
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 129|+		"ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
|    | [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
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 129|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
|    | [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
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130|    |-		DisableActiveQuery: function(id) { },
|    | 130|+		"DisableActiveQuery": function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
| 133| 133| 
|    | [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
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131|    |-		GetEntityFlagMask: function(identifier) { },
|    | 131|+		"GetEntityFlagMask": function(identifier) { },
| 132| 132| 	});
| 133| 133| 
| 134| 134| 	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
| 132| 132| 	});
| 133| 133| 
| 134| 134| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 135|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 135|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 136| 136| 	});
| 137| 137| 
| 138| 138| 	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
| 136| 136| 	});
| 137| 137| 
| 138| 138| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 139|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 139|+		"GetPlayerByID": function(id) { return playerEntity; },
| 140| 140| 		GetNumPlayers: function() { return 2; },
| 141| 141| 	});
| 142| 142| 
|    | [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
| 137| 137| 
| 138| 138| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 139| 139| 		GetPlayerByID: function(id) { return playerEntity; },
| 140|    |-		GetNumPlayers: function() { return 2; },
|    | 140|+		"GetNumPlayers": function() { return 2; },
| 141| 141| 	});
| 142| 142| 
| 143| 143| 	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
| 141| 141| 	});
| 142| 142| 
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144|    |-		IsAlly: function() { return false; },
|    | 144|+		"IsAlly": function() { return false; },
| 145| 145| 		IsEnemy: function() { return true; },
| 146| 146| 		GetEnemies: function() { return [2]; },
| 147| 147| 	});
|    | [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
| 142| 142| 
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144| 144| 		IsAlly: function() { return false; },
| 145|    |-		IsEnemy: function() { return true; },
|    | 145|+		"IsEnemy": function() { return true; },
| 146| 146| 		GetEnemies: function() { return [2]; },
| 147| 147| 	});
| 148| 148| 
|    | [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
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144| 144| 		IsAlly: function() { return false; },
| 145| 145| 		IsEnemy: function() { return true; },
| 146|    |-		GetEnemies: function() { return [2]; },
|    | 146|+		"GetEnemies": function() { return [2]; },
| 147| 147| 	});
| 148| 148| 
| 149| 149| 	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
| 153| 153| 	var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 154| 154| 
| 155| 155| 	AddMock(unit, IID_Identity, {
| 156|    |-		GetClassesList: function() { return []; },
|    | 156|+		"GetClassesList": function() { return []; },
| 157| 157| 	});
| 158| 158| 
| 159| 159| 	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
| 157| 157| 	});
| 158| 158| 
| 159| 159| 	AddMock(unit, IID_Ownership, {
| 160|    |-		GetOwner: function() { return 1; },
|    | 160|+		"GetOwner": function() { return 1; },
| 161| 161| 	});
| 162| 162| 
| 163| 163| 	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
| 161| 161| 	});
| 162| 162| 
| 163| 163| 	AddMock(unit, IID_Position, {
| 164|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 164|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		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
| 162| 162| 
| 163| 163| 	AddMock(unit, IID_Position, {
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165|    |-		GetPosition: function() { return new Vector3D(); },
|    | 165|+		"GetPosition": function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168| 168| 		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
| 163| 163| 	AddMock(unit, IID_Position, {
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166|    |-		GetPosition2D: function() { return new Vector2D(); },
|    | 166|+		"GetPosition2D": function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168| 168| 		IsInWorld: function() { return true; },
| 169| 169| 	});
|    | [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
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 167|+		"GetRotation": function() { return { "y": 0 }; },
| 168| 168| 		IsInWorld: function() { return true; },
| 169| 169| 	});
| 170| 170| 
|    | [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
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168|    |-		IsInWorld: function() { return true; },
|    | 168|+		"IsInWorld": function() { return true; },
| 169| 169| 	});
| 170| 170| 
| 171| 171| 	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
| 178| 178| 	});
| 179| 179| 
| 180| 180| 	AddMock(unit, IID_Vision, {
| 181|    |-		GetRange: function() { return 10; },
|    | 181|+		"GetRange": function() { return 10; },
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	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
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 185|+		"GetRange": function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		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
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 185|+		GetRange: function() { return { "max": 10, "min": 0 }; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		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
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 186|+		"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		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
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 186|+		GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		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
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187|    |-		GetBestAttackAgainst: function(t) { return "melee"; },
|    | 187|+		"GetBestAttackAgainst": function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		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
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188|    |-		GetPreference: function(t) { return 0; },
|    | 188|+		"GetPreference": function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191| 191| 		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
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189|    |-		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 189|+		"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191| 191| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 192| 192| 	});
|    | [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
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190|    |-		CanAttack: function(v) { return true; },
|    | 190|+		"CanAttack": function(v) { return true; },
| 191| 191| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 192| 192| 	});
| 193| 193| 
|    | [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
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191|    |-		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 191|+		"CompareEntitiesByPreference": function(a, b) { return 0; },
| 192| 192| 	});
| 193| 193| 
| 194| 194| 	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
| 199| 199| 	if (mode == 1)
| 200| 200| 	{
| 201| 201| 		AddMock(enemy, IID_Health, {
| 202|    |-			GetHitpoints: function() { return 10; },
|    | 202|+			"GetHitpoints": function() { return 10; },
| 203| 203| 		});
| 204| 204| 		AddMock(enemy, IID_UnitAI, {
| 205| 205| 			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
| 202| 202| 			GetHitpoints: function() { return 10; },
| 203| 203| 		});
| 204| 204| 		AddMock(enemy, IID_UnitAI, {
| 205|    |-			IsAnimal: function() { return false; }
|    | 205|+			"IsAnimal": function() { return false; }
| 206| 206| 		});
| 207| 207| 	}
| 208| 208| 	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
| 207| 207| 	}
| 208| 208| 	else if (mode == 2)
| 209| 209| 		AddMock(enemy, IID_Health, {
| 210|    |-			GetHitpoints: function() { return 0; },
|    | 210|+			"GetHitpoints": function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213| 213| 	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
| 210| 210| 			GetHitpoints: function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 213|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	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
| 210| 210| 			GetHitpoints: function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 213|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	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
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	AddMock(controller, IID_Position, {
| 217|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 217|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		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
| 215| 215| 
| 216| 216| 	AddMock(controller, IID_Position, {
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 218|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		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
| 216| 216| 	AddMock(controller, IID_Position, {
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 219|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222| 222| 		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
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 220|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222| 222| 		IsInWorld: function() { return true; },
| 223| 223| 	});
|    | [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
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 221|+		"GetRotation": function() { return { "y": 0 }; },
| 222| 222| 		IsInWorld: function() { return true; },
| 223| 223| 	});
| 224| 224| 
|    | [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
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222|    |-		IsInWorld: function() { return true; },
|    | 222|+		"IsInWorld": function() { return true; },
| 223| 223| 	});
| 224| 224| 
| 225| 225| 	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
| 270| 270| 	var unitAIs = [];
| 271| 271| 
| 272| 272| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 273|    |-		SetInterval: function() { },
|    | 273|+		"SetInterval": function() { },
| 274| 274| 		SetTimeout: function() { },
| 275| 275| 	});
| 276| 276| 
|    | [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
| 271| 271| 
| 272| 272| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 273| 273| 		SetInterval: function() { },
| 274|    |-		SetTimeout: function() { },
|    | 274|+		"SetTimeout": function() { },
| 275| 275| 	});
| 276| 276| 
| 277| 277| 
|    | [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
| 276| 276| 
| 277| 277| 
| 278| 278| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 279|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 279|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 280| 280| 			return 1;
| 281| 281| 		},
| 282| 282| 		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
| 279| 279| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 280| 280| 			return 1;
| 281| 281| 		},
| 282|    |-		EnableActiveQuery: function(id) { },
|    | 282|+		"EnableActiveQuery": function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285| 285| 		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
| 280| 280| 			return 1;
| 281| 281| 		},
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283|    |-		ResetActiveQuery: function(id) { return [enemy]; },
|    | 283|+		"ResetActiveQuery": function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285| 285| 		GetEntityFlagMask: function(identifier) { },
| 286| 286| 	});
|    | [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
| 281| 281| 		},
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284|    |-		DisableActiveQuery: function(id) { },
|    | 284|+		"DisableActiveQuery": function(id) { },
| 285| 285| 		GetEntityFlagMask: function(identifier) { },
| 286| 286| 	});
| 287| 287| 
|    | [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
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285|    |-		GetEntityFlagMask: function(identifier) { },
|    | 285|+		"GetEntityFlagMask": function(identifier) { },
| 286| 286| 	});
| 287| 287| 
| 288| 288| 	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
| 286| 286| 	});
| 287| 287| 
| 288| 288| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 289|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 289|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 290| 290| 	});
| 291| 291| 
| 292| 292| 	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
| 290| 290| 	});
| 291| 291| 
| 292| 292| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 293|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 293|+		"GetPlayerByID": function(id) { return playerEntity; },
| 294| 294| 		GetNumPlayers: function() { return 2; },
| 295| 295| 	});
| 296| 296| 
|    | [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
| 291| 291| 
| 292| 292| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 293| 293| 		GetPlayerByID: function(id) { return playerEntity; },
| 294|    |-		GetNumPlayers: function() { return 2; },
|    | 294|+		"GetNumPlayers": function() { return 2; },
| 295| 295| 	});
| 296| 296| 
| 297| 297| 	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
| 299| 299| 	});
| 300| 300| 
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302|    |-		IsAlly: function() { return false; },
|    | 302|+		"IsAlly": function() { return false; },
| 303| 303| 		IsEnemy: function() { return true; },
| 304| 304| 		GetEnemies: function() { return [2]; },
| 305| 305| 	});
|    | [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
| 300| 300| 
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302| 302| 		IsAlly: function() { return false; },
| 303|    |-		IsEnemy: function() { return true; },
|    | 303|+		"IsEnemy": function() { return true; },
| 304| 304| 		GetEnemies: function() { return [2]; },
| 305| 305| 	});
| 306| 306| 
|    | [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
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302| 302| 		IsAlly: function() { return false; },
| 303| 303| 		IsEnemy: function() { return true; },
| 304|    |-		GetEnemies: function() { return [2]; },
|    | 304|+		"GetEnemies": function() { return [2]; },
| 305| 305| 	});
| 306| 306| 
| 307| 307| 	// 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
| 312| 312| 		var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 313| 313| 
| 314| 314| 		AddMock(unit + i, IID_Identity, {
| 315|    |-			GetClassesList: function() { return []; },
|    | 315|+			"GetClassesList": function() { return []; },
| 316| 316| 		});
| 317| 317| 
| 318| 318| 		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
| 316| 316| 		});
| 317| 317| 
| 318| 318| 		AddMock(unit + i, IID_Ownership, {
| 319|    |-			GetOwner: function() { return 1; },
|    | 319|+			"GetOwner": function() { return 1; },
| 320| 320| 		});
| 321| 321| 
| 322| 322| 		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
| 320| 320| 		});
| 321| 321| 
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323|    |-			GetTurretParent: function() { return INVALID_ENTITY; },
|    | 323|+			"GetTurretParent": function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			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
| 321| 321| 
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324|    |-			GetPosition: function() { return new Vector3D(); },
|    | 324|+			"GetPosition": function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327| 327| 			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
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325|    |-			GetPosition2D: function() { return new Vector2D(); },
|    | 325|+			"GetPosition2D": function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327| 327| 			IsInWorld: function() { return true; },
| 328| 328| 		});
|    | [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
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326|    |-			GetRotation: function() { return { "y": 0 }; },
|    | 326|+			"GetRotation": function() { return { "y": 0 }; },
| 327| 327| 			IsInWorld: function() { return true; },
| 328| 328| 		});
| 329| 329| 
|    | [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
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327|    |-			IsInWorld: function() { return true; },
|    | 327|+			"IsInWorld": function() { return true; },
| 328| 328| 		});
| 329| 329| 
| 330| 330| 		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
| 337| 337| 		});
| 338| 338| 
| 339| 339| 		AddMock(unit + i, IID_Vision, {
| 340|    |-			GetRange: function() { return 10; },
|    | 340|+			"GetRange": function() { return 10; },
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			"GetRange": function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return { "max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return {"max": 10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return {"max":10, "min": 0 }; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 345|+			"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			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
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 345|+			GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			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
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346|    |-			GetBestAttackAgainst: function(t) { return "melee"; },
|    | 346|+			"GetBestAttackAgainst": function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349| 349| 			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
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347|    |-			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 347|+			"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349| 349| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 350| 350| 		});
|    | [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
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348|    |-			CanAttack: function(v) { return true; },
|    | 348|+			"CanAttack": function(v) { return true; },
| 349| 349| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 350| 350| 		});
| 351| 351| 
|    | [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
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349|    |-			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 349|+			"CompareEntitiesByPreference": function(a, b) { return 0; },
| 350| 350| 		});
| 351| 351| 
| 352| 352| 		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
| 358| 358| 
| 359| 359| 	// create enemy
| 360| 360| 	AddMock(enemy, IID_Health, {
| 361|    |-		GetHitpoints: function() { return 40; },
|    | 361|+		"GetHitpoints": function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364| 364| 	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
| 361| 361| 		GetHitpoints: function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 364|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	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
| 361| 361| 		GetHitpoints: function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 364|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	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
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	AddMock(controller, IID_Position, {
| 368|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 368|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		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
| 366| 366| 
| 367| 367| 	AddMock(controller, IID_Position, {
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 369|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		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
| 367| 367| 	AddMock(controller, IID_Position, {
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 370|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373| 373| 		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
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 371|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373| 373| 		IsInWorld: function() { return true; },
| 374| 374| 	});
|    | [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
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 372|+		"GetRotation": function() { return { "y": 0 }; },
| 373| 373| 		IsInWorld: function() { return true; },
| 374| 374| 	});
| 375| 375| 
|    | [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
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373|    |-		IsInWorld: function() { return true; },
|    | 373|+		"IsInWorld": function() { return true; },
| 374| 374| 	});
| 375| 375| 
| 376| 376| 	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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		"GetRange": function() { return {"max":10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return { "max":10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return {"max": 10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return {"max":10, "min": 0 }; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386| 386| 		GetRange: function() { return {"max":10, "min": 0}; },
| 387|    |-		CanAttackAsFormation: function() { return false; },
|    | 387|+		"CanAttackAsFormation": function() { return false; },
| 388| 388| 	});
| 389| 389| 
| 390| 390| 	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
| 396| 396| 	for (var ent of unitAIs)
| 397| 397| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 398| 398| 
| 399|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 399|+	controllerAI.MoveIntoFormation({ "name": "Circle"});
| 400| 400| 
| 401| 401| 	// let all units be in position
| 402| 402| 	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
| 396| 396| 	for (var ent of unitAIs)
| 397| 397| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 398| 398| 
| 399|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 399|+	controllerAI.MoveIntoFormation({"name": "Circle" });
| 400| 400| 
| 401| 401| 	// let all units be in position
| 402| 402| 	for (var ent of unitAIs)

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 129| »   »   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
| 308| »   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
| 402| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

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

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 397| »   »   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
| 406| »   »   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
|2049|2049| 
|2050|2050| 				"Attacked": function(msg) {
|2051|2051| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2052|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2053|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2052|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2053|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2054|2054| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2055|2055| 				},
|2056|2056| 			},
|    | [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
|2208|2208| 					"MovementUpdate": function(msg) {
|2209|2209| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2210|2210| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2211|    |-						if (msg.likelyFailure || 
|    |2211|+						if (msg.likelyFailure ||
|2212|2212| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2213|2213| 							!msg.obstructed && this.CheckRange(this.order.data))
|2214|2214| 							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
|2850|2850| 					{
|2851|2851| 						// The building was already finished/fully repaired before we arrived;
|2852|2852| 						// let the ConstructionFinished handler handle this.
|2853|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2853|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2854|2854| 						return true;
|2855|2855| 					}
|2856|2856| 
|    | [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
|2850|2850| 					{
|2851|2851| 						// The building was already finished/fully repaired before we arrived;
|2852|2852| 						// let the ConstructionFinished handler handle this.
|2853|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2853|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2854|2854| 						return true;
|2855|2855| 					}
|2856|2856| 
|    | [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
|3148|3148| 				this.StopTimer();
|3149|3149| 				this.ResetAnimation();
|3150|3150| 				if (this.formationAnimationVariant)
|3151|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3151|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3152|3152| 				else
|3153|3153| 					this.SetDefaultAnimationVariant();
|3154|3154| 				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
|3374|3374| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3375|3375| 
|3376|3376| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3377|    |-							// only used for domestic animals
|    |3377|+		// only used for domestic animals
|3378|3378| 
|3379|3379| 		// Reuse the same garrison behaviour for animals.
|3380|3380| 		"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
|3552|3552| 		{
|3553|3553| 			let index = this.GetCurrentState().indexOf(".");
|3554|3554| 			if (index != -1)
|3555|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3555|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3556|3556| 			this.Stop(false);
|3557|3557| 		}
|3558|3558| 
|    | [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
|3608|3608| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3609|3609| 			continue;
|3610|3610| 		if (i == 0)
|3611|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3611|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3612|3612| 		else
|3613|3613| 			this.orderQueue.splice(i, 1);
|3614|3614| 		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
|3608|3608| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3609|3609| 			continue;
|3610|3610| 		if (i == 0)
|3611|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3611|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3612|3612| 		else
|3613|3613| 			this.orderQueue.splice(i, 1);
|3614|3614| 		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
|3695|3695| };
|3696|3696| 
|3697|3697| 
|3698|    |-//// FSM linkage functions ////
|    |3698|+// // FSM linkage functions ////
|3699|3699| 
|3700|3700| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3701|3701| 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
|3866|3866| 				continue;
|3867|3867| 			if (this.orderQueue[i].type == type)
|3868|3868| 				continue;
|3869|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3869|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3870|3870| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3871|3871| 			return;
|3872|3872| 		}
|    | [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
|3866|3866| 				continue;
|3867|3867| 			if (this.orderQueue[i].type == type)
|3868|3868| 				continue;
|3869|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3869|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3870|3870| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3871|3871| 			return;
|3872|3872| 		}
|    | [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
|4108|4108| 	if (data.timerRepeat === undefined)
|4109|4109| 		this.timer = undefined;
|4110|4110| 
|4111|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4111|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4112|4112| };
|4113|4113| 
|4114|4114| /**
|    | [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
|4108|4108| 	if (data.timerRepeat === undefined)
|4109|4109| 		this.timer = undefined;
|4110|4110| 
|4111|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4111|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4112|4112| };
|4113|4113| 
|4114|4114| /**
|    | [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
|4153|4153| 	// TODO: This is a bit inefficient since every unit listens to every
|4154|4154| 	// construction message - ideally we could scope it to only the one we're building
|4155|4155| 
|4156|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4156|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4157|4157| };
|4158|4158| 
|4159|4159| 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
|4153|4153| 	// TODO: This is a bit inefficient since every unit listens to every
|4154|4154| 	// construction message - ideally we could scope it to only the one we're building
|4155|4155| 
|4156|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4156|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4157|4157| };
|4158|4158| 
|4159|4159| 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
|4192|4192| 	if (msg.fromStatusEffect)
|4193|4193| 		return;
|4194|4194| 
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4195|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4196|4196| };
|4197|4197| 
|4198|4198| 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
|4192|4192| 	if (msg.fromStatusEffect)
|4193|4193| 		return;
|4194|4194| 
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4195|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4196|4196| };
|4197|4197| 
|4198|4198| 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
|4197|4197| 
|4198|4198| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4199|4199| {
|4200|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4200|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4201|4201| };
|4202|4202| 
|4203|4203| 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
|4197|4197| 
|4198|4198| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4199|4199| {
|4200|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4200|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4201|4201| };
|4202|4202| 
|4203|4203| 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
|4202|4202| 
|4203|4203| UnitAI.prototype.OnHealthChanged = function(msg)
|4204|4204| {
|4205|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4205|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4206|4206| };
|4207|4207| 
|4208|4208| 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
|4202|4202| 
|4203|4203| UnitAI.prototype.OnHealthChanged = function(msg)
|4204|4204| {
|4205|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4205|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4206|4206| };
|4207|4207| 
|4208|4208| 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
|4208|4208| UnitAI.prototype.OnRangeUpdate = function(msg)
|4209|4209| {
|4210|4210| 	if (msg.tag == this.losRangeQuery)
|4211|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4211|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4212|4212| 	else if (msg.tag == this.losHealRangeQuery)
|4213|4213| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4214|4214| };
|    | [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
|4208|4208| UnitAI.prototype.OnRangeUpdate = function(msg)
|4209|4209| {
|4210|4210| 	if (msg.tag == this.losRangeQuery)
|4211|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4211|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4212|4212| 	else if (msg.tag == this.losHealRangeQuery)
|4213|4213| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4214|4214| };
|    | [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
|4210|4210| 	if (msg.tag == this.losRangeQuery)
|4211|4211| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4212|4212| 	else if (msg.tag == this.losHealRangeQuery)
|4213|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4213|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4214|4214| };
|4215|4215| 
|4216|4216| 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
|4210|4210| 	if (msg.tag == this.losRangeQuery)
|4211|4211| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4212|4212| 	else if (msg.tag == this.losHealRangeQuery)
|4213|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4213|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4214|4214| };
|4215|4215| 
|4216|4216| 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
|4215|4215| 
|4216|4216| UnitAI.prototype.OnPackFinished = function(msg)
|4217|4217| {
|4218|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4218|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4219|4219| };
|4220|4220| 
|4221|4221| //// 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
|4215|4215| 
|4216|4216| UnitAI.prototype.OnPackFinished = function(msg)
|4217|4217| {
|4218|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4218|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4219|4219| };
|4220|4220| 
|4221|4221| //// 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
|4218|4218| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4219|4219| };
|4220|4220| 
|4221|    |-//// Helper functions to be called by the FSM ////
|    |4221|+// // Helper functions to be called by the FSM ////
|4222|4222| 
|4223|4223| UnitAI.prototype.GetWalkSpeed = function()
|4224|4224| {
|    | [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
|4930|4930| UnitAI.prototype.AttackEntityInZone = function(ents)
|4931|4931| {
|4932|4932| 	var target = ents.find(target =>
|4933|    |-		this.CanAttack(target)
|4934|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4933|+		this.CanAttack(target) &&
|    |4934|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4935|4935| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4936|4936| 	);
|4937|4937| 	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
|4931|4931| {
|4932|4932| 	var target = ents.find(target =>
|4933|4933| 		this.CanAttack(target)
|4934|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4935|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4934|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4935|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4936|4936| 	);
|4937|4937| 	if (!target)
|4938|4938| 		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
|4997|4997| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4998|4998| 	if (this.isGuardOf)
|4999|4999| 	{
|5000|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5000|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5001|5001| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5002|5002| 		if (cmpUnitAI && cmpAttack &&
|5003|5003| 		    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
|5001|5001| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5002|5002| 		if (cmpUnitAI && cmpAttack &&
|5003|5003| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|5004|    |-				return false;
|    |5004|+			return false;
|5005|5005| 	}
|5006|5006| 
|5007|5007| 	// 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
|5039|5039| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5040|5040| 	if (this.isGuardOf)
|5041|5041| 	{
|5042|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5042|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5043|5043| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5044|5044| 		if (cmpUnitAI && cmpAttack &&
|5045|5045| 		    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
|5052|5052| 	return false;
|5053|5053| };
|5054|5054| 
|5055|    |-//// External interface functions ////
|    |5055|+// // External interface functions ////
|5056|5056| 
|5057|5057| UnitAI.prototype.SetFormationController = function(ent)
|5058|5058| {
|    | [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
|5208|5208| 	{
|5209|5209| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5210|5210| 			return;
|5211|    |-		else
|5212|    |-			this.RemoveGuard();
|    |5211|+		this.RemoveGuard();
|5213|5212| 	}
|5214|5213| 
|5215|5214| 	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
|5539|5539| 
|5540|5540| 	if (this.IsFormationController())
|5541|5541| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5542|    |-}
|    |5542|+};
|5543|5543| /**
|5544|5544|  * Adds trade order to the queue. Either walk to the first market, or
|5545|5545|  * 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
|5560|5560| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5561|5561| 	{
|5562|5562| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5563|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5563|+		if (cmpTrader.HasBothMarkets() &&
|5564|5564| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5565|5565| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5566|5566| 		{
|    | [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
|5841|5841| 				{
|5842|5842| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5843|5843| 					var targetClasses = this.order.data.targetClasses;
|5844|    |-					if (targetClasses.attack && cmpIdentity
|5845|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5844|+					if (targetClasses.attack && cmpIdentity &&
|    |5845|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5846|5846| 						continue;
|5847|5847| 					if (targetClasses.avoid && cmpIdentity
|5848|5848| 						&& 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
|5844|5844| 					if (targetClasses.attack && cmpIdentity
|5845|5845| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5846|5846| 						continue;
|5847|    |-					if (targetClasses.avoid && cmpIdentity
|5848|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5847|+					if (targetClasses.avoid && cmpIdentity &&
|    |5848|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5849|5849| 						continue;
|5850|5850| 					// Only used by the AIs to prevent some choices of targets
|5851|5851| 					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
|5867|5867| 		{
|5868|5868| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5869|5869| 			var targetClasses = this.order.data.targetClasses;
|5870|    |-			if (cmpIdentity && targetClasses.attack
|5871|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5870|+			if (cmpIdentity && targetClasses.attack &&
|    |5871|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5872|5872| 				continue;
|5873|5873| 			if (cmpIdentity && targetClasses.avoid
|5874|5874| 				&& 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
|5870|5870| 			if (cmpIdentity && targetClasses.attack
|5871|5871| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5872|5872| 				continue;
|5873|    |-			if (cmpIdentity && targetClasses.avoid
|5874|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5873|+			if (cmpIdentity && targetClasses.avoid &&
|    |5874|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5875|5875| 				continue;
|5876|5876| 			// Only used by the AIs to prevent some choices of targets
|5877|5877| 			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
|6013|6013| 
|6014|6014| UnitAI.prototype.SetHeldPosition = function(x, z)
|6015|6015| {
|6016|    |-	this.heldPosition = {"x": x, "z": z};
|    |6016|+	this.heldPosition = { "x": x, "z": z};
|6017|6017| };
|6018|6018| 
|6019|6019| 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
|6013|6013| 
|6014|6014| UnitAI.prototype.SetHeldPosition = function(x, z)
|6015|6015| {
|6016|    |-	this.heldPosition = {"x": x, "z": z};
|    |6016|+	this.heldPosition = {"x": x, "z": z };
|6017|6017| };
|6018|6018| 
|6019|6019| 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
|6040|6040| 	return false;
|6041|6041| };
|6042|6042| 
|6043|    |-//// Helper functions ////
|    |6043|+// // Helper functions ////
|6044|6044| 
|6045|6045| /**
|6046|6046|  * 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
|6059|6059| 		return undefined;
|6060|6060| 
|6061|6061| 	return component.GetRange(type);
|6062|    |-}
|    |6062|+};
|6063|6063| 
|6064|6064| UnitAI.prototype.CanAttack = function(target)
|6065|6065| {
|    | [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
|6227|6227| 	return cmpPack && cmpPack.IsPacking();
|6228|6228| };
|6229|6229| 
|6230|    |-//// Formation specific functions ////
|    |6230|+// // Formation specific functions ////
|6231|6231| 
|6232|6232| UnitAI.prototype.IsAttackingAsFormation = function()
|6233|6233| {
|    | [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
|6232|6232| UnitAI.prototype.IsAttackingAsFormation = function()
|6233|6233| {
|6234|6234| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6235|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6236|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6235|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6236|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6237|6237| };
|6238|6238| 
|6239|6239| //// 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
|6236|6236| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6237|6237| };
|6238|6238| 
|6239|    |-//// Animal specific functions ////
|    |6239|+// // Animal specific functions ////
|6240|6240| 
|6241|6241| UnitAI.prototype.MoveRandomly = function(distance)
|6242|6242| {

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
|4013| »   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
|4917| »   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
|4932| »   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
|4980| »   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
|5003| »   »   ····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
|2053| »   »   »   »   »   »   &&·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
|3151| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4934| »   »   &&·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
|4935| »   »   &&·(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
|5542| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5871| »   »   »   »   &&·!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
|5874| »   »   »   »   &&·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
|6062| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|6236| »   »   &&·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/2128/display/redirect

bb added a subscriber: bb.May 16 2020, 4:16 PM

This patch is correct by default if the design is that order.foo sets a state depending on the given order and state.enter checks if the state is possible and if it fails we simply go to the next order.

Did not test it.

binaries/data/mods/public/simulation/components/UnitAI.js
198

This statement is wrong, since we do not run the order.Foo at all only the leave and enter of the state

4162

currentOrderChange

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
34

trailing ,, more below

93

trailing .0

In D2735#115555, @bb wrote:

This patch is correct by default if the design is that order.foo sets a state depending on the given order and state.enter checks if the state is possible and if it fails we simply go to the next order.

Then it is correct. The behaviour you describe is necessary, because unitAI can enter states without going through the Order.XX step (indeed, that is only called when an _order_ is given).
Thus, the states must perform their own validity checks regardless of what Order has been doing.

We currently have three levels for a unit to process an order:

  • Usually, but not always, a method directly in UnitAI, e.g. UnitAI.prototype.Patrol. These methods can perform checks (and usually do) and inform the caller whether the call will succeed or not.
    • In the case of Patrol, this calls "CanPatrol", which checks that the unit has the "canPatrol" template value (see also D2245).
  • The order itself, e.g. Order.Patrol FSM message. These usually also have their own checks.
    • In the case of Patrol, this checks that the entity is not an animal, and checks for packing. You may notice that the check for animality is inconsistent. Welcome to hell.
  • The states themselves.
    • In the case of Patrol, that checks for being in the world and able to move.

This is generally quite inconsistent in the codebase, but we can make a few general remarks:

  • States can be entered regardless of whether the unit can be ordered to do something. These are two separate concepts (see D1960). Imagine an elephant running Amok: they can attack someone but they can't be ordered to.
    • Thus the separation of concern between method/order and state checks is OK. State should check that things are *possible*, method/order that things can be ordered.
  • The difference between Orders and methods is rather unclear. However, Orders, being triggered by ProcessMessage, don't return a value immediately. So it is convenient to setup a helper function that can return immediately.
  • Orders can simply be dispatchers, such as Order.Flee which just redirects to the appropriate orders.

As preparation for the UnitMotion rewrite (rP22313), I changed handling of motion so that states-enter were responsible for it instead of Order, based on the above principles.
See also D1520 and issues with packing: since orders are checking, states may be entered in a "wrong" packed state. It would probably be easier to handle packing/unpacking in states.

wraitii edited the summary of this revision. (Show Details)May 17 2020, 8:46 AM
wraitii updated this revision to Diff 11889.May 17 2020, 8:49 AM

Fix review comments.

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

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

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

Linter detected issues:
Executing section Source...
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
| 117| 117| 
| 118| 118| 
| 119| 119| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 120|    |-		SetInterval: function() { },
|    | 120|+		"SetInterval": function() { },
| 121| 121| 		SetTimeout: function() { },
| 122| 122| 	});
| 123| 123| 
|    | [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
| 118| 118| 
| 119| 119| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 120| 120| 		SetInterval: function() { },
| 121|    |-		SetTimeout: function() { },
|    | 121|+		"SetTimeout": function() { },
| 122| 122| 	});
| 123| 123| 
| 124| 124| 	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
| 122| 122| 	});
| 123| 123| 
| 124| 124| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 125|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 125|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		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
| 125| 125| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 126| 126| 			return 1;
| 127| 127| 		},
| 128|    |-		EnableActiveQuery: function(id) { },
|    | 128|+		"EnableActiveQuery": function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		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
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 129|+		"ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
|    | [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
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 129|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
|    | [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
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130|    |-		DisableActiveQuery: function(id) { },
|    | 130|+		"DisableActiveQuery": function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
| 133| 133| 
|    | [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
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131|    |-		GetEntityFlagMask: function(identifier) { },
|    | 131|+		"GetEntityFlagMask": function(identifier) { },
| 132| 132| 	});
| 133| 133| 
| 134| 134| 	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
| 132| 132| 	});
| 133| 133| 
| 134| 134| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 135|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 135|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 136| 136| 	});
| 137| 137| 
| 138| 138| 	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
| 136| 136| 	});
| 137| 137| 
| 138| 138| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 139|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 139|+		"GetPlayerByID": function(id) { return playerEntity; },
| 140| 140| 		GetNumPlayers: function() { return 2; },
| 141| 141| 	});
| 142| 142| 
|    | [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
| 137| 137| 
| 138| 138| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 139| 139| 		GetPlayerByID: function(id) { return playerEntity; },
| 140|    |-		GetNumPlayers: function() { return 2; },
|    | 140|+		"GetNumPlayers": function() { return 2; },
| 141| 141| 	});
| 142| 142| 
| 143| 143| 	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
| 141| 141| 	});
| 142| 142| 
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144|    |-		IsAlly: function() { return false; },
|    | 144|+		"IsAlly": function() { return false; },
| 145| 145| 		IsEnemy: function() { return true; },
| 146| 146| 		GetEnemies: function() { return [2]; },
| 147| 147| 	});
|    | [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
| 142| 142| 
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144| 144| 		IsAlly: function() { return false; },
| 145|    |-		IsEnemy: function() { return true; },
|    | 145|+		"IsEnemy": function() { return true; },
| 146| 146| 		GetEnemies: function() { return [2]; },
| 147| 147| 	});
| 148| 148| 
|    | [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
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144| 144| 		IsAlly: function() { return false; },
| 145| 145| 		IsEnemy: function() { return true; },
| 146|    |-		GetEnemies: function() { return [2]; },
|    | 146|+		"GetEnemies": function() { return [2]; },
| 147| 147| 	});
| 148| 148| 
| 149| 149| 	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
| 153| 153| 	var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 154| 154| 
| 155| 155| 	AddMock(unit, IID_Identity, {
| 156|    |-		GetClassesList: function() { return []; },
|    | 156|+		"GetClassesList": function() { return []; },
| 157| 157| 	});
| 158| 158| 
| 159| 159| 	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
| 157| 157| 	});
| 158| 158| 
| 159| 159| 	AddMock(unit, IID_Ownership, {
| 160|    |-		GetOwner: function() { return 1; },
|    | 160|+		"GetOwner": function() { return 1; },
| 161| 161| 	});
| 162| 162| 
| 163| 163| 	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
| 161| 161| 	});
| 162| 162| 
| 163| 163| 	AddMock(unit, IID_Position, {
| 164|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 164|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		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
| 162| 162| 
| 163| 163| 	AddMock(unit, IID_Position, {
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165|    |-		GetPosition: function() { return new Vector3D(); },
|    | 165|+		"GetPosition": function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168| 168| 		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
| 163| 163| 	AddMock(unit, IID_Position, {
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166|    |-		GetPosition2D: function() { return new Vector2D(); },
|    | 166|+		"GetPosition2D": function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168| 168| 		IsInWorld: function() { return true; },
| 169| 169| 	});
|    | [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
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 167|+		"GetRotation": function() { return { "y": 0 }; },
| 168| 168| 		IsInWorld: function() { return true; },
| 169| 169| 	});
| 170| 170| 
|    | [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
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168|    |-		IsInWorld: function() { return true; },
|    | 168|+		"IsInWorld": function() { return true; },
| 169| 169| 	});
| 170| 170| 
| 171| 171| 	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
| 178| 178| 	});
| 179| 179| 
| 180| 180| 	AddMock(unit, IID_Vision, {
| 181|    |-		GetRange: function() { return 10; },
|    | 181|+		"GetRange": function() { return 10; },
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	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
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 185|+		"GetRange": function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		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
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 185|+		GetRange: function() { return { "max": 10, "min": 0 }; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		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
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 186|+		"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		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
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 186|+		GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		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
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187|    |-		GetBestAttackAgainst: function(t) { return "melee"; },
|    | 187|+		"GetBestAttackAgainst": function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		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
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188|    |-		GetPreference: function(t) { return 0; },
|    | 188|+		"GetPreference": function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191| 191| 		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
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189|    |-		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 189|+		"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191| 191| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 192| 192| 	});
|    | [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
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190|    |-		CanAttack: function(v) { return true; },
|    | 190|+		"CanAttack": function(v) { return true; },
| 191| 191| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 192| 192| 	});
| 193| 193| 
|    | [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
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191|    |-		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 191|+		"CompareEntitiesByPreference": function(a, b) { return 0; },
| 192| 192| 	});
| 193| 193| 
| 194| 194| 	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
| 199| 199| 	if (mode == 1)
| 200| 200| 	{
| 201| 201| 		AddMock(enemy, IID_Health, {
| 202|    |-			GetHitpoints: function() { return 10; },
|    | 202|+			"GetHitpoints": function() { return 10; },
| 203| 203| 		});
| 204| 204| 		AddMock(enemy, IID_UnitAI, {
| 205| 205| 			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
| 202| 202| 			GetHitpoints: function() { return 10; },
| 203| 203| 		});
| 204| 204| 		AddMock(enemy, IID_UnitAI, {
| 205|    |-			IsAnimal: function() { return false; }
|    | 205|+			"IsAnimal": function() { return false; }
| 206| 206| 		});
| 207| 207| 	}
| 208| 208| 	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
| 207| 207| 	}
| 208| 208| 	else if (mode == 2)
| 209| 209| 		AddMock(enemy, IID_Health, {
| 210|    |-			GetHitpoints: function() { return 0; },
|    | 210|+			"GetHitpoints": function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213| 213| 	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
| 210| 210| 			GetHitpoints: function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 213|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	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
| 210| 210| 			GetHitpoints: function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 213|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	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
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	AddMock(controller, IID_Position, {
| 217|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 217|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		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
| 215| 215| 
| 216| 216| 	AddMock(controller, IID_Position, {
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 218|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		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
| 216| 216| 	AddMock(controller, IID_Position, {
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 219|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222| 222| 		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
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 220|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222| 222| 		IsInWorld: function() { return true; },
| 223| 223| 	});
|    | [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
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 221|+		"GetRotation": function() { return { "y": 0 }; },
| 222| 222| 		IsInWorld: function() { return true; },
| 223| 223| 	});
| 224| 224| 
|    | [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
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222|    |-		IsInWorld: function() { return true; },
|    | 222|+		"IsInWorld": function() { return true; },
| 223| 223| 	});
| 224| 224| 
| 225| 225| 	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
| 270| 270| 	var unitAIs = [];
| 271| 271| 
| 272| 272| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 273|    |-		SetInterval: function() { },
|    | 273|+		"SetInterval": function() { },
| 274| 274| 		SetTimeout: function() { },
| 275| 275| 	});
| 276| 276| 
|    | [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
| 271| 271| 
| 272| 272| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 273| 273| 		SetInterval: function() { },
| 274|    |-		SetTimeout: function() { },
|    | 274|+		"SetTimeout": function() { },
| 275| 275| 	});
| 276| 276| 
| 277| 277| 
|    | [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
| 276| 276| 
| 277| 277| 
| 278| 278| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 279|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 279|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 280| 280| 			return 1;
| 281| 281| 		},
| 282| 282| 		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
| 279| 279| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 280| 280| 			return 1;
| 281| 281| 		},
| 282|    |-		EnableActiveQuery: function(id) { },
|    | 282|+		"EnableActiveQuery": function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285| 285| 		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
| 280| 280| 			return 1;
| 281| 281| 		},
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283|    |-		ResetActiveQuery: function(id) { return [enemy]; },
|    | 283|+		"ResetActiveQuery": function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285| 285| 		GetEntityFlagMask: function(identifier) { },
| 286| 286| 	});
|    | [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
| 281| 281| 		},
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284|    |-		DisableActiveQuery: function(id) { },
|    | 284|+		"DisableActiveQuery": function(id) { },
| 285| 285| 		GetEntityFlagMask: function(identifier) { },
| 286| 286| 	});
| 287| 287| 
|    | [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
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285|    |-		GetEntityFlagMask: function(identifier) { },
|    | 285|+		"GetEntityFlagMask": function(identifier) { },
| 286| 286| 	});
| 287| 287| 
| 288| 288| 	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
| 286| 286| 	});
| 287| 287| 
| 288| 288| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 289|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 289|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 290| 290| 	});
| 291| 291| 
| 292| 292| 	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
| 290| 290| 	});
| 291| 291| 
| 292| 292| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 293|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 293|+		"GetPlayerByID": function(id) { return playerEntity; },
| 294| 294| 		GetNumPlayers: function() { return 2; },
| 295| 295| 	});
| 296| 296| 
|    | [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
| 291| 291| 
| 292| 292| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 293| 293| 		GetPlayerByID: function(id) { return playerEntity; },
| 294|    |-		GetNumPlayers: function() { return 2; },
|    | 294|+		"GetNumPlayers": function() { return 2; },
| 295| 295| 	});
| 296| 296| 
| 297| 297| 	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
| 299| 299| 	});
| 300| 300| 
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302|    |-		IsAlly: function() { return false; },
|    | 302|+		"IsAlly": function() { return false; },
| 303| 303| 		IsEnemy: function() { return true; },
| 304| 304| 		GetEnemies: function() { return [2]; },
| 305| 305| 	});
|    | [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
| 300| 300| 
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302| 302| 		IsAlly: function() { return false; },
| 303|    |-		IsEnemy: function() { return true; },
|    | 303|+		"IsEnemy": function() { return true; },
| 304| 304| 		GetEnemies: function() { return [2]; },
| 305| 305| 	});
| 306| 306| 
|    | [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
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302| 302| 		IsAlly: function() { return false; },
| 303| 303| 		IsEnemy: function() { return true; },
| 304|    |-		GetEnemies: function() { return [2]; },
|    | 304|+		"GetEnemies": function() { return [2]; },
| 305| 305| 	});
| 306| 306| 
| 307| 307| 	// 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
| 312| 312| 		var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 313| 313| 
| 314| 314| 		AddMock(unit + i, IID_Identity, {
| 315|    |-			GetClassesList: function() { return []; },
|    | 315|+			"GetClassesList": function() { return []; },
| 316| 316| 		});
| 317| 317| 
| 318| 318| 		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
| 316| 316| 		});
| 317| 317| 
| 318| 318| 		AddMock(unit + i, IID_Ownership, {
| 319|    |-			GetOwner: function() { return 1; },
|    | 319|+			"GetOwner": function() { return 1; },
| 320| 320| 		});
| 321| 321| 
| 322| 322| 		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
| 320| 320| 		});
| 321| 321| 
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323|    |-			GetTurretParent: function() { return INVALID_ENTITY; },
|    | 323|+			"GetTurretParent": function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			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
| 321| 321| 
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324|    |-			GetPosition: function() { return new Vector3D(); },
|    | 324|+			"GetPosition": function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327| 327| 			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
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325|    |-			GetPosition2D: function() { return new Vector2D(); },
|    | 325|+			"GetPosition2D": function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327| 327| 			IsInWorld: function() { return true; },
| 328| 328| 		});
|    | [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
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326|    |-			GetRotation: function() { return { "y": 0 }; },
|    | 326|+			"GetRotation": function() { return { "y": 0 }; },
| 327| 327| 			IsInWorld: function() { return true; },
| 328| 328| 		});
| 329| 329| 
|    | [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
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327|    |-			IsInWorld: function() { return true; },
|    | 327|+			"IsInWorld": function() { return true; },
| 328| 328| 		});
| 329| 329| 
| 330| 330| 		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
| 337| 337| 		});
| 338| 338| 
| 339| 339| 		AddMock(unit + i, IID_Vision, {
| 340|    |-			GetRange: function() { return 10; },
|    | 340|+			"GetRange": function() { return 10; },
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			"GetRange": function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return { "max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return {"max": 10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return {"max":10, "min": 0 }; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 345|+			"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			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
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 345|+			GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			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
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346|    |-			GetBestAttackAgainst: function(t) { return "melee"; },
|    | 346|+			"GetBestAttackAgainst": function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349| 349| 			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
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347|    |-			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 347|+			"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349| 349| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 350| 350| 		});
|    | [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
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348|    |-			CanAttack: function(v) { return true; },
|    | 348|+			"CanAttack": function(v) { return true; },
| 349| 349| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 350| 350| 		});
| 351| 351| 
|    | [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
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349|    |-			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 349|+			"CompareEntitiesByPreference": function(a, b) { return 0; },
| 350| 350| 		});
| 351| 351| 
| 352| 352| 		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
| 358| 358| 
| 359| 359| 	// create enemy
| 360| 360| 	AddMock(enemy, IID_Health, {
| 361|    |-		GetHitpoints: function() { return 40; },
|    | 361|+		"GetHitpoints": function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364| 364| 	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
| 361| 361| 		GetHitpoints: function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 364|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	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
| 361| 361| 		GetHitpoints: function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 364|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	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
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	AddMock(controller, IID_Position, {
| 368|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 368|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		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
| 366| 366| 
| 367| 367| 	AddMock(controller, IID_Position, {
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 369|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		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
| 367| 367| 	AddMock(controller, IID_Position, {
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 370|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373| 373| 		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
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 371|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373| 373| 		IsInWorld: function() { return true; },
| 374| 374| 	});
|    | [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
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 372|+		"GetRotation": function() { return { "y": 0 }; },
| 373| 373| 		IsInWorld: function() { return true; },
| 374| 374| 	});
| 375| 375| 
|    | [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
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373|    |-		IsInWorld: function() { return true; },
|    | 373|+		"IsInWorld": function() { return true; },
| 374| 374| 	});
| 375| 375| 
| 376| 376| 	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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		"GetRange": function() { return {"max":10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return { "max":10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return {"max": 10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return {"max":10, "min": 0 }; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386| 386| 		GetRange: function() { return {"max":10, "min": 0}; },
| 387|    |-		CanAttackAsFormation: function() { return false; },
|    | 387|+		"CanAttackAsFormation": function() { return false; },
| 388| 388| 	});
| 389| 389| 
| 390| 390| 	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
| 396| 396| 	for (var ent of unitAIs)
| 397| 397| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 398| 398| 
| 399|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 399|+	controllerAI.MoveIntoFormation({ "name": "Circle"});
| 400| 400| 
| 401| 401| 	// let all units be in position
| 402| 402| 	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
| 396| 396| 	for (var ent of unitAIs)
| 397| 397| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 398| 398| 
| 399|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 399|+	controllerAI.MoveIntoFormation({"name": "Circle" });
| 400| 400| 
| 401| 401| 	// let all units be in position
| 402| 402| 	for (var ent of unitAIs)

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 129| »   »   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
| 308| »   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
| 402| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

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

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 397| »   »   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
| 406| »   »   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
|2049|2049| 
|2050|2050| 				"Attacked": function(msg) {
|2051|2051| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2052|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2053|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2052|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2053|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2054|2054| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2055|2055| 				},
|2056|2056| 			},
|    | [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
|2208|2208| 					"MovementUpdate": function(msg) {
|2209|2209| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2210|2210| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2211|    |-						if (msg.likelyFailure || 
|    |2211|+						if (msg.likelyFailure ||
|2212|2212| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2213|2213| 							!msg.obstructed && this.CheckRange(this.order.data))
|2214|2214| 							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
|2850|2850| 					{
|2851|2851| 						// The building was already finished/fully repaired before we arrived;
|2852|2852| 						// let the ConstructionFinished handler handle this.
|2853|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2853|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2854|2854| 						return true;
|2855|2855| 					}
|2856|2856| 
|    | [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
|2850|2850| 					{
|2851|2851| 						// The building was already finished/fully repaired before we arrived;
|2852|2852| 						// let the ConstructionFinished handler handle this.
|2853|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2853|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2854|2854| 						return true;
|2855|2855| 					}
|2856|2856| 
|    | [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
|3148|3148| 				this.StopTimer();
|3149|3149| 				this.ResetAnimation();
|3150|3150| 				if (this.formationAnimationVariant)
|3151|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3151|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3152|3152| 				else
|3153|3153| 					this.SetDefaultAnimationVariant();
|3154|3154| 				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
|3374|3374| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3375|3375| 
|3376|3376| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3377|    |-							// only used for domestic animals
|    |3377|+		// only used for domestic animals
|3378|3378| 
|3379|3379| 		// Reuse the same garrison behaviour for animals.
|3380|3380| 		"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
|3552|3552| 		{
|3553|3553| 			let index = this.GetCurrentState().indexOf(".");
|3554|3554| 			if (index != -1)
|3555|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3555|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3556|3556| 			this.Stop(false);
|3557|3557| 		}
|3558|3558| 
|    | [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
|3608|3608| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3609|3609| 			continue;
|3610|3610| 		if (i == 0)
|3611|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3611|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3612|3612| 		else
|3613|3613| 			this.orderQueue.splice(i, 1);
|3614|3614| 		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
|3608|3608| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3609|3609| 			continue;
|3610|3610| 		if (i == 0)
|3611|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3611|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3612|3612| 		else
|3613|3613| 			this.orderQueue.splice(i, 1);
|3614|3614| 		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
|3695|3695| };
|3696|3696| 
|3697|3697| 
|3698|    |-//// FSM linkage functions ////
|    |3698|+// // FSM linkage functions ////
|3699|3699| 
|3700|3700| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3701|3701| 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
|3866|3866| 				continue;
|3867|3867| 			if (this.orderQueue[i].type == type)
|3868|3868| 				continue;
|3869|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3869|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3870|3870| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3871|3871| 			return;
|3872|3872| 		}
|    | [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
|3866|3866| 				continue;
|3867|3867| 			if (this.orderQueue[i].type == type)
|3868|3868| 				continue;
|3869|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3869|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3870|3870| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3871|3871| 			return;
|3872|3872| 		}
|    | [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
|4108|4108| 	if (data.timerRepeat === undefined)
|4109|4109| 		this.timer = undefined;
|4110|4110| 
|4111|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4111|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4112|4112| };
|4113|4113| 
|4114|4114| /**
|    | [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
|4108|4108| 	if (data.timerRepeat === undefined)
|4109|4109| 		this.timer = undefined;
|4110|4110| 
|4111|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4111|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4112|4112| };
|4113|4113| 
|4114|4114| /**
|    | [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
|4153|4153| 	// TODO: This is a bit inefficient since every unit listens to every
|4154|4154| 	// construction message - ideally we could scope it to only the one we're building
|4155|4155| 
|4156|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4156|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4157|4157| };
|4158|4158| 
|4159|4159| 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
|4153|4153| 	// TODO: This is a bit inefficient since every unit listens to every
|4154|4154| 	// construction message - ideally we could scope it to only the one we're building
|4155|4155| 
|4156|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4156|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4157|4157| };
|4158|4158| 
|4159|4159| 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
|4192|4192| 	if (msg.fromStatusEffect)
|4193|4193| 		return;
|4194|4194| 
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4195|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4196|4196| };
|4197|4197| 
|4198|4198| 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
|4192|4192| 	if (msg.fromStatusEffect)
|4193|4193| 		return;
|4194|4194| 
|4195|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4195|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4196|4196| };
|4197|4197| 
|4198|4198| 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
|4197|4197| 
|4198|4198| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4199|4199| {
|4200|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4200|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4201|4201| };
|4202|4202| 
|4203|4203| 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
|4197|4197| 
|4198|4198| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4199|4199| {
|4200|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4200|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4201|4201| };
|4202|4202| 
|4203|4203| 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
|4202|4202| 
|4203|4203| UnitAI.prototype.OnHealthChanged = function(msg)
|4204|4204| {
|4205|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4205|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4206|4206| };
|4207|4207| 
|4208|4208| 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
|4202|4202| 
|4203|4203| UnitAI.prototype.OnHealthChanged = function(msg)
|4204|4204| {
|4205|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4205|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4206|4206| };
|4207|4207| 
|4208|4208| 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
|4208|4208| UnitAI.prototype.OnRangeUpdate = function(msg)
|4209|4209| {
|4210|4210| 	if (msg.tag == this.losRangeQuery)
|4211|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4211|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4212|4212| 	else if (msg.tag == this.losHealRangeQuery)
|4213|4213| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4214|4214| };
|    | [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
|4208|4208| UnitAI.prototype.OnRangeUpdate = function(msg)
|4209|4209| {
|4210|4210| 	if (msg.tag == this.losRangeQuery)
|4211|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4211|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4212|4212| 	else if (msg.tag == this.losHealRangeQuery)
|4213|4213| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4214|4214| };
|    | [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
|4210|4210| 	if (msg.tag == this.losRangeQuery)
|4211|4211| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4212|4212| 	else if (msg.tag == this.losHealRangeQuery)
|4213|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4213|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4214|4214| };
|4215|4215| 
|4216|4216| 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
|4210|4210| 	if (msg.tag == this.losRangeQuery)
|4211|4211| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4212|4212| 	else if (msg.tag == this.losHealRangeQuery)
|4213|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4213|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4214|4214| };
|4215|4215| 
|4216|4216| 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
|4215|4215| 
|4216|4216| UnitAI.prototype.OnPackFinished = function(msg)
|4217|4217| {
|4218|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4218|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4219|4219| };
|4220|4220| 
|4221|4221| //// 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
|4215|4215| 
|4216|4216| UnitAI.prototype.OnPackFinished = function(msg)
|4217|4217| {
|4218|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4218|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4219|4219| };
|4220|4220| 
|4221|4221| //// 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
|4218|4218| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4219|4219| };
|4220|4220| 
|4221|    |-//// Helper functions to be called by the FSM ////
|    |4221|+// // Helper functions to be called by the FSM ////
|4222|4222| 
|4223|4223| UnitAI.prototype.GetWalkSpeed = function()
|4224|4224| {
|    | [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
|4930|4930| UnitAI.prototype.AttackEntityInZone = function(ents)
|4931|4931| {
|4932|4932| 	var target = ents.find(target =>
|4933|    |-		this.CanAttack(target)
|4934|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4933|+		this.CanAttack(target) &&
|    |4934|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4935|4935| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4936|4936| 	);
|4937|4937| 	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
|4931|4931| {
|4932|4932| 	var target = ents.find(target =>
|4933|4933| 		this.CanAttack(target)
|4934|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4935|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4934|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4935|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4936|4936| 	);
|4937|4937| 	if (!target)
|4938|4938| 		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
|4997|4997| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4998|4998| 	if (this.isGuardOf)
|4999|4999| 	{
|5000|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5000|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5001|5001| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5002|5002| 		if (cmpUnitAI && cmpAttack &&
|5003|5003| 		    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
|5001|5001| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5002|5002| 		if (cmpUnitAI && cmpAttack &&
|5003|5003| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|5004|    |-				return false;
|    |5004|+			return false;
|5005|5005| 	}
|5006|5006| 
|5007|5007| 	// 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
|5039|5039| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5040|5040| 	if (this.isGuardOf)
|5041|5041| 	{
|5042|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5042|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5043|5043| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5044|5044| 		if (cmpUnitAI && cmpAttack &&
|5045|5045| 		    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
|5052|5052| 	return false;
|5053|5053| };
|5054|5054| 
|5055|    |-//// External interface functions ////
|    |5055|+// // External interface functions ////
|5056|5056| 
|5057|5057| UnitAI.prototype.SetFormationController = function(ent)
|5058|5058| {
|    | [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
|5208|5208| 	{
|5209|5209| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5210|5210| 			return;
|5211|    |-		else
|5212|    |-			this.RemoveGuard();
|    |5211|+		this.RemoveGuard();
|5213|5212| 	}
|5214|5213| 
|5215|5214| 	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
|5539|5539| 
|5540|5540| 	if (this.IsFormationController())
|5541|5541| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5542|    |-}
|    |5542|+};
|5543|5543| /**
|5544|5544|  * Adds trade order to the queue. Either walk to the first market, or
|5545|5545|  * 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
|5560|5560| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5561|5561| 	{
|5562|5562| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5563|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5563|+		if (cmpTrader.HasBothMarkets() &&
|5564|5564| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5565|5565| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5566|5566| 		{
|    | [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
|5841|5841| 				{
|5842|5842| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5843|5843| 					var targetClasses = this.order.data.targetClasses;
|5844|    |-					if (targetClasses.attack && cmpIdentity
|5845|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5844|+					if (targetClasses.attack && cmpIdentity &&
|    |5845|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5846|5846| 						continue;
|5847|5847| 					if (targetClasses.avoid && cmpIdentity
|5848|5848| 						&& 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
|5844|5844| 					if (targetClasses.attack && cmpIdentity
|5845|5845| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5846|5846| 						continue;
|5847|    |-					if (targetClasses.avoid && cmpIdentity
|5848|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5847|+					if (targetClasses.avoid && cmpIdentity &&
|    |5848|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5849|5849| 						continue;
|5850|5850| 					// Only used by the AIs to prevent some choices of targets
|5851|5851| 					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
|5867|5867| 		{
|5868|5868| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5869|5869| 			var targetClasses = this.order.data.targetClasses;
|5870|    |-			if (cmpIdentity && targetClasses.attack
|5871|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5870|+			if (cmpIdentity && targetClasses.attack &&
|    |5871|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5872|5872| 				continue;
|5873|5873| 			if (cmpIdentity && targetClasses.avoid
|5874|5874| 				&& 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
|5870|5870| 			if (cmpIdentity && targetClasses.attack
|5871|5871| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5872|5872| 				continue;
|5873|    |-			if (cmpIdentity && targetClasses.avoid
|5874|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5873|+			if (cmpIdentity && targetClasses.avoid &&
|    |5874|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5875|5875| 				continue;
|5876|5876| 			// Only used by the AIs to prevent some choices of targets
|5877|5877| 			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
|6013|6013| 
|6014|6014| UnitAI.prototype.SetHeldPosition = function(x, z)
|6015|6015| {
|6016|    |-	this.heldPosition = {"x": x, "z": z};
|    |6016|+	this.heldPosition = { "x": x, "z": z};
|6017|6017| };
|6018|6018| 
|6019|6019| 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
|6013|6013| 
|6014|6014| UnitAI.prototype.SetHeldPosition = function(x, z)
|6015|6015| {
|6016|    |-	this.heldPosition = {"x": x, "z": z};
|    |6016|+	this.heldPosition = {"x": x, "z": z };
|6017|6017| };
|6018|6018| 
|6019|6019| 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
|6040|6040| 	return false;
|6041|6041| };
|6042|6042| 
|6043|    |-//// Helper functions ////
|    |6043|+// // Helper functions ////
|6044|6044| 
|6045|6045| /**
|6046|6046|  * 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
|6059|6059| 		return undefined;
|6060|6060| 
|6061|6061| 	return component.GetRange(type);
|6062|    |-}
|    |6062|+};
|6063|6063| 
|6064|6064| UnitAI.prototype.CanAttack = function(target)
|6065|6065| {
|    | [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
|6227|6227| 	return cmpPack && cmpPack.IsPacking();
|6228|6228| };
|6229|6229| 
|6230|    |-//// Formation specific functions ////
|    |6230|+// // Formation specific functions ////
|6231|6231| 
|6232|6232| UnitAI.prototype.IsAttackingAsFormation = function()
|6233|6233| {
|    | [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
|6232|6232| UnitAI.prototype.IsAttackingAsFormation = function()
|6233|6233| {
|6234|6234| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6235|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6236|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6235|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6236|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6237|6237| };
|6238|6238| 
|6239|6239| //// 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
|6236|6236| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6237|6237| };
|6238|6238| 
|6239|    |-//// Animal specific functions ////
|    |6239|+// // Animal specific functions ////
|6240|6240| 
|6241|6241| UnitAI.prototype.MoveRandomly = function(distance)
|6242|6242| {

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
|4013| »   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
|4917| »   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
|4932| »   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
|4980| »   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
|5003| »   »   ····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
|2053| »   »   »   »   »   »   &&·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
|3151| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4934| »   »   &&·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
|4935| »   »   &&·(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
|5542| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5871| »   »   »   »   &&·!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
|5874| »   »   »   »   &&·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
|6062| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|6236| »   »   &&·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/2138/display/redirect

It "breaks" hunting.

WARNING: JavaScript warning: simulation/components/UnitAI.js line 2022 reference to undefined property this.order.data.attackType
binaries/data/mods/public/simulation/components/UnitAI.js
196

I'd say TargetRenamed or something, to make clear it is not this.entity who is renamed?

wraitii edited the summary of this revision. (Show Details)May 19 2020, 10:21 PM
wraitii updated the Trac tickets for this revision.
wraitii updated this revision to Diff 11936.EditedMay 20 2020, 6:40 PM

This was a bit trickier than I thought.

As said on IRC, the issue is that Timer's PerformAttack was triggering the resource kill, thus entity renaming, and thus we left "PerformAttack" in a different order.
This was dangerous anyhow given the subsequent calls, so I add an explicit check for that.

The other type of order where this seems like it could easily have happened is repairing (foundation->building) but that is already handled by the ConstructionFinished message. So that's fine. Other orders (garrison, healing, regular combat, patrolling, guarding) make sense wrt to the new behaviour.

This has let me to notice that entities search for new foundations around themselves instead of around the target, which is probably not WAD.


AI-AI game shows no particular issue and all behaviour I've tested was fine.

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

Linter detected issues:
Executing section Source...
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
| 117| 117| 
| 118| 118| 
| 119| 119| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 120|    |-		SetInterval: function() { },
|    | 120|+		"SetInterval": function() { },
| 121| 121| 		SetTimeout: function() { },
| 122| 122| 	});
| 123| 123| 
|    | [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
| 118| 118| 
| 119| 119| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 120| 120| 		SetInterval: function() { },
| 121|    |-		SetTimeout: function() { },
|    | 121|+		"SetTimeout": function() { },
| 122| 122| 	});
| 123| 123| 
| 124| 124| 	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
| 122| 122| 	});
| 123| 123| 
| 124| 124| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 125|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 125|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		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
| 125| 125| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 126| 126| 			return 1;
| 127| 127| 		},
| 128|    |-		EnableActiveQuery: function(id) { },
|    | 128|+		"EnableActiveQuery": function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		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
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 129|+		"ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
|    | [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
| 126| 126| 			return 1;
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129|    |-		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
|    | 129|+		ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
|    | [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
| 127| 127| 		},
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130|    |-		DisableActiveQuery: function(id) { },
|    | 130|+		"DisableActiveQuery": function(id) { },
| 131| 131| 		GetEntityFlagMask: function(identifier) { },
| 132| 132| 	});
| 133| 133| 
|    | [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
| 128| 128| 		EnableActiveQuery: function(id) { },
| 129| 129| 		ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; },
| 130| 130| 		DisableActiveQuery: function(id) { },
| 131|    |-		GetEntityFlagMask: function(identifier) { },
|    | 131|+		"GetEntityFlagMask": function(identifier) { },
| 132| 132| 	});
| 133| 133| 
| 134| 134| 	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
| 132| 132| 	});
| 133| 133| 
| 134| 134| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 135|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 135|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 136| 136| 	});
| 137| 137| 
| 138| 138| 	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
| 136| 136| 	});
| 137| 137| 
| 138| 138| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 139|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 139|+		"GetPlayerByID": function(id) { return playerEntity; },
| 140| 140| 		GetNumPlayers: function() { return 2; },
| 141| 141| 	});
| 142| 142| 
|    | [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
| 137| 137| 
| 138| 138| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 139| 139| 		GetPlayerByID: function(id) { return playerEntity; },
| 140|    |-		GetNumPlayers: function() { return 2; },
|    | 140|+		"GetNumPlayers": function() { return 2; },
| 141| 141| 	});
| 142| 142| 
| 143| 143| 	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
| 141| 141| 	});
| 142| 142| 
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144|    |-		IsAlly: function() { return false; },
|    | 144|+		"IsAlly": function() { return false; },
| 145| 145| 		IsEnemy: function() { return true; },
| 146| 146| 		GetEnemies: function() { return [2]; },
| 147| 147| 	});
|    | [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
| 142| 142| 
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144| 144| 		IsAlly: function() { return false; },
| 145|    |-		IsEnemy: function() { return true; },
|    | 145|+		"IsEnemy": function() { return true; },
| 146| 146| 		GetEnemies: function() { return [2]; },
| 147| 147| 	});
| 148| 148| 
|    | [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
| 143| 143| 	AddMock(playerEntity, IID_Player, {
| 144| 144| 		IsAlly: function() { return false; },
| 145| 145| 		IsEnemy: function() { return true; },
| 146|    |-		GetEnemies: function() { return [2]; },
|    | 146|+		"GetEnemies": function() { return [2]; },
| 147| 147| 	});
| 148| 148| 
| 149| 149| 	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
| 153| 153| 	var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 154| 154| 
| 155| 155| 	AddMock(unit, IID_Identity, {
| 156|    |-		GetClassesList: function() { return []; },
|    | 156|+		"GetClassesList": function() { return []; },
| 157| 157| 	});
| 158| 158| 
| 159| 159| 	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
| 157| 157| 	});
| 158| 158| 
| 159| 159| 	AddMock(unit, IID_Ownership, {
| 160|    |-		GetOwner: function() { return 1; },
|    | 160|+		"GetOwner": function() { return 1; },
| 161| 161| 	});
| 162| 162| 
| 163| 163| 	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
| 161| 161| 	});
| 162| 162| 
| 163| 163| 	AddMock(unit, IID_Position, {
| 164|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 164|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		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
| 162| 162| 
| 163| 163| 	AddMock(unit, IID_Position, {
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165|    |-		GetPosition: function() { return new Vector3D(); },
|    | 165|+		"GetPosition": function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168| 168| 		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
| 163| 163| 	AddMock(unit, IID_Position, {
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166|    |-		GetPosition2D: function() { return new Vector2D(); },
|    | 166|+		"GetPosition2D": function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168| 168| 		IsInWorld: function() { return true; },
| 169| 169| 	});
|    | [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
| 164| 164| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 167|+		"GetRotation": function() { return { "y": 0 }; },
| 168| 168| 		IsInWorld: function() { return true; },
| 169| 169| 	});
| 170| 170| 
|    | [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
| 165| 165| 		GetPosition: function() { return new Vector3D(); },
| 166| 166| 		GetPosition2D: function() { return new Vector2D(); },
| 167| 167| 		GetRotation: function() { return { "y": 0 }; },
| 168|    |-		IsInWorld: function() { return true; },
|    | 168|+		"IsInWorld": function() { return true; },
| 169| 169| 	});
| 170| 170| 
| 171| 171| 	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
| 178| 178| 	});
| 179| 179| 
| 180| 180| 	AddMock(unit, IID_Vision, {
| 181|    |-		GetRange: function() { return 10; },
|    | 181|+		"GetRange": function() { return 10; },
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	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
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 185|+		"GetRange": function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		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
| 182| 182| 	});
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185|    |-		GetRange: function() { return { "max": 10, "min": 0}; },
|    | 185|+		GetRange: function() { return { "max": 10, "min": 0 }; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		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
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 186|+		"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		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
| 183| 183| 
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186|    |-		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 186|+		GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		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
| 184| 184| 	AddMock(unit, IID_Attack, {
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187|    |-		GetBestAttackAgainst: function(t) { return "melee"; },
|    | 187|+		"GetBestAttackAgainst": function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		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
| 185| 185| 		GetRange: function() { return { "max": 10, "min": 0}; },
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188|    |-		GetPreference: function(t) { return 0; },
|    | 188|+		"GetPreference": function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191| 191| 		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
| 186| 186| 		GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189|    |-		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 189|+		"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191| 191| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 192| 192| 	});
|    | [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
| 187| 187| 		GetBestAttackAgainst: function(t) { return "melee"; },
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190|    |-		CanAttack: function(v) { return true; },
|    | 190|+		"CanAttack": function(v) { return true; },
| 191| 191| 		CompareEntitiesByPreference: function(a, b) { return 0; },
| 192| 192| 	});
| 193| 193| 
|    | [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
| 188| 188| 		GetPreference: function(t) { return 0; },
| 189| 189| 		GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 190| 190| 		CanAttack: function(v) { return true; },
| 191|    |-		CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 191|+		"CompareEntitiesByPreference": function(a, b) { return 0; },
| 192| 192| 	});
| 193| 193| 
| 194| 194| 	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
| 199| 199| 	if (mode == 1)
| 200| 200| 	{
| 201| 201| 		AddMock(enemy, IID_Health, {
| 202|    |-			GetHitpoints: function() { return 10; },
|    | 202|+			"GetHitpoints": function() { return 10; },
| 203| 203| 		});
| 204| 204| 		AddMock(enemy, IID_UnitAI, {
| 205| 205| 			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
| 202| 202| 			GetHitpoints: function() { return 10; },
| 203| 203| 		});
| 204| 204| 		AddMock(enemy, IID_UnitAI, {
| 205|    |-			IsAnimal: function() { return false; }
|    | 205|+			"IsAnimal": function() { return false; }
| 206| 206| 		});
| 207| 207| 	}
| 208| 208| 	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
| 207| 207| 	}
| 208| 208| 	else if (mode == 2)
| 209| 209| 		AddMock(enemy, IID_Health, {
| 210|    |-			GetHitpoints: function() { return 0; },
|    | 210|+			"GetHitpoints": function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213| 213| 	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
| 210| 210| 			GetHitpoints: function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 213|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	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
| 210| 210| 			GetHitpoints: function() { return 0; },
| 211| 211| 		});
| 212| 212| 
| 213|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 213|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	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
| 214| 214| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 215| 215| 
| 216| 216| 	AddMock(controller, IID_Position, {
| 217|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 217|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		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
| 215| 215| 
| 216| 216| 	AddMock(controller, IID_Position, {
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 218|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		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
| 216| 216| 	AddMock(controller, IID_Position, {
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 219|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222| 222| 		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
| 217| 217| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 220|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222| 222| 		IsInWorld: function() { return true; },
| 223| 223| 	});
|    | [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
| 218| 218| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 221|+		"GetRotation": function() { return { "y": 0 }; },
| 222| 222| 		IsInWorld: function() { return true; },
| 223| 223| 	});
| 224| 224| 
|    | [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
| 219| 219| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 220| 220| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 221| 221| 		GetRotation: function() { return { "y": 0 }; },
| 222|    |-		IsInWorld: function() { return true; },
|    | 222|+		"IsInWorld": function() { return true; },
| 223| 223| 	});
| 224| 224| 
| 225| 225| 	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
| 270| 270| 	var unitAIs = [];
| 271| 271| 
| 272| 272| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 273|    |-		SetInterval: function() { },
|    | 273|+		"SetInterval": function() { },
| 274| 274| 		SetTimeout: function() { },
| 275| 275| 	});
| 276| 276| 
|    | [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
| 271| 271| 
| 272| 272| 	AddMock(SYSTEM_ENTITY, IID_Timer, {
| 273| 273| 		SetInterval: function() { },
| 274|    |-		SetTimeout: function() { },
|    | 274|+		"SetTimeout": function() { },
| 275| 275| 	});
| 276| 276| 
| 277| 277| 
|    | [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
| 276| 276| 
| 277| 277| 
| 278| 278| 	AddMock(SYSTEM_ENTITY, IID_RangeManager, {
| 279|    |-		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
|    | 279|+		"CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) {
| 280| 280| 			return 1;
| 281| 281| 		},
| 282| 282| 		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
| 279| 279| 		CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) {
| 280| 280| 			return 1;
| 281| 281| 		},
| 282|    |-		EnableActiveQuery: function(id) { },
|    | 282|+		"EnableActiveQuery": function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285| 285| 		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
| 280| 280| 			return 1;
| 281| 281| 		},
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283|    |-		ResetActiveQuery: function(id) { return [enemy]; },
|    | 283|+		"ResetActiveQuery": function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285| 285| 		GetEntityFlagMask: function(identifier) { },
| 286| 286| 	});
|    | [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
| 281| 281| 		},
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284|    |-		DisableActiveQuery: function(id) { },
|    | 284|+		"DisableActiveQuery": function(id) { },
| 285| 285| 		GetEntityFlagMask: function(identifier) { },
| 286| 286| 	});
| 287| 287| 
|    | [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
| 282| 282| 		EnableActiveQuery: function(id) { },
| 283| 283| 		ResetActiveQuery: function(id) { return [enemy]; },
| 284| 284| 		DisableActiveQuery: function(id) { },
| 285|    |-		GetEntityFlagMask: function(identifier) { },
|    | 285|+		"GetEntityFlagMask": function(identifier) { },
| 286| 286| 	});
| 287| 287| 
| 288| 288| 	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
| 286| 286| 	});
| 287| 287| 
| 288| 288| 	AddMock(SYSTEM_ENTITY, IID_TemplateManager, {
| 289|    |-		GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; },
|    | 289|+		"GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; },
| 290| 290| 	});
| 291| 291| 
| 292| 292| 	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
| 290| 290| 	});
| 291| 291| 
| 292| 292| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 293|    |-		GetPlayerByID: function(id) { return playerEntity; },
|    | 293|+		"GetPlayerByID": function(id) { return playerEntity; },
| 294| 294| 		GetNumPlayers: function() { return 2; },
| 295| 295| 	});
| 296| 296| 
|    | [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
| 291| 291| 
| 292| 292| 	AddMock(SYSTEM_ENTITY, IID_PlayerManager, {
| 293| 293| 		GetPlayerByID: function(id) { return playerEntity; },
| 294|    |-		GetNumPlayers: function() { return 2; },
|    | 294|+		"GetNumPlayers": function() { return 2; },
| 295| 295| 	});
| 296| 296| 
| 297| 297| 	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
| 299| 299| 	});
| 300| 300| 
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302|    |-		IsAlly: function() { return false; },
|    | 302|+		"IsAlly": function() { return false; },
| 303| 303| 		IsEnemy: function() { return true; },
| 304| 304| 		GetEnemies: function() { return [2]; },
| 305| 305| 	});
|    | [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
| 300| 300| 
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302| 302| 		IsAlly: function() { return false; },
| 303|    |-		IsEnemy: function() { return true; },
|    | 303|+		"IsEnemy": function() { return true; },
| 304| 304| 		GetEnemies: function() { return [2]; },
| 305| 305| 	});
| 306| 306| 
|    | [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
| 301| 301| 	AddMock(playerEntity, IID_Player, {
| 302| 302| 		IsAlly: function() { return false; },
| 303| 303| 		IsEnemy: function() { return true; },
| 304|    |-		GetEnemies: function() { return [2]; },
|    | 304|+		"GetEnemies": function() { return [2]; },
| 305| 305| 	});
| 306| 306| 
| 307| 307| 	// 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
| 312| 312| 		var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" });
| 313| 313| 
| 314| 314| 		AddMock(unit + i, IID_Identity, {
| 315|    |-			GetClassesList: function() { return []; },
|    | 315|+			"GetClassesList": function() { return []; },
| 316| 316| 		});
| 317| 317| 
| 318| 318| 		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
| 316| 316| 		});
| 317| 317| 
| 318| 318| 		AddMock(unit + i, IID_Ownership, {
| 319|    |-			GetOwner: function() { return 1; },
|    | 319|+			"GetOwner": function() { return 1; },
| 320| 320| 		});
| 321| 321| 
| 322| 322| 		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
| 320| 320| 		});
| 321| 321| 
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323|    |-			GetTurretParent: function() { return INVALID_ENTITY; },
|    | 323|+			"GetTurretParent": function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			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
| 321| 321| 
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324|    |-			GetPosition: function() { return new Vector3D(); },
|    | 324|+			"GetPosition": function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327| 327| 			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
| 322| 322| 		AddMock(unit + i, IID_Position, {
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325|    |-			GetPosition2D: function() { return new Vector2D(); },
|    | 325|+			"GetPosition2D": function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327| 327| 			IsInWorld: function() { return true; },
| 328| 328| 		});
|    | [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
| 323| 323| 			GetTurretParent: function() { return INVALID_ENTITY; },
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326|    |-			GetRotation: function() { return { "y": 0 }; },
|    | 326|+			"GetRotation": function() { return { "y": 0 }; },
| 327| 327| 			IsInWorld: function() { return true; },
| 328| 328| 		});
| 329| 329| 
|    | [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
| 324| 324| 			GetPosition: function() { return new Vector3D(); },
| 325| 325| 			GetPosition2D: function() { return new Vector2D(); },
| 326| 326| 			GetRotation: function() { return { "y": 0 }; },
| 327|    |-			IsInWorld: function() { return true; },
|    | 327|+			"IsInWorld": function() { return true; },
| 328| 328| 		});
| 329| 329| 
| 330| 330| 		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
| 337| 337| 		});
| 338| 338| 
| 339| 339| 		AddMock(unit + i, IID_Vision, {
| 340|    |-			GetRange: function() { return 10; },
|    | 340|+			"GetRange": function() { return 10; },
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			"GetRange": function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return { "max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return {"max": 10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 341| 341| 		});
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344|    |-			GetRange: function() { return {"max":10, "min": 0}; },
|    | 344|+			GetRange: function() { return {"max":10, "min": 0 }; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			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
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 345|+			"GetFullAttackRange": function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			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
| 342| 342| 
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345|    |-			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
|    | 345|+			GetFullAttackRange: function() { return { "max": 40, "min": 0 }; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			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
| 343| 343| 		AddMock(unit + i, IID_Attack, {
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346|    |-			GetBestAttackAgainst: function(t) { return "melee"; },
|    | 346|+			"GetBestAttackAgainst": function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349| 349| 			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
| 344| 344| 			GetRange: function() { return {"max":10, "min": 0}; },
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347|    |-			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
|    | 347|+			"GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349| 349| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 350| 350| 		});
|    | [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
| 345| 345| 			GetFullAttackRange: function() { return { "max": 40, "min": 0}; },
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348|    |-			CanAttack: function(v) { return true; },
|    | 348|+			"CanAttack": function(v) { return true; },
| 349| 349| 			CompareEntitiesByPreference: function(a, b) { return 0; },
| 350| 350| 		});
| 351| 351| 
|    | [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
| 346| 346| 			GetBestAttackAgainst: function(t) { return "melee"; },
| 347| 347| 			GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; },
| 348| 348| 			CanAttack: function(v) { return true; },
| 349|    |-			CompareEntitiesByPreference: function(a, b) { return 0; },
|    | 349|+			"CompareEntitiesByPreference": function(a, b) { return 0; },
| 350| 350| 		});
| 351| 351| 
| 352| 352| 		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
| 358| 358| 
| 359| 359| 	// create enemy
| 360| 360| 	AddMock(enemy, IID_Health, {
| 361|    |-		GetHitpoints: function() { return 40; },
|    | 361|+		"GetHitpoints": function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364| 364| 	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
| 361| 361| 		GetHitpoints: function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 364|+	var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	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
| 361| 361| 		GetHitpoints: function() { return 40; },
| 362| 362| 	});
| 363| 363| 
| 364|    |-	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0});
|    | 364|+	var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 });
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	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
| 365| 365| 	var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" });
| 366| 366| 
| 367| 367| 	AddMock(controller, IID_Position, {
| 368|    |-		GetTurretParent: function() { return INVALID_ENTITY; },
|    | 368|+		"GetTurretParent": function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		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
| 366| 366| 
| 367| 367| 	AddMock(controller, IID_Position, {
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369|    |-		JumpTo: function(x, z) { this.x = x; this.z = z; },
|    | 369|+		"JumpTo": function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		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
| 367| 367| 	AddMock(controller, IID_Position, {
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370|    |-		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
|    | 370|+		"GetPosition": function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373| 373| 		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
| 368| 368| 		GetTurretParent: function() { return INVALID_ENTITY; },
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371|    |-		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
|    | 371|+		"GetPosition2D": function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373| 373| 		IsInWorld: function() { return true; },
| 374| 374| 	});
|    | [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
| 369| 369| 		JumpTo: function(x, z) { this.x = x; this.z = z; },
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372|    |-		GetRotation: function() { return { "y": 0 }; },
|    | 372|+		"GetRotation": function() { return { "y": 0 }; },
| 373| 373| 		IsInWorld: function() { return true; },
| 374| 374| 	});
| 375| 375| 
|    | [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
| 370| 370| 		GetPosition: function() { return new Vector3D(this.x, 0, this.z); },
| 371| 371| 		GetPosition2D: function() { return new Vector2D(this.x, this.z); },
| 372| 372| 		GetRotation: function() { return { "y": 0 }; },
| 373|    |-		IsInWorld: function() { return true; },
|    | 373|+		"IsInWorld": function() { return true; },
| 374| 374| 	});
| 375| 375| 
| 376| 376| 	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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		"GetRange": function() { return {"max":10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return { "max":10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return {"max": 10, "min": 0}; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 383| 383| 	});
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386|    |-		GetRange: function() { return {"max":10, "min": 0}; },
|    | 386|+		GetRange: function() { return {"max":10, "min": 0 }; },
| 387| 387| 		CanAttackAsFormation: function() { return false; },
| 388| 388| 	});
| 389| 389| 
|    | [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
| 384| 384| 
| 385| 385| 	AddMock(controller, IID_Attack, {
| 386| 386| 		GetRange: function() { return {"max":10, "min": 0}; },
| 387|    |-		CanAttackAsFormation: function() { return false; },
|    | 387|+		"CanAttackAsFormation": function() { return false; },
| 388| 388| 	});
| 389| 389| 
| 390| 390| 	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
| 396| 396| 	for (var ent of unitAIs)
| 397| 397| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 398| 398| 
| 399|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 399|+	controllerAI.MoveIntoFormation({ "name": "Circle"});
| 400| 400| 
| 401| 401| 	// let all units be in position
| 402| 402| 	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
| 396| 396| 	for (var ent of unitAIs)
| 397| 397| 		TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING");
| 398| 398| 
| 399|    |-	controllerAI.MoveIntoFormation({"name": "Circle"});
|    | 399|+	controllerAI.MoveIntoFormation({"name": "Circle" });
| 400| 400| 
| 401| 401| 	// let all units be in position
| 402| 402| 	for (var ent of unitAIs)

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 129| »   »   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
| 308| »   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
| 402| »   for·(var·ent·of·unitAIs)
|    | [NORMAL] JSHintBear:
|    | 'ent' is already defined.

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

binaries/data/mods/public/simulation/components/tests/test_UnitAI.js
| 397| »   »   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
| 406| »   »   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
|2055|2055| 
|2056|2056| 				"Attacked": function(msg) {
|2057|2057| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2058|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2059|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2058|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2059|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2060|2060| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2061|2061| 				},
|2062|2062| 			},
|    | [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
|2214|2214| 					"MovementUpdate": function(msg) {
|2215|2215| 						// If it looks like the path is failing, and we are close enough (3 tiles) from wanted range
|2216|2216| 						// stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably.
|2217|    |-						if (msg.likelyFailure || 
|    |2217|+						if (msg.likelyFailure ||
|2218|2218| 							msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) ||
|2219|2219| 							!msg.obstructed && this.CheckRange(this.order.data))
|2220|2220| 							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
|2856|2856| 					{
|2857|2857| 						// The building was already finished/fully repaired before we arrived;
|2858|2858| 						// let the ConstructionFinished handler handle this.
|2859|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2859|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2860|2860| 						return true;
|2861|2861| 					}
|2862|2862| 
|    | [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
|2856|2856| 					{
|2857|2857| 						// The building was already finished/fully repaired before we arrived;
|2858|2858| 						// let the ConstructionFinished handler handle this.
|2859|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2859|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2860|2860| 						return true;
|2861|2861| 					}
|2862|2862| 
|    | [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
|3154|3154| 				this.StopTimer();
|3155|3155| 				this.ResetAnimation();
|3156|3156| 				if (this.formationAnimationVariant)
|3157|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3157|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3158|3158| 				else
|3159|3159| 					this.SetDefaultAnimationVariant();
|3160|3160| 				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
|3380|3380| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3381|3381| 
|3382|3382| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3383|    |-							// only used for domestic animals
|    |3383|+		// only used for domestic animals
|3384|3384| 
|3385|3385| 		// Reuse the same garrison behaviour for animals.
|3386|3386| 		"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
|3442|3442| 
|3443|3443| UnitAI.prototype.IsAnimal = function()
|3444|3444| {
|3445|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3445|+	return (!!this.template.NaturalBehaviour);
|3446|3446| };
|3447|3447| 
|3448|3448| 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
|3558|3558| 		{
|3559|3559| 			let index = this.GetCurrentState().indexOf(".");
|3560|3560| 			if (index != -1)
|3561|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3561|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3562|3562| 			this.Stop(false);
|3563|3563| 		}
|3564|3564| 
|    | [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
|3614|3614| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3615|3615| 			continue;
|3616|3616| 		if (i == 0)
|3617|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3617|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3618|3618| 		else
|3619|3619| 			this.orderQueue.splice(i, 1);
|3620|3620| 		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
|3614|3614| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3615|3615| 			continue;
|3616|3616| 		if (i == 0)
|3617|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3617|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3618|3618| 		else
|3619|3619| 			this.orderQueue.splice(i, 1);
|3620|3620| 		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
|3701|3701| };
|3702|3702| 
|3703|3703| 
|3704|    |-//// FSM linkage functions ////
|    |3704|+// // FSM linkage functions ////
|3705|3705| 
|3706|3706| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3707|3707| 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
|3872|3872| 				continue;
|3873|3873| 			if (this.orderQueue[i].type == type)
|3874|3874| 				continue;
|3875|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3875|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3876|3876| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3877|3877| 			return;
|3878|3878| 		}
|    | [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
|3872|3872| 				continue;
|3873|3873| 			if (this.orderQueue[i].type == type)
|3874|3874| 				continue;
|3875|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3875|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3876|3876| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3877|3877| 			return;
|3878|3878| 		}
|    | [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
|4114|4114| 	if (data.timerRepeat === undefined)
|4115|4115| 		this.timer = undefined;
|4116|4116| 
|4117|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4117|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4118|4118| };
|4119|4119| 
|4120|4120| /**
|    | [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
|4114|4114| 	if (data.timerRepeat === undefined)
|4115|4115| 		this.timer = undefined;
|4116|4116| 
|4117|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4117|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4118|4118| };
|4119|4119| 
|4120|4120| /**
|    | [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
|4159|4159| 	// TODO: This is a bit inefficient since every unit listens to every
|4160|4160| 	// construction message - ideally we could scope it to only the one we're building
|4161|4161| 
|4162|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4162|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4163|4163| };
|4164|4164| 
|4165|4165| 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
|4159|4159| 	// TODO: This is a bit inefficient since every unit listens to every
|4160|4160| 	// construction message - ideally we could scope it to only the one we're building
|4161|4161| 
|4162|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4162|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4163|4163| };
|4164|4164| 
|4165|4165| 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
|4198|4198| 	if (msg.fromStatusEffect)
|4199|4199| 		return;
|4200|4200| 
|4201|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4201|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4202|4202| };
|4203|4203| 
|4204|4204| 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
|4198|4198| 	if (msg.fromStatusEffect)
|4199|4199| 		return;
|4200|4200| 
|4201|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4201|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4202|4202| };
|4203|4203| 
|4204|4204| 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
|4203|4203| 
|4204|4204| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4205|4205| {
|4206|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4206|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4207|4207| };
|4208|4208| 
|4209|4209| 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
|4203|4203| 
|4204|4204| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4205|4205| {
|4206|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4206|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4207|4207| };
|4208|4208| 
|4209|4209| 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
|4208|4208| 
|4209|4209| UnitAI.prototype.OnHealthChanged = function(msg)
|4210|4210| {
|4211|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4211|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4212|4212| };
|4213|4213| 
|4214|4214| 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
|4208|4208| 
|4209|4209| UnitAI.prototype.OnHealthChanged = function(msg)
|4210|4210| {
|4211|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4211|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4212|4212| };
|4213|4213| 
|4214|4214| 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
|4214|4214| UnitAI.prototype.OnRangeUpdate = function(msg)
|4215|4215| {
|4216|4216| 	if (msg.tag == this.losRangeQuery)
|4217|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4217|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4218|4218| 	else if (msg.tag == this.losHealRangeQuery)
|4219|4219| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4220|4220| };
|    | [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
|4214|4214| UnitAI.prototype.OnRangeUpdate = function(msg)
|4215|4215| {
|4216|4216| 	if (msg.tag == this.losRangeQuery)
|4217|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4217|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4218|4218| 	else if (msg.tag == this.losHealRangeQuery)
|4219|4219| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4220|4220| };
|    | [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
|4216|4216| 	if (msg.tag == this.losRangeQuery)
|4217|4217| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4218|4218| 	else if (msg.tag == this.losHealRangeQuery)
|4219|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4219|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4220|4220| };
|4221|4221| 
|4222|4222| 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
|4216|4216| 	if (msg.tag == this.losRangeQuery)
|4217|4217| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4218|4218| 	else if (msg.tag == this.losHealRangeQuery)
|4219|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4219|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4220|4220| };
|4221|4221| 
|4222|4222| 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
|4221|4221| 
|4222|4222| UnitAI.prototype.OnPackFinished = function(msg)
|4223|4223| {
|4224|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4224|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4225|4225| };
|4226|4226| 
|4227|4227| //// 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
|4221|4221| 
|4222|4222| UnitAI.prototype.OnPackFinished = function(msg)
|4223|4223| {
|4224|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4224|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4225|4225| };
|4226|4226| 
|4227|4227| //// 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
|4224|4224| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4225|4225| };
|4226|4226| 
|4227|    |-//// Helper functions to be called by the FSM ////
|    |4227|+// // Helper functions to be called by the FSM ////
|4228|4228| 
|4229|4229| UnitAI.prototype.GetWalkSpeed = function()
|4230|4230| {
|    | [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
|4936|4936| UnitAI.prototype.AttackEntityInZone = function(ents)
|4937|4937| {
|4938|4938| 	var target = ents.find(target =>
|4939|    |-		this.CanAttack(target)
|4940|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4939|+		this.CanAttack(target) &&
|    |4940|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4941|4941| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4942|4942| 	);
|4943|4943| 	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
|4937|4937| {
|4938|4938| 	var target = ents.find(target =>
|4939|4939| 		this.CanAttack(target)
|4940|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4941|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4940|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4941|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4942|4942| 	);
|4943|4943| 	if (!target)
|4944|4944| 		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
|5003|5003| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|5004|5004| 	if (this.isGuardOf)
|5005|5005| 	{
|5006|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5006|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5007|5007| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5008|5008| 		if (cmpUnitAI && cmpAttack &&
|5009|5009| 		    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
|5007|5007| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5008|5008| 		if (cmpUnitAI && cmpAttack &&
|5009|5009| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|5010|    |-				return false;
|    |5010|+			return false;
|5011|5011| 	}
|5012|5012| 
|5013|5013| 	// 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
|5045|5045| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|5046|5046| 	if (this.isGuardOf)
|5047|5047| 	{
|5048|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |5048|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|5049|5049| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|5050|5050| 		if (cmpUnitAI && cmpAttack &&
|5051|5051| 		    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
|5058|5058| 	return false;
|5059|5059| };
|5060|5060| 
|5061|    |-//// External interface functions ////
|    |5061|+// // External interface functions ////
|5062|5062| 
|5063|5063| UnitAI.prototype.SetFormationController = function(ent)
|5064|5064| {
|    | [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
|5214|5214| 	{
|5215|5215| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5216|5216| 			return;
|5217|    |-		else
|5218|    |-			this.RemoveGuard();
|    |5217|+		this.RemoveGuard();
|5219|5218| 	}
|5220|5219| 
|5221|5220| 	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
|5545|5545| 
|5546|5546| 	if (this.IsFormationController())
|5547|5547| 		this.CallMemberFunction("CancelSetupTradeRoute", [target]);
|5548|    |-}
|    |5548|+};
|5549|5549| /**
|5550|5550|  * Adds trade order to the queue. Either walk to the first market, or
|5551|5551|  * 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
|5566|5566| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5567|5567| 	{
|5568|5568| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5569|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5569|+		if (cmpTrader.HasBothMarkets() &&
|5570|5570| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5571|5571| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5572|5572| 		{
|    | [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
|5847|5847| 				{
|5848|5848| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5849|5849| 					var targetClasses = this.order.data.targetClasses;
|5850|    |-					if (targetClasses.attack && cmpIdentity
|5851|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5850|+					if (targetClasses.attack && cmpIdentity &&
|    |5851|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5852|5852| 						continue;
|5853|5853| 					if (targetClasses.avoid && cmpIdentity
|5854|5854| 						&& 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
|5850|5850| 					if (targetClasses.attack && cmpIdentity
|5851|5851| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5852|5852| 						continue;
|5853|    |-					if (targetClasses.avoid && cmpIdentity
|5854|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5853|+					if (targetClasses.avoid && cmpIdentity &&
|    |5854|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5855|5855| 						continue;
|5856|5856| 					// Only used by the AIs to prevent some choices of targets
|5857|5857| 					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
|5873|5873| 		{
|5874|5874| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5875|5875| 			var targetClasses = this.order.data.targetClasses;
|5876|    |-			if (cmpIdentity && targetClasses.attack
|5877|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5876|+			if (cmpIdentity && targetClasses.attack &&
|    |5877|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5878|5878| 				continue;
|5879|5879| 			if (cmpIdentity && targetClasses.avoid
|5880|5880| 				&& 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
|5876|5876| 			if (cmpIdentity && targetClasses.attack
|5877|5877| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5878|5878| 				continue;
|5879|    |-			if (cmpIdentity && targetClasses.avoid
|5880|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5879|+			if (cmpIdentity && targetClasses.avoid &&
|    |5880|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5881|5881| 				continue;
|5882|5882| 			// Only used by the AIs to prevent some choices of targets
|5883|5883| 			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
|6019|6019| 
|6020|6020| UnitAI.prototype.SetHeldPosition = function(x, z)
|6021|6021| {
|6022|    |-	this.heldPosition = {"x": x, "z": z};
|    |6022|+	this.heldPosition = { "x": x, "z": z};
|6023|6023| };
|6024|6024| 
|6025|6025| 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
|6019|6019| 
|6020|6020| UnitAI.prototype.SetHeldPosition = function(x, z)
|6021|6021| {
|6022|    |-	this.heldPosition = {"x": x, "z": z};
|    |6022|+	this.heldPosition = {"x": x, "z": z };
|6023|6023| };
|6024|6024| 
|6025|6025| 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
|6046|6046| 	return false;
|6047|6047| };
|6048|6048| 
|6049|    |-//// Helper functions ////
|    |6049|+// // Helper functions ////
|6050|6050| 
|6051|6051| /**
|6052|6052|  * 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
|6065|6065| 		return undefined;
|6066|6066| 
|6067|6067| 	return component.GetRange(type);
|6068|    |-}
|    |6068|+};
|6069|6069| 
|6070|6070| UnitAI.prototype.CanAttack = function(target)
|6071|6071| {
|    | [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
|6233|6233| 	return cmpPack && cmpPack.IsPacking();
|6234|6234| };
|6235|6235| 
|6236|    |-//// Formation specific functions ////
|    |6236|+// // Formation specific functions ////
|6237|6237| 
|6238|6238| UnitAI.prototype.IsAttackingAsFormation = function()
|6239|6239| {
|    | [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
|6238|6238| UnitAI.prototype.IsAttackingAsFormation = function()
|6239|6239| {
|6240|6240| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6241|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6242|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6241|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6242|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6243|6243| };
|6244|6244| 
|6245|6245| //// 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
|6242|6242| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6243|6243| };
|6244|6244| 
|6245|    |-//// Animal specific functions ////
|    |6245|+// // Animal specific functions ////
|6246|6246| 
|6247|6247| UnitAI.prototype.MoveRandomly = function(distance)
|6248|6248| {

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
|4019| »   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
|4923| »   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
|4938| »   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
|4986| »   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
|5009| »   »   ····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
|2059| »   »   »   »   »   »   &&·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
|3157| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4940| »   »   &&·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
|4941| »   »   &&·(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
|5548| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5877| »   »   »   »   &&·!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
|5880| »   »   »   »   &&·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
|6068| }
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

binaries/data/mods/public/simulation/components/UnitAI.js
|6242| »   »   &&·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/2171/display/redirect

wraitii added inline comments.May 20 2020, 6:53 PM
binaries/data/mods/public/simulation/components/UnitAI.js
198

?

2023

There is a precedent for checking explicit states in "ConstructionFinished" in "REPAIR" btw.

This revision was not accepted when it landed; it landed in state Needs Review.May 29 2020, 7:01 PM
This revision was automatically updated to reflect the committed changes.