Page MenuHomeWildfire Games

Use Phalanx animation
ClosedPublic

Authored by Stan on Dec 7 2017, 2:46 PM.

Details

Reviewers
wowgetoffyourcellphone
elexis
Trac Tickets
#4832
Summary

rP19095 added a Phalanx animation.
But since (rP14534?) the Phalanx animation was available for all template_unit_infantry_melee.xml.
When that formation selected, the units had no walk animation while moving in formation.
Hence it was reverted in rP19904.
But as wowgetoffyourcellphone pointed out, the correct fix is to make the formation available to less templates.

Test Plan

Can someone explain me which units exactly have that animation? All spearmen? All Hoplites? What exactly is a Hoplite then? (A better criteria would be a reference to some phalanx animation filename).

Diff Detail

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

Event Timeline

elexis created this revision.Dec 7 2017, 2:46 PM
Vulcan added a subscriber: Vulcan.Dec 7 2017, 3:35 PM

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Vulcan added a comment.Dec 7 2017, 3:36 PM
Executing section Default...
Executing section Source...
Executing section JS...
Stan added a comment.EditedDec 10 2017, 7:11 PM

So for the Phalanx formation. If you play with gauls not matter the unit you use you don't have access to that formation.
if you play Athens, you have access to the formations but only with the spearman with the

<Formations datatype="tokens">special/formations/phalanx</Formations>

(It's not based at all on visible or invisible classes) , if you have let's
say iberian spearman you cant use that formation on them, If you mix units that are hoplites and other that are not, only
the hoplites use the formation. If you mix two types of hoplites like base athen and pers khardakes both have the formation

Units have the anim while moving, but not when idle in the formation (dunno if it's intended)

tldr; If you want to give a unit a formation you have to allow the civ to have it, and put the token in the unit template.

My question wasn't how the simulation works, but which actors actually have the formation, so that we can adapt the simulation templates to the art.
Are it all spearmen actors or only some spearmen actors?
I would say that every unit that has the phalanx animation should have the chance to perform the phalanx animation, if it's historically possible that they used this. (I guess gaul champs did't know about phalanx unless they copied rome).
As long as there aren't units changing their position without having any kind of walk animation at all it should be good enough.

Stan added a comment.Dec 10 2017, 7:45 PM

Only some have the anims + the formation

athen_champion_infantry
athen_infantry_spearman_b
mace_champion_infantry_a
pers_kardakes_hoplite
spart_champion_infantry_spear
spart_infantry_spearman_a
spart_infantry_spearman_e

Those do but glide (notice some of them shouldn't)

athen_black_cloak
maur_champion_maiden
maur_champion_infantry_barracks
merc_black_cloak
merc_thorakites
pers_arstibara
rome_legionnaire_imperial
sele_champion_infantry_swordsman
sele_infantry_pikeman_b
spart_champion_infantry_pike
spart_thorakites

Those have neither of the anims nor the formation access

mace_infantry_pikeman_e
sele_champion_infantry_pikeman

I think all variants a,e,b of the above have the same behaviour as their counterpart, but that maybe needs checking.

athen_champion_infantry
athen_infantry_spearman_b
mace_champion_infantry_a
pers_kardakes_hoplite
spart_champion_infantry_spear
spart_infantry_spearman_b
thebes_sacred_band_hoplitai

Those are the units in public mod which are "hoplites" if I remember correctly. In DE I will make a hoplite parent template, since hoplites have different stats from "regular" spearmen in DE and the mod simply has more of them. But I don't think that's the case in public mod, so your approach looks good.

Stan requested changes to this revision.Dec 20 2017, 3:04 PM

My understanding is the following, the templates above that are not hoplites should not have the phalanx anims.
Seleucids and spartans units refered above that do not should have them. Seleucids did use the Phalanx.

This revision now requires changes to proceed.Dec 20 2017, 3:04 PM

So adding a Hoplite parent template would mean that we only require one template with this Formation.
As I'm neither responsible or currently motivated to implement correct Formation properties and a Hoplite parent template, I wouldn't refuse someone else doing the code and review.

binaries/data/mods/public/simulation/templates/template_unit_infantry_melee.xml
22

A completeness test of a review might might check if Testudo is available for all melee infantry.

Stan added a subscriber: s0600204.Dec 24 2017, 11:04 PM

@s0600204 Do you have any opinion on this ?

Since you are more knowledgeable than me on XML stuff do you think it'd be a good idea to create a parent hoplite template from which units with the Phalanx anim would inherit ? Also since pikemen used a different type of Phalanx according to bb_ should that be removed from the other files ?

Stan commandeered this revision.Feb 14 2018, 10:56 PM
Stan edited reviewers, added: elexis; removed: Stan.

I'm taking this on.

My way on seeing this is the following every unit having the hoplite animation should use the phalanx.

It makes sense for Carthage, Sparta, Mace, Athen, That lone Theban unit that should be moved, and visibly sense for the persian as well.

I think there is a confusion between syntagma and phalanx, but I don't have that knowledge. Pikeman will get syntagma, as for testudo, only roman units should have it.

Stan updated this revision to Diff 5784.Feb 14 2018, 11:01 PM

Here is my proposed fix.

Every hoplite unit of the game including heroes get the phalanx anim.
To decide whether a unit is a hoplite or not, just see if they inherit the hoplite variant (base_hoplite.xml). Currently 23 units match. A little less have templates so the others are not included.

Add the phalanx anim calls,
Fix incorrect naming in the previous patch for the back.
Add three templates to be inherited from, which only change the ability to have that formation. Since it has only a cosmetic aspect there SHOULD not be any influence.

UnitAI changes fix the idle anim of the formation, which was broken. If someone wants to do some archaeology to find the responsible commit go ahead.

So test if it works, test I did not break anything. https://imgur.com/a/x5GCe

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

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  73|  73| // do worry around armies slaughtering the guy standing next to you), etc.
|  74|  74| var g_Stances = {
|  75|  75| 	"violent": {
|  76|    |-		targetVisibleEnemies: true,
|    |  76|+		"targetVisibleEnemies": true,
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  74|  74| var g_Stances = {
|  75|  75| 	"violent": {
|  76|  76| 		targetVisibleEnemies: true,
|  77|    |-		targetAttackersAlways: true,
|    |  77|+		"targetAttackersAlways": true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  75|  75| 	"violent": {
|  76|  76| 		targetVisibleEnemies: true,
|  77|  77| 		targetAttackersAlways: true,
|  78|    |-		respondFlee: false,
|    |  78|+		"respondFlee": false,
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|  81| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  76|  76| 		targetVisibleEnemies: true,
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|    |-		respondChase: true,
|    |  79|+		"respondChase": true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|  81| 		respondStandGround: false,
|  82|  82| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|  80|    |-		respondChaseBeyondVision: true,
|    |  80|+		"respondChaseBeyondVision": true,
|  81|  81| 		respondStandGround: false,
|  82|  82| 		respondHoldGround: false,
|  83|  83| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|    |-		respondStandGround: false,
|    |  81|+		"respondStandGround": false,
|  82|  82| 		respondHoldGround: false,
|  83|  83| 	},
|  84|  84| 	"aggressive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|  81| 		respondStandGround: false,
|  82|    |-		respondHoldGround: false,
|    |  82|+		"respondHoldGround": false,
|  83|  83| 	},
|  84|  84| 	"aggressive": {
|  85|  85| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  82|  82| 		respondHoldGround: false,
|  83|  83| 	},
|  84|  84| 	"aggressive": {
|  85|    |-		targetVisibleEnemies: true,
|    |  85|+		"targetVisibleEnemies": true,
|  86|  86| 		targetAttackersAlways: false,
|  87|  87| 		respondFlee: false,
|  88|  88| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  83|  83| 	},
|  84|  84| 	"aggressive": {
|  85|  85| 		targetVisibleEnemies: true,
|  86|    |-		targetAttackersAlways: false,
|    |  86|+		"targetAttackersAlways": false,
|  87|  87| 		respondFlee: false,
|  88|  88| 		respondChase: true,
|  89|  89| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  84|  84| 	"aggressive": {
|  85|  85| 		targetVisibleEnemies: true,
|  86|  86| 		targetAttackersAlways: false,
|  87|    |-		respondFlee: false,
|    |  87|+		"respondFlee": false,
|  88|  88| 		respondChase: true,
|  89|  89| 		respondChaseBeyondVision: false,
|  90|  90| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  85|  85| 		targetVisibleEnemies: true,
|  86|  86| 		targetAttackersAlways: false,
|  87|  87| 		respondFlee: false,
|  88|    |-		respondChase: true,
|    |  88|+		"respondChase": true,
|  89|  89| 		respondChaseBeyondVision: false,
|  90|  90| 		respondStandGround: false,
|  91|  91| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  86|  86| 		targetAttackersAlways: false,
|  87|  87| 		respondFlee: false,
|  88|  88| 		respondChase: true,
|  89|    |-		respondChaseBeyondVision: false,
|    |  89|+		"respondChaseBeyondVision": false,
|  90|  90| 		respondStandGround: false,
|  91|  91| 		respondHoldGround: false,
|  92|  92| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  87|  87| 		respondFlee: false,
|  88|  88| 		respondChase: true,
|  89|  89| 		respondChaseBeyondVision: false,
|  90|    |-		respondStandGround: false,
|    |  90|+		"respondStandGround": false,
|  91|  91| 		respondHoldGround: false,
|  92|  92| 	},
|  93|  93| 	"defensive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  88|  88| 		respondChase: true,
|  89|  89| 		respondChaseBeyondVision: false,
|  90|  90| 		respondStandGround: false,
|  91|    |-		respondHoldGround: false,
|    |  91|+		"respondHoldGround": false,
|  92|  92| 	},
|  93|  93| 	"defensive": {
|  94|  94| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  91|  91| 		respondHoldGround: false,
|  92|  92| 	},
|  93|  93| 	"defensive": {
|  94|    |-		targetVisibleEnemies: true,
|    |  94|+		"targetVisibleEnemies": true,
|  95|  95| 		targetAttackersAlways: false,
|  96|  96| 		respondFlee: false,
|  97|  97| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  92|  92| 	},
|  93|  93| 	"defensive": {
|  94|  94| 		targetVisibleEnemies: true,
|  95|    |-		targetAttackersAlways: false,
|    |  95|+		"targetAttackersAlways": false,
|  96|  96| 		respondFlee: false,
|  97|  97| 		respondChase: false,
|  98|  98| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  93|  93| 	"defensive": {
|  94|  94| 		targetVisibleEnemies: true,
|  95|  95| 		targetAttackersAlways: false,
|  96|    |-		respondFlee: false,
|    |  96|+		"respondFlee": false,
|  97|  97| 		respondChase: false,
|  98|  98| 		respondChaseBeyondVision: false,
|  99|  99| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  94|  94| 		targetVisibleEnemies: true,
|  95|  95| 		targetAttackersAlways: false,
|  96|  96| 		respondFlee: false,
|  97|    |-		respondChase: false,
|    |  97|+		"respondChase": false,
|  98|  98| 		respondChaseBeyondVision: false,
|  99|  99| 		respondStandGround: false,
| 100| 100| 		respondHoldGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  95|  95| 		targetAttackersAlways: false,
|  96|  96| 		respondFlee: false,
|  97|  97| 		respondChase: false,
|  98|    |-		respondChaseBeyondVision: false,
|    |  98|+		"respondChaseBeyondVision": false,
|  99|  99| 		respondStandGround: false,
| 100| 100| 		respondHoldGround: true,
| 101| 101| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  96|  96| 		respondFlee: false,
|  97|  97| 		respondChase: false,
|  98|  98| 		respondChaseBeyondVision: false,
|  99|    |-		respondStandGround: false,
|    |  99|+		"respondStandGround": false,
| 100| 100| 		respondHoldGround: true,
| 101| 101| 	},
| 102| 102| 	"passive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  97|  97| 		respondChase: false,
|  98|  98| 		respondChaseBeyondVision: false,
|  99|  99| 		respondStandGround: false,
| 100|    |-		respondHoldGround: true,
|    | 100|+		"respondHoldGround": true,
| 101| 101| 	},
| 102| 102| 	"passive": {
| 103| 103| 		targetVisibleEnemies: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 100| 100| 		respondHoldGround: true,
| 101| 101| 	},
| 102| 102| 	"passive": {
| 103|    |-		targetVisibleEnemies: false,
|    | 103|+		"targetVisibleEnemies": false,
| 104| 104| 		targetAttackersAlways: false,
| 105| 105| 		respondFlee: true,
| 106| 106| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 101| 101| 	},
| 102| 102| 	"passive": {
| 103| 103| 		targetVisibleEnemies: false,
| 104|    |-		targetAttackersAlways: false,
|    | 104|+		"targetAttackersAlways": false,
| 105| 105| 		respondFlee: true,
| 106| 106| 		respondChase: false,
| 107| 107| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 102| 102| 	"passive": {
| 103| 103| 		targetVisibleEnemies: false,
| 104| 104| 		targetAttackersAlways: false,
| 105|    |-		respondFlee: true,
|    | 105|+		"respondFlee": true,
| 106| 106| 		respondChase: false,
| 107| 107| 		respondChaseBeyondVision: false,
| 108| 108| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 103| 103| 		targetVisibleEnemies: false,
| 104| 104| 		targetAttackersAlways: false,
| 105| 105| 		respondFlee: true,
| 106|    |-		respondChase: false,
|    | 106|+		"respondChase": false,
| 107| 107| 		respondChaseBeyondVision: false,
| 108| 108| 		respondStandGround: false,
| 109| 109| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 104| 104| 		targetAttackersAlways: false,
| 105| 105| 		respondFlee: true,
| 106| 106| 		respondChase: false,
| 107|    |-		respondChaseBeyondVision: false,
|    | 107|+		"respondChaseBeyondVision": false,
| 108| 108| 		respondStandGround: false,
| 109| 109| 		respondHoldGround: false,
| 110| 110| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 105| 105| 		respondFlee: true,
| 106| 106| 		respondChase: false,
| 107| 107| 		respondChaseBeyondVision: false,
| 108|    |-		respondStandGround: false,
|    | 108|+		"respondStandGround": false,
| 109| 109| 		respondHoldGround: false,
| 110| 110| 	},
| 111| 111| 	"standground": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 106| 106| 		respondChase: false,
| 107| 107| 		respondChaseBeyondVision: false,
| 108| 108| 		respondStandGround: false,
| 109|    |-		respondHoldGround: false,
|    | 109|+		"respondHoldGround": false,
| 110| 110| 	},
| 111| 111| 	"standground": {
| 112| 112| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 109| 109| 		respondHoldGround: false,
| 110| 110| 	},
| 111| 111| 	"standground": {
| 112|    |-		targetVisibleEnemies: true,
|    | 112|+		"targetVisibleEnemies": true,
| 113| 113| 		targetAttackersAlways: false,
| 114| 114| 		respondFlee: false,
| 115| 115| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 110| 110| 	},
| 111| 111| 	"standground": {
| 112| 112| 		targetVisibleEnemies: true,
| 113|    |-		targetAttackersAlways: false,
|    | 113|+		"targetAttackersAlways": false,
| 114| 114| 		respondFlee: false,
| 115| 115| 		respondChase: false,
| 116| 116| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 111| 111| 	"standground": {
| 112| 112| 		targetVisibleEnemies: true,
| 113| 113| 		targetAttackersAlways: false,
| 114|    |-		respondFlee: false,
|    | 114|+		"respondFlee": false,
| 115| 115| 		respondChase: false,
| 116| 116| 		respondChaseBeyondVision: false,
| 117| 117| 		respondStandGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 112| 112| 		targetVisibleEnemies: true,
| 113| 113| 		targetAttackersAlways: false,
| 114| 114| 		respondFlee: false,
| 115|    |-		respondChase: false,
|    | 115|+		"respondChase": false,
| 116| 116| 		respondChaseBeyondVision: false,
| 117| 117| 		respondStandGround: true,
| 118| 118| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 113| 113| 		targetAttackersAlways: false,
| 114| 114| 		respondFlee: false,
| 115| 115| 		respondChase: false,
| 116|    |-		respondChaseBeyondVision: false,
|    | 116|+		"respondChaseBeyondVision": false,
| 117| 117| 		respondStandGround: true,
| 118| 118| 		respondHoldGround: false,
| 119| 119| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 114| 114| 		respondFlee: false,
| 115| 115| 		respondChase: false,
| 116| 116| 		respondChaseBeyondVision: false,
| 117|    |-		respondStandGround: true,
|    | 117|+		"respondStandGround": true,
| 118| 118| 		respondHoldGround: false,
| 119| 119| 	},
| 120| 120| };
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 115| 115| 		respondChase: false,
| 116| 116| 		respondChaseBeyondVision: false,
| 117| 117| 		respondStandGround: true,
| 118|    |-		respondHoldGround: false,
|    | 118|+		"respondHoldGround": false,
| 119| 119| 	},
| 120| 120| };
| 121| 121| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 216| 216| 		// Move a tile outside the building
| 217| 217| 		let range = 4;
| 218| 218| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 219|    |-		{
|    | 219|+		
| 220| 220| 			// We've started walking to the given point
| 221| 221| 			this.SetNextState("INDIVIDUAL.WALKING");
| 222|    |-		}
|    | 222|+		
| 223| 223| 		else
| 224| 224| 		{
| 225| 225| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 221| 221| 			this.SetNextState("INDIVIDUAL.WALKING");
| 222| 222| 		}
| 223| 223| 		else
| 224|    |-		{
|    | 224|+		
| 225| 225| 			// We are already at the target, or can't move at all
| 226| 226| 			this.FinishOrder();
| 227|    |-		}
|    | 227|+		
| 228| 228| 	},
| 229| 229| 
| 230| 230| 	// Individual orders:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 326| 326| 
| 327| 327| 		var ok = this.MoveToTarget(this.order.data.target);
| 328| 328| 		if (ok)
| 329|    |-		{
|    | 329|+		
| 330| 330| 			// We've started walking to the given point
| 331| 331| 			if (this.IsAnimal())
| 332| 332| 				this.SetNextState("ANIMAL.WALKING");
| 333| 333| 			else
| 334| 334| 				this.SetNextState("INDIVIDUAL.WALKING");
| 335|    |-		}
|    | 335|+		
| 336| 336| 		else
| 337| 337| 		{
| 338| 338| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 354| 354| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 355| 355| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 356| 356| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 357|    |-		{
|    | 357|+		
| 358| 358| 			// we were already on the shoreline, and have not moved since
| 359| 359| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 360| 360| 				needToMove = false;
| 361|    |-		}
|    | 361|+		
| 362| 362| 
| 363| 363| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 364| 364| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 353| 353| 		var needToMove = true;
| 354| 354| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 355|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 356|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 355|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 356|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 357| 357| 		{
| 358| 358| 			// we were already on the shoreline, and have not moved since
| 359| 359| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 363| 363| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 364| 364| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 365| 365| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 366|    |-		{
|    | 366|+		
| 367| 367| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 368|    |-		}
|    | 368|+		
| 369| 369| 		else
| 370| 370| 		{
| 371| 371| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 392| 392| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 393| 393| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 394| 394| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 395|    |-		{
|    | 395|+		
| 396| 396| 			// We've started fleeing from the given target
| 397| 397| 			if (this.IsAnimal())
| 398| 398| 				this.SetNextState("ANIMAL.FLEEING");
| 399| 399| 			else
| 400| 400| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 401|    |-		}
|    | 401|+		
| 402| 402| 		else
| 403| 403| 		{
| 404| 404| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 448| 448| 			}
| 449| 449| 
| 450| 450| 			if (this.order.data.attackType == this.oldAttackType)
| 451|    |-			{
|    | 451|+			
| 452| 452| 				if (this.IsAnimal())
| 453| 453| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 454| 454| 				else
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456|    |-			}
|    | 456|+			
| 457| 457| 			else
| 458| 458| 			{
| 459| 459| 				if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456| 456| 			}
| 457| 457| 			else
| 458|    |-			{
|    | 458|+			
| 459| 459| 				if (this.IsAnimal())
| 460| 460| 					this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
| 461| 461| 				else
| 462| 462| 					this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
| 463|    |-			}
|    | 463|+			
| 464| 464| 			return;
| 465| 465| 		}
| 466| 466| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 593| 593| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 594| 594| 				}
| 595| 595| 				else
| 596|    |-				{
|    | 596|+				
| 597| 597| 					// We couldn't move there, or the target moved away
| 598| 598| 					this.FinishOrder();
| 599|    |-				}
|    | 599|+				
| 600| 600| 				return;
| 601| 601| 			}
| 602| 602| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 606| 606| 
| 607| 607| 		// Try to move within range
| 608| 608| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 609|    |-		{
|    | 609|+		
| 610| 610| 			// We've started walking to the given point
| 611| 611| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 612|    |-		}
|    | 612|+		
| 613| 613| 		else
| 614| 614| 		{
| 615| 615| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 683| 683| 	"Order.Repair": function(msg) {
| 684| 684| 		// Try to move within range
| 685| 685| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 686|    |-		{
|    | 686|+		
| 687| 687| 			// We've started walking to the given point
| 688| 688| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 689|    |-		}
|    | 689|+		
| 690| 690| 		else
| 691| 691| 		{
| 692| 692| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 720| 720| 		}
| 721| 721| 
| 722| 722| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 723|    |-		{
|    | 723|+		
| 724| 724| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 725|    |-		}
|    | 725|+		
| 726| 726| 		else
| 727| 727| 		{
| 728| 728| 			// We do a range check before actually garrisoning
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 858| 858| 			if (!this.CheckTargetAttackRange(target, target))
| 859| 859| 			{
| 860| 860| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 861|    |-				{
|    | 861|+				
| 862| 862| 					if (this.MoveToTargetAttackRange(target, target))
| 863| 863| 					{
| 864| 864| 						this.SetNextState("COMBAT.APPROACHING");
| 865| 865| 						return;
| 866| 866| 					}
| 867|    |-				}
|    | 867|+				
| 868| 868| 				this.FinishOrder();
| 869| 869| 				return;
| 870| 870| 			}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 883| 883| 			}
| 884| 884| 			// Check if we are already in range, otherwise walk there
| 885| 885| 			if (!this.CheckGarrisonRange(msg.data.target))
| 886|    |-			{
|    | 886|+			
| 887| 887| 				if (!this.CheckTargetVisible(msg.data.target))
| 888| 888| 				{
| 889| 889| 					this.FinishOrder();
| 898| 898| 						return;
| 899| 899| 					}
| 900| 900| 				}
| 901|    |-			}
|    | 901|+			
| 902| 902| 
| 903| 903| 			this.SetNextState("GARRISON.GARRISONING");
| 904| 904| 		},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 890| 890| 					return;
| 891| 891| 				}
| 892| 892| 				else
| 893|    |-				{
|    | 893|+				
| 894| 894| 					// Out of range; move there in formation
| 895| 895| 					if (this.MoveToGarrisonRange(msg.data.target))
| 896| 896| 					{
| 897| 897| 						this.SetNextState("GARRISON.APPROACHING");
| 898| 898| 						return;
| 899| 899| 					}
| 900|    |-				}
|    | 900|+				
| 901| 901| 			}
| 902| 902| 
| 903| 903| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 889| 889| 					this.FinishOrder();
| 890| 890| 					return;
| 891| 891| 				}
| 892|    |-				else
| 893|    |-				{
|    | 892|+				
| 894| 893| 					// Out of range; move there in formation
| 895| 894| 					if (this.MoveToGarrisonRange(msg.data.target))
| 896| 895| 					{
| 897| 896| 						this.SetNextState("GARRISON.APPROACHING");
| 898| 897| 						return;
| 899| 898| 					}
| 900|    |-				}
|    | 899|+				
| 901| 900| 			}
| 902| 901| 
| 903| 902| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 916| 916| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 917| 917| 					}
| 918| 918| 					else
| 919|    |-					{
|    | 919|+					
| 920| 920| 						// We couldn't move there, or the target moved away
| 921| 921| 						this.FinishOrder();
| 922|    |-					}
|    | 922|+					
| 923| 923| 					return;
| 924| 924| 				}
| 925| 925| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1137|1137| 			},
|1138|1138| 		},
|1139|1139| 
|1140|    |-		"GARRISON":{
|    |1140|+		"GARRISON": {
|1141|1141| 			"enter": function() {
|1142|1142| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1143|1143| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1318|1318| 			// If the controller handled an order but some members rejected it,
|1319|1319| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1320|1320| 			if (this.orderQueue.length)
|1321|    |-			{
|    |1321|+			
|1322|1322| 				// We're leaving the formation, so stop our FormationWalk order
|1323|1323| 				if (this.FinishOrder())
|1324|1324| 					return;
|1325|    |-			}
|    |1325|+			
|1326|1326| 
|1327|1327| 			// No orders left, we're an individual now
|1328|1328| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1346|1346| 			// Move a tile outside the building
|1347|1347| 			let range = 4;
|1348|1348| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1349|    |-			{
|    |1349|+			
|1350|1350| 				// We've started walking to the given point
|1351|1351| 				this.SetNextState("WALKINGTOPOINT");
|1352|    |-			}
|    |1352|+			
|1353|1353| 			else
|1354|1354| 			{
|1355|1355| 				// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1351|1351| 				this.SetNextState("WALKINGTOPOINT");
|1352|1352| 			}
|1353|1353| 			else
|1354|    |-			{
|    |1354|+			
|1355|1355| 				// We are already at the target, or can't move at all
|1356|1356| 				this.FinishOrder();
|1357|    |-			}
|    |1357|+			
|1358|1358| 		},
|1359|1359| 
|1360|1360| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1369|1369| 		},
|1370|1370| 
|1371|1371| 		"WALKING": {
|1372|    |-			"enter": function () {
|    |1372|+			"enter": function() {
|1373|1373| 				var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
|1374|1374| 				var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
|1375|1375| 				if (cmpFormation && cmpVisual)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1552|1552| 
|1553|1553| 			"LosRangeUpdate": function(msg) {
|1554|1554| 				if (this.GetStance().targetVisibleEnemies)
|1555|    |-				{
|    |1555|+				
|1556|1556| 					// Start attacking one of the newly-seen enemy (if any)
|1557|1557| 					this.AttackEntitiesByPreference(msg.data.added);
|1558|    |-				}
|    |1558|+				
|1559|1559| 			},
|1560|1560| 
|1561|1561| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1575|1575| 						animationName = cmpFormation.GetFormationAnimation(this.entity, animationName);
|1576|1576| 				}
|1577|1577| 				this.SelectAnimation(animationName);
|1578|    |-				
|    |1578|+
|1579|1579| 			},
|1580|1580| 
|1581|1581| 			"Timer": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1588|1588| 		},
|1589|1589| 
|1590|1590| 		"WALKING": {
|1591|    |-			"enter": function () {
|    |1591|+			"enter": function() {
|1592|1592| 				this.SelectAnimation("move");
|1593|1593| 			},
|1594|1594| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1598|1598| 		},
|1599|1599| 
|1600|1600| 		"WALKINGANDFIGHTING": {
|1601|    |-			"enter": function () {
|    |1601|+			"enter": function() {
|1602|1602| 				// Show weapons rather than carried resources.
|1603|1603| 				this.SetAnimationVariant("combat");
|1604|1604| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1620|1620| 		},
|1621|1621| 
|1622|1622| 		"PATROL": {
|1623|    |-			"enter": function () {
|    |1623|+			"enter": function() {
|1624|1624| 				// Memorize the origin position in case that we want to go back
|1625|1625| 				let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|1626|1626| 				if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1664|1664| 			},
|1665|1665| 
|1666|1666| 			"ESCORTING": {
|1667|    |-				"enter": function () {
|    |1667|+				"enter": function() {
|1668|1668| 					// Show weapons rather than carried resources.
|1669|1669| 					this.SetAnimationVariant("combat");
|1670|1670| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1713|1713| 			},
|1714|1714| 
|1715|1715| 			"GUARDING": {
|1716|    |-				"enter": function () {
|    |1716|+				"enter": function() {
|1717|1717| 					this.StartTimer(1000, 1000);
|1718|1718| 					this.SetHeldPositionOnEntity(this.entity);
|1719|1719| 					var animationName = "idle";
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1723|1723| 						if (cmpFormation)
|1724|1724| 							animationName = cmpFormation.GetFormationAnimation(this.entity, animationName);
|1725|1725| 					}
|1726|    |-					this.SelectAnimation(animationName);	
|    |1726|+					this.SelectAnimation(animationName);
|1727|1727| 					return false;
|1728|1728| 				},
|1729|1729| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1748|1748| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1749|1749| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1750|1750| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1751|    |-						{
|    |1751|+						
|1752|1752| 							if (this.CanHeal(this.isGuardOf))
|1753|1753| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1754|1754| 							else if (this.CanRepair(this.isGuardOf))
|1755|1755| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1756|    |-						}
|    |1756|+						
|1757|1757| 					}
|1758|1758| 				},
|1759|1759| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1805|1805| 			},
|1806|1806| 
|1807|1807| 			"APPROACHING": {
|1808|    |-				"enter": function () {
|    |1808|+				"enter": function() {
|1809|1809| 					// Show weapons rather than carried resources.
|1810|1810| 					this.SetAnimationVariant("combat");
|1811|1811| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1835|1835| 				"MoveCompleted": function() {
|1836|1836| 
|1837|1837| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1838|    |-					{
|    |1838|+					
|1839|1839| 						// If the unit needs to unpack, do so
|1840|1840| 						if (this.CanUnpack())
|1841|1841| 						{
|1844|1844| 						}
|1845|1845| 						else
|1846|1846| 							this.SetNextState("ATTACKING");
|1847|    |-					}
|    |1847|+					
|1848|1848| 					else
|1849|1849| 					{
|1850|1850| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1842|1842| 							this.PushOrderFront("Unpack", { "force": true });
|1843|1843| 							return;
|1844|1844| 						}
|1845|    |-						else
|1846|    |-							this.SetNextState("ATTACKING");
|    |1845|+						this.SetNextState("ATTACKING");
|1847|1846| 					}
|1848|1847| 					else
|1849|1848| 					{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1846|1846| 							this.SetNextState("ATTACKING");
|1847|1847| 					}
|1848|1848| 					else
|1849|    |-					{
|    |1849|+					
|1850|1850| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1851|1851| 						{
|1852|1852| 							this.SetNextState("APPROACHING");
|1856|1856| 							// Give up
|1857|1857| 							this.FinishOrder();
|1858|1858| 						}
|1859|    |-					}
|    |1859|+					
|1860|1860| 				},
|1861|1861| 			},
|1862|1862| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1848|1848| 					else
|1849|1849| 					{
|1850|1850| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1851|    |-						{
|    |1851|+						
|1852|1852| 							this.SetNextState("APPROACHING");
|1853|    |-						}
|    |1853|+						
|1854|1854| 						else
|1855|1855| 						{
|1856|1856| 							// Give up
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1852|1852| 							this.SetNextState("APPROACHING");
|1853|1853| 						}
|1854|1854| 						else
|1855|    |-						{
|    |1855|+						
|1856|1856| 							// Give up
|1857|1857| 							this.FinishOrder();
|1858|    |-						}
|    |1858|+						
|1859|1859| 					}
|1860|1860| 				},
|1861|1861| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1873|1873| 					}
|1874|1874| 					// Check the target is still alive and attackable
|1875|1875| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1876|    |-					{
|    |1876|+					
|1877|1877| 						// Can't reach it - try to chase after it
|1878|1878| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1879|1879| 						{
|1883|1883| 								return;
|1884|1884| 							}
|1885|1885| 						}
|1886|    |-					}
|    |1886|+					
|1887|1887| 
|1888|1888| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1889|1889| 					this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1876|1876| 					{
|1877|1877| 						// Can't reach it - try to chase after it
|1878|1878| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1879|    |-						{
|    |1879|+						
|1880|1880| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1881|1881| 							{
|1882|1882| 								this.SetNextState("COMBAT.CHASING");
|1883|1883| 								return;
|1884|1884| 							}
|1885|    |-						}
|    |1885|+						
|1886|1886| 					}
|1887|1887| 
|1888|1888| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1913|1913| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1914|1914| 
|1915|1915| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1916|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1916|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1917|1917| 
|1918|1918| 					this.FaceTowardsTarget(this.order.data.target);
|1919|1919| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1987|1987| 
|1988|1988| 						// Can't reach it - try to chase after it
|1989|1989| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1990|    |-						{
|    |1990|+						
|1991|1991| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1992|1992| 							{
|1993|1993| 								this.SetNextState("COMBAT.CHASING");
|1994|1994| 								return;
|1995|1995| 							}
|1996|    |-						}
|    |1996|+						
|1997|1997| 					}
|1998|1998| 
|1999|1999| 					// if we're targetting a formation, find a new member of that formation
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2034|2034| 
|2035|2035| 				"Attacked": function(msg) {
|2036|2036| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2037|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2038|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2037|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2038|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2039|2039| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2040|2040| 				},
|2041|2041| 			},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2041|2041| 			},
|2042|2042| 
|2043|2043| 			"CHASING": {
|2044|    |-				"enter": function () {
|    |2044|+				"enter": function() {
|2045|2045| 					// Show weapons rather than carried resources.
|2046|2046| 					this.SetAnimationVariant("combat");
|2047|2047| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2116|2116| 
|2117|2117| 						// Try to find another nearby target of the same specific type
|2118|2118| 						// Also don't switch to a different type of huntable animal
|2119|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2119|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2120|2120| 							return (
|2121|2121| 								ent != oldTarget
|2122|2122| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2118|2118| 						// Also don't switch to a different type of huntable animal
|2119|2119| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2120|2120| 							return (
|2121|    |-								ent != oldTarget
|2122|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2121|+								ent != oldTarget &&
|    |2122|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2123|2123| 								 || (type.specific == oldType.specific
|2124|2124| 								 && (type.specific != "meat" || oldTemplate == template)))
|2125|2125| 							);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2119|2119| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2120|2120| 							return (
|2121|2121| 								ent != oldTarget
|2122|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2123|    |-								 || (type.specific == oldType.specific
|    |2122|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2123|+								 (type.specific == oldType.specific
|2124|2124| 								 && (type.specific != "meat" || oldTemplate == template)))
|2125|2125| 							);
|2126|2126| 						}, oldTarget);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2120|2120| 							return (
|2121|2121| 								ent != oldTarget
|2122|2122| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2123|    |-								 || (type.specific == oldType.specific
|2124|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2123|+								 || (type.specific == oldType.specific &&
|    |2124|+								 (type.specific != "meat" || oldTemplate == template)))
|2125|2125| 							);
|2126|2126| 						}, oldTarget);
|2127|2127| 						if (nearby)
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2129|2129| 							this.PerformGather(nearby, false, false);
|2130|2130| 							return true;
|2131|2131| 						}
|2132|    |-						else
|2133|    |-						{
|    |2132|+						
|2134|2133| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2135|2134| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2136|2135| 							// to order it to GatherNear the resource position.
|2151|2150| 									return true;
|2152|2151| 								}
|2153|2152| 							}
|2154|    |-						}
|    |2153|+						
|2155|2154| 						return true;
|2156|2155| 					}
|2157|2156| 					return false;
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2141|2141| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2142|2142| 								return true;
|2143|2143| 							}
|2144|    |-							else
|2145|    |-							{
|    |2144|+							
|2146|2145| 								// we're kind of stuck here. Return resource.
|2147|2146| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2148|2147| 								if (nearby)
|2150|2149| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2151|2150| 									return true;
|2152|2151| 								}
|2153|    |-							}
|    |2152|+							
|2154|2153| 						}
|2155|2154| 						return true;
|2156|2155| 					}
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2181|2181| 
|2182|2182| 						// Try to find another nearby target of the same specific type
|2183|2183| 						// Also don't switch to a different type of huntable animal
|2184|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2184|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2185|2185| 							return (
|2186|2186| 								ent != oldTarget
|2187|2187| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2183|2183| 						// Also don't switch to a different type of huntable animal
|2184|2184| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2185|2185| 							return (
|2186|    |-								ent != oldTarget
|2187|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2186|+								ent != oldTarget &&
|    |2187|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2188|2188| 								|| (type.specific == oldType.specific
|2189|2189| 								&& (type.specific != "meat" || oldTemplate == template)))
|2190|2190| 							);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2184|2184| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2185|2185| 							return (
|2186|2186| 								ent != oldTarget
|2187|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2188|    |-								|| (type.specific == oldType.specific
|    |2187|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2188|+								(type.specific == oldType.specific
|2189|2189| 								&& (type.specific != "meat" || oldTemplate == template)))
|2190|2190| 							);
|2191|2191| 						});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2185|2185| 							return (
|2186|2186| 								ent != oldTarget
|2187|2187| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2188|    |-								|| (type.specific == oldType.specific
|2189|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2188|+								|| (type.specific == oldType.specific &&
|    |2189|+								(type.specific != "meat" || oldTemplate == template)))
|2190|2190| 							);
|2191|2191| 						});
|2192|2192| 						if (nearby)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2227|2227| 
|2228|2228| 					// Try to find another nearby target of the same specific type
|2229|2229| 					// Also don't switch to a different type of huntable animal
|2230|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2230|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2231|2231| 						return (
|2232|2232| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2233|2233| 							|| (type.specific == resourceType.specific
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2229|2229| 					// Also don't switch to a different type of huntable animal
|2230|2230| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2231|2231| 						return (
|2232|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2233|    |-							|| (type.specific == resourceType.specific
|    |2232|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2233|+							(type.specific == resourceType.specific
|2234|2234| 							&& (type.specific != "meat" || resourceTemplate == template))
|2235|2235| 						);
|2236|2236| 					});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2230|2230| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2231|2231| 						return (
|2232|2232| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2233|    |-							|| (type.specific == resourceType.specific
|2234|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2233|+							|| (type.specific == resourceType.specific &&
|    |2234|+							(type.specific != "meat" || resourceTemplate == template))
|2235|2235| 						);
|2236|2236| 					});
|2237|2237| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2346|2346| 
|2347|2347| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2348|2348| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2349|    |-					{
|    |2349|+					
|2350|2350| 						// Check we can still reach and gather from the target
|2351|2351| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2352|2352| 						{
|2412|2412| 								return;
|2413|2413| 							}
|2414|2414| 						}
|2415|    |-					}
|    |2415|+					
|2416|2416| 
|2417|2417| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2418|2418| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2436|2436| 
|2437|2437| 					// Try to find a new resource of the same specific type near our current position:
|2438|2438| 					// Also don't switch to a different type of huntable animal
|2439|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2439|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2440|2440| 						return (
|2441|2441| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2442|2442| 							|| (type.specific == resourceType.specific
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2438|2438| 					// Also don't switch to a different type of huntable animal
|2439|2439| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2440|2440| 						return (
|2441|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2442|    |-							|| (type.specific == resourceType.specific
|    |2441|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2442|+							(type.specific == resourceType.specific
|2443|2443| 							&& (type.specific != "meat" || resourceTemplate == template))
|2444|2444| 						);
|2445|2445| 					});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2439|2439| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2440|2440| 						return (
|2441|2441| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2442|    |-							|| (type.specific == resourceType.specific
|2443|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2442|+							|| (type.specific == resourceType.specific &&
|    |2443|+							(type.specific != "meat" || resourceTemplate == template))
|2444|2444| 						);
|2445|2445| 					});
|2446|2446| 					if (nearby)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2480|2480| 			},
|2481|2481| 
|2482|2482| 			"APPROACHING": {
|2483|    |-				"enter": function () {
|    |2483|+				"enter": function() {
|2484|2484| 					this.SelectAnimation("move");
|2485|2485| 					this.StartTimer(1000, 1000);
|2486|2486| 				},
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2526|2526| 					this.StartTimer(prepare, this.healTimers.repeat);
|2527|2527| 
|2528|2528| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2529|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2529|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2530|2530| 
|2531|2531| 					this.FaceTowardsTarget(this.order.data.target);
|2532|2532| 				},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2559|2559| 						}
|2560|2560| 						// Can't reach it - try to chase after it
|2561|2561| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|2562|    |-						{
|    |2562|+						
|2563|2563| 							if (this.MoveToTargetRange(target, IID_Heal))
|2564|2564| 							{
|2565|2565| 								this.SetNextState("HEAL.CHASING");
|2566|2566| 								return;
|2567|2567| 							}
|2568|    |-						}
|    |2568|+						
|2569|2569| 					}
|2570|2570| 					// Can't reach it, healed to max hp or doesn't exist any more - give up
|2571|2571| 					if (this.FinishOrder())
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2581|2581| 				},
|2582|2582| 			},
|2583|2583| 			"CHASING": {
|2584|    |-				"enter": function () {
|    |2584|+				"enter": function() {
|2585|2585| 					this.SelectAnimation("move");
|2586|2586| 					this.StartTimer(1000, 1000);
|2587|2587| 				},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2586|2586| 					this.StartTimer(1000, 1000);
|2587|2587| 				},
|2588|2588| 
|2589|    |-				"leave": function () {
|    |2589|+				"leave": function() {
|2590|2590| 					this.StopTimer();
|2591|2591| 				},
|2592|2592| 				"Timer": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2600|2600| 							this.WalkToHeldPosition();
|2601|2601| 					}
|2602|2602| 				},
|2603|    |-				"MoveCompleted": function () {
|    |2603|+				"MoveCompleted": function() {
|2604|2604| 					this.SetNextState("HEALING");
|2605|2605| 				},
|2606|2606| 			},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2609|2609| 		// Returning to dropsite
|2610|2610| 		"RETURNRESOURCE": {
|2611|2611| 			"APPROACHING": {
|2612|    |-				"enter": function () {
|    |2612|+				"enter": function() {
|2613|2613| 					this.SelectAnimation("move");
|2614|2614| 				},
|2615|2615| 
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2624|2624| 							animationName = cmpFormation.GetFormationAnimation(this.entity, animationName);
|2625|2625| 					}
|2626|2626| 					this.SelectAnimation(animationName);
|2627|    |-	
|    |2627|+
|2628|2628| 					// Check the dropsite is in range and we can return our resource there
|2629|2629| 					// (we didn't get stopped before reaching it)
|2630|2630| 					if (this.CheckTargetRange(this.order.data.target, IID_ResourceGatherer) && this.CanReturnResource(this.order.data.target, true))
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2674|2674| 			},
|2675|2675| 
|2676|2676| 			"APPROACHINGMARKET": {
|2677|    |-				"enter": function () {
|    |2677|+				"enter": function() {
|2678|2678| 					this.SelectAnimation("move");
|2679|2679| 				},
|2680|2680| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2702|2702| 
|2703|2703| 		"REPAIR": {
|2704|2704| 			"APPROACHING": {
|2705|    |-				"enter": function () {
|    |2705|+				"enter": function() {
|2706|2706| 					this.SelectAnimation("move");
|2707|2707| 				},
|2708|2708| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2743|2743| 					{
|2744|2744| 						// The building was already finished/fully repaired before we arrived;
|2745|2745| 						// let the ConstructionFinished handler handle this.
|2746|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2746|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2747|2747| 						return true;
|2748|2748| 					}
|2749|2749| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2743|2743| 					{
|2744|2744| 						// The building was already finished/fully repaired before we arrived;
|2745|2745| 						// let the ConstructionFinished handler handle this.
|2746|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2746|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2747|2747| 						return true;
|2748|2748| 					}
|2749|2749| 
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2783|2783| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2784|2784| 						this.SetNextState("APPROACHING");
|2785|2785| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2786|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2786|+						this.FinishOrder(); // can't approach and isn't in reach
|2787|2787| 				},
|2788|2788| 			},
|2789|2789| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2850|2850| 					var types = cmpResourceDropsite.GetTypes();
|2851|2851| 					// TODO: Slightly undefined behavior here, we don't know what type of resource will be collected,
|2852|2852| 					//   may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that!
|2853|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2853|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2854|2854| 						return (types.indexOf(type.generic) != -1);
|2855|2855| 					}, msg.data.newentity);
|2856|2856| 					if (nearby)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2870|2870| 
|2871|2871| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2872|2872| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2873|    |-				{
|    |2873|+				
|2874|2874| 					// We're already walking to the given point, so add this as a order.
|2875|2875| 					this.WalkToTarget(msg.data.newentity, true);
|2876|    |-				}
|    |2876|+				
|2877|2877| 			},
|2878|2878| 		},
|2879|2879| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|2920|2920| 
|2921|2921| 					// Check that we can garrison here
|2922|2922| 					if (this.CanGarrison(target))
|2923|    |-					{
|    |2923|+					
|2924|2924| 						// Check that we're in range of the garrison target
|2925|2925| 						if (this.CheckGarrisonRange(target))
|2926|2926| 						{
|2996|2996| 								return false;
|2997|2997| 							}
|2998|2998| 						}
|2999|    |-					}
|    |2999|+					
|3000|3000| 					// Garrisoning failed for some reason, so finish the order
|3001|3001| 					this.FinishOrder();
|3002|3002| 					return true;
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3099|3099| 						if (cmpFormation)
|3100|3100| 							animationName = cmpFormation.GetFormationAnimation(this.entity, animationName);
|3101|3101| 					}
|3102|    |-					this.SelectAnimation(animationName);					
|    |3102|+					this.SelectAnimation(animationName);
|3103|3103| 					var cmpGarrisonHolder = Engine.QueryInterface(this.entity, IID_GarrisonHolder);
|3104|3104| 					if (!cmpGarrisonHolder || cmpGarrisonHolder.IsFull())
|3105|3105| 					{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3120|3120| 		"Attacked": function(msg) {
|3121|3121| 			if (this.template.NaturalBehaviour == "skittish" ||
|3122|3122| 			    this.template.NaturalBehaviour == "passive")
|3123|    |-			{
|    |3123|+			
|3124|3124| 				this.Flee(msg.data.attacker, false);
|3125|    |-			}
|    |3125|+			
|3126|3126| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3127|3127| 			{
|3128|3128| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3129|3129| 					this.Attack(msg.data.attacker, false);
|3130|3130| 			}
|3131|3131| 			else if (this.template.NaturalBehaviour == "domestic")
|3132|    |-			{
|    |3132|+			
|3133|3133| 				// Never flee, stop what we were doing
|3134|3134| 				this.SetNextState("IDLE");
|3135|    |-			}
|    |3135|+			
|3136|3136| 		},
|3137|3137| 
|3138|3138| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3139|3139| 			// Move a tile outside the building
|3140|3140| 			var range = 4;
|3141|3141| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3142|    |-			{
|    |3142|+			
|3143|3143| 				// We've started walking to the given point
|3144|3144| 				this.SetNextState("WALKING");
|3145|    |-			}
|    |3145|+			
|3146|3146| 			else
|3147|3147| 			{
|3148|3148| 				// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3144|3144| 				this.SetNextState("WALKING");
|3145|3145| 			}
|3146|3146| 			else
|3147|    |-			{
|    |3147|+			
|3148|3148| 				// We are already at the target, or can't move at all
|3149|3149| 				this.FinishOrder();
|3150|    |-			}
|    |3150|+			
|3151|3151| 		},
|3152|3152| 
|3153|3153| 		"IDLE": {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3186|3186| 				}
|3187|3187| 				// Start attacking one of the newly-seen enemy (if any)
|3188|3188| 				else if (this.IsDangerousAnimal())
|3189|    |-				{
|    |3189|+				
|3190|3190| 					this.AttackVisibleEntity(msg.data.added);
|3191|    |-				}
|    |3191|+				
|3192|3192| 
|3193|3193| 				// TODO: if two units enter our range together, we'll attack the
|3194|3194| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3229|3229| 				}
|3230|3230| 				// Start attacking one of the newly-seen enemy (if any)
|3231|3231| 				else if (this.template.NaturalBehaviour == "violent")
|3232|    |-				{
|    |3232|+				
|3233|3233| 					this.AttackVisibleEntity(msg.data.added);
|3234|    |-				}
|    |3234|+				
|3235|3235| 			},
|3236|3236| 
|3237|3237| 			"MoveCompleted": function() { },
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3246|3246| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3247|3247| 
|3248|3248| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3249|    |-							// only used for domestic animals
|    |3249|+		// only used for domestic animals
|3250|3250| 	},
|3251|3251| };
|3252|3252| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3310|3310| 
|3311|3311| UnitAI.prototype.IsAnimal = function()
|3312|3312| {
|3313|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3313|+	return (!!this.template.NaturalBehaviour);
|3314|3314| };
|3315|3315| 
|3316|3316| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3348|3348| UnitAI.prototype.GetGarrisonHolder = function()
|3349|3349| {
|3350|3350| 	if (this.IsGarrisoned())
|3351|    |-	{
|    |3351|+	
|3352|3352| 		for (let order of this.orderQueue)
|3353|3353| 			if (order.type == "Garrison" || order.type == "Autogarrison")
|3354|3354| 				return order.data.target;
|3355|    |-	}
|    |3355|+	
|3356|3356| 	return INVALID_ENTITY;
|3357|3357| };
|3358|3358| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3429|3429| 		{
|3430|3430| 			let index = this.GetCurrentState().indexOf(".");
|3431|3431| 			if (index != -1)
|3432|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3432|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3433|3433| 			this.Stop(false);
|3434|3434| 		}
|3435|3435| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3485|3485| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3486|3486| 			continue;
|3487|3487| 		if (i == 0)
|3488|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3488|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3489|3489| 		else
|3490|3490| 			this.orderQueue.splice(i, 1);
|3491|3491| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3485|3485| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3486|3486| 			continue;
|3487|3487| 		if (i == 0)
|3488|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3488|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3489|3489| 		else
|3490|3490| 			this.orderQueue.splice(i, 1);
|3491|3491| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3569|3569| };
|3570|3570| 
|3571|3571| 
|3572|    |-//// FSM linkage functions ////
|    |3572|+// // FSM linkage functions ////
|3573|3573| 
|3574|3574| UnitAI.prototype.SetNextState = function(state)
|3575|3575| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3620|3620| 	if (this.orderQueue.length)
|3621|3621| 	{
|3622|3622| 		let ret = this.UnitFsm.ProcessMessage(this,
|3623|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3623|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3624|3624| 		);
|3625|3625| 
|3626|3626| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3620|3620| 	if (this.orderQueue.length)
|3621|3621| 	{
|3622|3622| 		let ret = this.UnitFsm.ProcessMessage(this,
|3623|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3623|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3624|3624| 		);
|3625|3625| 
|3626|3626| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3633|3633| 		// Otherwise we've successfully processed a new order
|3634|3634| 		return true;
|3635|3635| 	}
|3636|    |-	else
|3637|    |-	{
|    |3636|+	
|3638|3637| 		this.SetNextState("IDLE");
|3639|3638| 
|3640|3639| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3655|3654| 		}
|3656|3655| 
|3657|3656| 		return false;
|3658|    |-	}
|    |3657|+	
|3659|3658| };
|3660|3659| 
|3661|3660| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3672|3672| 	{
|3673|3673| 		this.order = order;
|3674|3674| 		let ret = this.UnitFsm.ProcessMessage(this,
|3675|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3675|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3676|3676| 		);
|3677|3677| 
|3678|3678| 		// If the order was rejected then immediately take it off
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3672|3672| 	{
|3673|3673| 		this.order = order;
|3674|3674| 		let ret = this.UnitFsm.ProcessMessage(this,
|3675|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3675|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3676|3676| 		);
|3677|3677| 
|3678|3678| 		// If the order was rejected then immediately take it off
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3708|3708| 		this.orderQueue.unshift(order);
|3709|3709| 		this.order = order;
|3710|3710| 		let ret = this.UnitFsm.ProcessMessage(this,
|3711|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3711|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3712|3712| 		);
|3713|3713| 
|3714|3714| 		// If the order was rejected then immediately take it off again;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3708|3708| 		this.orderQueue.unshift(order);
|3709|3709| 		this.order = order;
|3710|3710| 		let ret = this.UnitFsm.ProcessMessage(this,
|3711|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3711|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3712|3712| 		);
|3713|3713| 
|3714|3714| 		// If the order was rejected then immediately take it off again;
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3742|3742| 				continue;
|3743|3743| 			if (this.orderQueue[i].type == type)
|3744|3744| 				continue;
|3745|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3745|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3746|3746| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3747|3747| 			return;
|3748|3748| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3742|3742| 				continue;
|3743|3743| 			if (this.orderQueue[i].type == type)
|3744|3744| 				continue;
|3745|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3745|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3746|3746| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3747|3747| 			return;
|3748|3748| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3756|3756| {
|3757|3757| 	// Remember the previous work orders to be able to go back to them later if required
|3758|3758| 	if (data && data.force)
|3759|    |-	{
|    |3759|+	
|3760|3760| 		if (this.IsFormationController())
|3761|3761| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3762|3762| 		else
|3763|3763| 			this.UpdateWorkOrders(type);
|3764|    |-	}
|    |3764|+	
|3765|3765| 
|3766|3766| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3767|3767| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3833|3833| 	{
|3834|3834| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3835|3835| 		if (cmpUnitAI)
|3836|    |-		{
|    |3836|+		
|3837|3837| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3838|3838| 			{
|3839|3839| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3842|3842| 					return;
|3843|3843| 				}
|3844|3844| 			}
|3845|    |-		}
|    |3845|+		
|3846|3846| 	}
|3847|3847| 
|3848|3848| 	// If nothing found, take the unit orders
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3835|3835| 		if (cmpUnitAI)
|3836|3836| 		{
|3837|3837| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3838|    |-			{
|    |3838|+			
|3839|3839| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3840|3840| 				{
|3841|3841| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3842|3842| 					return;
|3843|3843| 				}
|3844|    |-			}
|    |3844|+			
|3845|3845| 		}
|3846|3846| 	}
|3847|3847| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3847|3847| 
|3848|3848| 	// If nothing found, take the unit orders
|3849|3849| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3850|    |-	{
|    |3850|+	
|3851|3851| 		if (isWorkType(this.orderQueue[i].type))
|3852|3852| 		{
|3853|3853| 			this.workOrders = this.orderQueue.slice(i);
|3854|3854| 			return;
|3855|3855| 		}
|3856|    |-	}
|    |3856|+	
|3857|3857| };
|3858|3858| 
|3859|3859| UnitAI.prototype.BackToWork = function()
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3913|3913| 	if (data.timerRepeat === undefined)
|3914|3914| 		this.timer = undefined;
|3915|3915| 
|3916|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3916|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3917|3917| };
|3918|3918| 
|3919|3919| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3913|3913| 	if (data.timerRepeat === undefined)
|3914|3914| 		this.timer = undefined;
|3915|3915| 
|3916|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3916|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3917|3917| };
|3918|3918| 
|3919|3919| /**
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3948|3948| 	this.timer = undefined;
|3949|3949| };
|3950|3950| 
|3951|    |-//// Message handlers /////
|    |3951|+// // Message handlers /////
|3952|3952| 
|3953|3953| UnitAI.prototype.OnMotionChanged = function(msg)
|3954|3954| {
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3953|3953| UnitAI.prototype.OnMotionChanged = function(msg)
|3954|3954| {
|3955|3955| 	if (msg.starting && !msg.error)
|3956|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3956|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3957|3957| 	else if (!msg.starting || msg.error)
|3958|3958| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3959|3959| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3953|3953| UnitAI.prototype.OnMotionChanged = function(msg)
|3954|3954| {
|3955|3955| 	if (msg.starting && !msg.error)
|3956|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3956|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3957|3957| 	else if (!msg.starting || msg.error)
|3958|3958| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3959|3959| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3955|3955| 	if (msg.starting && !msg.error)
|3956|3956| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3957|3957| 	else if (!msg.starting || msg.error)
|3958|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3958|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3959|3959| };
|3960|3960| 
|3961|3961| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3955|3955| 	if (msg.starting && !msg.error)
|3956|3956| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3957|3957| 	else if (!msg.starting || msg.error)
|3958|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3958|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3959|3959| };
|3960|3960| 
|3961|3961| UnitAI.prototype.OnGlobalConstructionFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3963|3963| 	// TODO: This is a bit inefficient since every unit listens to every
|3964|3964| 	// construction message - ideally we could scope it to only the one we're building
|3965|3965| 
|3966|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3966|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3967|3967| };
|3968|3968| 
|3969|3969| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3963|3963| 	// TODO: This is a bit inefficient since every unit listens to every
|3964|3964| 	// construction message - ideally we could scope it to only the one we're building
|3965|3965| 
|3966|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3966|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3967|3967| };
|3968|3968| 
|3969|3969| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3988|3988| 
|3989|3989| UnitAI.prototype.OnAttacked = function(msg)
|3990|3990| {
|3991|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3991|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3992|3992| };
|3993|3993| 
|3994|3994| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3988|3988| 
|3989|3989| UnitAI.prototype.OnAttacked = function(msg)
|3990|3990| {
|3991|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3991|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3992|3992| };
|3993|3993| 
|3994|3994| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3993|3993| 
|3994|3994| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3995|3995| {
|3996|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3996|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3997|3997| };
|3998|3998| 
|3999|3999| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3993|3993| 
|3994|3994| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3995|3995| {
|3996|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3996|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3997|3997| };
|3998|3998| 
|3999|3999| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3998|3998| 
|3999|3999| UnitAI.prototype.OnHealthChanged = function(msg)
|4000|4000| {
|4001|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4001|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4002|4002| };
|4003|4003| 
|4004|4004| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3998|3998| 
|3999|3999| UnitAI.prototype.OnHealthChanged = function(msg)
|4000|4000| {
|4001|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4001|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4002|4002| };
|4003|4003| 
|4004|4004| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4004|4004| UnitAI.prototype.OnRangeUpdate = function(msg)
|4005|4005| {
|4006|4006| 	if (msg.tag == this.losRangeQuery)
|4007|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4007|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4008|4008| 	else if (msg.tag == this.losHealRangeQuery)
|4009|4009| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4010|4010| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4004|4004| UnitAI.prototype.OnRangeUpdate = function(msg)
|4005|4005| {
|4006|4006| 	if (msg.tag == this.losRangeQuery)
|4007|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4007|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4008|4008| 	else if (msg.tag == this.losHealRangeQuery)
|4009|4009| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4010|4010| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4006|4006| 	if (msg.tag == this.losRangeQuery)
|4007|4007| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4008|4008| 	else if (msg.tag == this.losHealRangeQuery)
|4009|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4009|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4010|4010| };
|4011|4011| 
|4012|4012| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4006|4006| 	if (msg.tag == this.losRangeQuery)
|4007|4007| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4008|4008| 	else if (msg.tag == this.losHealRangeQuery)
|4009|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4009|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4010|4010| };
|4011|4011| 
|4012|4012| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4011|4011| 
|4012|4012| UnitAI.prototype.OnPackFinished = function(msg)
|4013|4013| {
|4014|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4014|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4015|4015| };
|4016|4016| 
|4017|4017| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4011|4011| 
|4012|4012| UnitAI.prototype.OnPackFinished = function(msg)
|4013|4013| {
|4014|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4014|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4015|4015| };
|4016|4016| 
|4017|4017| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4014|4014| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4015|4015| };
|4016|4016| 
|4017|    |-//// Helper functions to be called by the FSM ////
|    |4017|+// // Helper functions to be called by the FSM ////
|4018|4018| 
|4019|4019| UnitAI.prototype.GetWalkSpeed = function()
|4020|4020| {
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4118|4118| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4119|4119| 		return undefined;
|4120|4120| 
|4121|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4121|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4122|4122| 	if (!cmpPosition)
|4123|4123| 		return undefined;
|4124|4124| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4203|4203| 			PlaySound(name, member);
|4204|4204| 	}
|4205|4205| 	else
|4206|    |-	{
|    |4206|+	
|4207|4207| 		// Otherwise use our own sounds
|4208|4208| 		PlaySound(name, this.entity);
|4209|    |-	}
|    |4209|+	
|4210|4210| };
|4211|4211| 
|4212|4212| /*
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4390|4390| 	else
|4391|4391| 		// return false? Or hope you come close enough?
|4392|4392| 		var parabolicMaxRange = 0;
|4393|    |-		//return false;
|    |4393|+		// return false;
|4394|4394| 
|4395|4395| 	// the parabole changes while walking, take something in the middle
|4396|4396| 	var guessedMaxRange = (range.max + parabolicMaxRange)/2;
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4455|4455| 	if (this.IsFormationMember())
|4456|4456| 	{
|4457|4457| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4458|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4459|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4458|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4459|+			cmpFormationUnitAI.order.data.target == target)
|4460|4460| 			return true;
|4461|4461| 	}
|4462|4462| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4575|4575| 	var pos = cmpPosition.GetPosition();
|4576|4576| 	var heldPosition = this.heldPosition;
|4577|4577| 	if (heldPosition === undefined)
|4578|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4578|+		heldPosition = { "x": pos.x, "z": pos.z};
|4579|4579| 
|4580|4580| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4581|4581| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4575|4575| 	var pos = cmpPosition.GetPosition();
|4576|4576| 	var heldPosition = this.heldPosition;
|4577|4577| 	if (heldPosition === undefined)
|4578|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4578|+		heldPosition = {"x": pos.x, "z": pos.z };
|4579|4579| 
|4580|4580| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4581|4581| };
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4623|4623| UnitAI.prototype.AttackEntityInZone = function(ents)
|4624|4624| {
|4625|4625| 	var target = ents.find(target =>
|4626|    |-		this.CanAttack(target)
|4627|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4626|+		this.CanAttack(target) &&
|    |4627|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4628|4628| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4629|4629| 	);
|4630|4630| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4624|4624| {
|4625|4625| 	var target = ents.find(target =>
|4626|4626| 		this.CanAttack(target)
|4627|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4628|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4627|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4628|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4629|4629| 	);
|4630|4630| 	if (!target)
|4631|4631| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4688|4688| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4689|4689| 	if (this.isGuardOf)
|4690|4690| 	{
|4691|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4691|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4692|4692| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4693|4693| 		if (cmpUnitAI && cmpAttack &&
|4694|4694| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4692|4692| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4693|4693| 		if (cmpUnitAI && cmpAttack &&
|4694|4694| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4695|    |-				return false;
|    |4695|+			return false;
|4696|4696| 	}
|4697|4697| 
|4698|4698| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4697|4697| 
|4698|4698| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4699|4699| 	if (this.GetStance().respondHoldGround)
|4700|    |-	{
|    |4700|+	
|4701|4701| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4702|4702| 			return true;
|4703|    |-	}
|    |4703|+	
|4704|4704| 
|4705|4705| 	// Stop if it's left our vision range, unless we're especially persistent
|4706|4706| 	if (!this.GetStance().respondChaseBeyondVision)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4704|4704| 
|4705|4705| 	// Stop if it's left our vision range, unless we're especially persistent
|4706|4706| 	if (!this.GetStance().respondChaseBeyondVision)
|4707|    |-	{
|    |4707|+	
|4708|4708| 		if (!this.CheckTargetIsInVisionRange(target))
|4709|4709| 			return true;
|4710|    |-	}
|    |4710|+	
|4711|4711| 
|4712|4712| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4713|4713| 	// and will continue moving to its last seen position and then stop)
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4735|4735| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4736|4736| 	if (this.isGuardOf)
|4737|4737| 	{
|4738|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4738|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4739|4739| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4740|4740| 		if (cmpUnitAI && cmpAttack &&
|4741|4741| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4748|4748| 	return false;
|4749|4749| };
|4750|4750| 
|4751|    |-//// External interface functions ////
|    |4751|+// // External interface functions ////
|4752|4752| 
|4753|4753| UnitAI.prototype.SetFormationController = function(ent)
|4754|4754| {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4758|4758| 	// of our own formation (or ourself if not in formation)
|4759|4759| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4760|4760| 	if (cmpObstruction)
|4761|    |-	{
|    |4761|+	
|4762|4762| 		if (ent == INVALID_ENTITY)
|4763|4763| 			cmpObstruction.SetControlGroup(this.entity);
|4764|4764| 		else
|4765|4765| 			cmpObstruction.SetControlGroup(ent);
|4766|    |-	}
|    |4766|+	
|4767|4767| 
|4768|4768| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4769|4769| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4906|4906| 	// if we already had an old guard order, do nothing if the target is the same
|4907|4907| 	// and the order is running, otherwise remove the previous order
|4908|4908| 	if (this.isGuardOf)
|4909|    |-	{
|    |4909|+	
|4910|4910| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4911|4911| 			return;
|4912|4912| 		else
|4913|4913| 			this.RemoveGuard();
|4914|    |-	}
|    |4914|+	
|4915|4915| 
|4916|4916| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4917|4917| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4909|4909| 	{
|4910|4910| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4911|4911| 			return;
|4912|    |-		else
|4913|    |-			this.RemoveGuard();
|    |4912|+		this.RemoveGuard();
|4914|4913| 	}
|4915|4914| 
|4916|4915| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4951|4951| 		return;
|4952|4952| 
|4953|4953| 	if (this.order.type == "Guard")
|4954|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4954|+		this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"});
|4955|4955| 	else
|4956|4956| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4957|4957| 			if (this.orderQueue[i].type == "Guard")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4951|4951| 		return;
|4952|4952| 
|4953|4953| 	if (this.order.type == "Guard")
|4954|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4954|+		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" });
|4955|4955| 	else
|4956|4956| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4957|4957| 			if (this.orderQueue[i].type == "Guard")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5080|5080| 			this.WalkToTarget(target, queued);
|5081|5081| 		return;
|5082|5082| 	}
|5083|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |5083|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|5084|5084| };
|5085|5085| 
|5086|5086| /**
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5495|5495| 				{
|5496|5496| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5497|5497| 					var targetClasses = this.order.data.targetClasses;
|5498|    |-					if (targetClasses.attack && cmpIdentity
|5499|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5498|+					if (targetClasses.attack && cmpIdentity &&
|    |5499|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5500|5500| 						continue;
|5501|5501| 					if (targetClasses.avoid && cmpIdentity
|5502|5502| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5498|5498| 					if (targetClasses.attack && cmpIdentity
|5499|5499| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5500|5500| 						continue;
|5501|    |-					if (targetClasses.avoid && cmpIdentity
|5502|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5501|+					if (targetClasses.avoid && cmpIdentity &&
|    |5502|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5503|5503| 						continue;
|5504|5504| 					// Only used by the AIs to prevent some choices of targets
|5505|5505| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5521|5521| 		{
|5522|5522| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5523|5523| 			var targetClasses = this.order.data.targetClasses;
|5524|    |-			if (cmpIdentity && targetClasses.attack
|5525|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5524|+			if (cmpIdentity && targetClasses.attack &&
|    |5525|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5526|5526| 				continue;
|5527|5527| 			if (cmpIdentity && targetClasses.avoid
|5528|5528| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5524|5524| 			if (cmpIdentity && targetClasses.attack
|5525|5525| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5526|5526| 				continue;
|5527|    |-			if (cmpIdentity && targetClasses.avoid
|5528|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5527|+			if (cmpIdentity && targetClasses.avoid &&
|    |5528|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5529|5529| 				continue;
|5530|5530| 			// Only used by the AIs to prevent some choices of targets
|5531|5531| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5564|5564| 
|5565|5565| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5566|5566| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5567|    |-	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|    |5567|+	var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5568|5568| 		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5569|5569| 
|5570|5570| 	return targets;
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5565|5565| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5566|5566| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5567|5567| 	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5568|    |-		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|    |5568|+		.sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5569|5569| 
|5570|5570| 	return targets;
|5571|5571| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5654|5654| 
|5655|5655| UnitAI.prototype.SetHeldPosition = function(x, z)
|5656|5656| {
|5657|    |-	this.heldPosition = {"x": x, "z": z};
|    |5657|+	this.heldPosition = { "x": x, "z": z};
|5658|5658| };
|5659|5659| 
|5660|5660| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5654|5654| 
|5655|5655| UnitAI.prototype.SetHeldPosition = function(x, z)
|5656|5656| {
|5657|    |-	this.heldPosition = {"x": x, "z": z};
|    |5657|+	this.heldPosition = {"x": x, "z": z };
|5658|5658| };
|5659|5659| 
|5660|5660| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5681|5681| 	return false;
|5682|5682| };
|5683|5683| 
|5684|    |-//// Helper functions ////
|    |5684|+// // Helper functions ////
|5685|5685| 
|5686|5686| UnitAI.prototype.CanAttack = function(target)
|5687|5687| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5885|5885| 	return (cmpPack && cmpPack.IsPacking());
|5886|5886| };
|5887|5887| 
|5888|    |-//// Formation specific functions ////
|    |5888|+// // Formation specific functions ////
|5889|5889| 
|5890|5890| UnitAI.prototype.IsAttackingAsFormation = function()
|5891|5891| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5890|5890| UnitAI.prototype.IsAttackingAsFormation = function()
|5891|5891| {
|5892|5892| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5893|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5894|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5893|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5894|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5895|5895| };
|5896|5896| 
|5897|5897| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5894|5894| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5895|5895| };
|5896|5896| 
|5897|    |-//// Animal specific functions ////
|    |5897|+// // Animal specific functions ////
|5898|5898| 
|5899|5899| UnitAI.prototype.MoveRandomly = function(distance)
|5900|5900| {

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The unitAI changes should be split from the template changes.
The template format looks good.
I don't know which units should receive the animation, but wow had some insights on that.

Stan added a comment.Feb 15 2018, 8:24 PM

Every unit he listed have it now.

Stan updated this revision to Diff 5789.Feb 15 2018, 8:26 PM

Remove UnitAI changes

elexis accepted this revision.Feb 15 2018, 8:27 PM
This revision is now accepted and ready to land.Feb 15 2018, 8:27 PM
Stan closed this revision.Feb 15 2018, 8:44 PM

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

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