Page MenuHomeWildfire Games

Add a null stance in UnitAI to be used by the AI
ClosedPublic

Authored by mimo on Mar 9 2018, 9:10 PM.

Details

Summary

Quite often, the AI orders are messed by UnitAI which takes its own decisions. That patch adds a null stance which can be set by the AI when it does not want UnitAI to interfere with its decisions. A typical use case is transport ships responding to attacks of nearby towers while they should continue their route.

Test Plan

Check that the patch does not have any side effect.

Diff Detail

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

Event Timeline

mimo created this revision.Mar 9 2018, 9:10 PM
Vulcan added a subscriber: Vulcan.Mar 9 2018, 10:40 PM

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
|  70|  70| // do worry around armies slaughtering the guy standing next to you), etc.
|  71|  71| var g_Stances = {
|  72|  72| 	"violent": {
|  73|    |-		targetVisibleEnemies: true,
|    |  73|+		"targetVisibleEnemies": true,
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  71|  71| var g_Stances = {
|  72|  72| 	"violent": {
|  73|  73| 		targetVisibleEnemies: true,
|  74|    |-		targetAttackersAlways: true,
|    |  74|+		"targetAttackersAlways": true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  72|  72| 	"violent": {
|  73|  73| 		targetVisibleEnemies: true,
|  74|  74| 		targetAttackersAlways: true,
|  75|    |-		respondFlee: false,
|    |  75|+		"respondFlee": false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  73|  73| 		targetVisibleEnemies: true,
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|    |-		respondChase: true,
|    |  76|+		"respondChase": true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|  79|  79| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  74|  74| 		targetAttackersAlways: true,
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|    |-		respondChaseBeyondVision: true,
|    |  77|+		"respondChaseBeyondVision": true,
|  78|  78| 		respondStandGround: false,
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  75|  75| 		respondFlee: false,
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|    |-		respondStandGround: false,
|    |  78|+		"respondStandGround": false,
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  76|  76| 		respondChase: true,
|  77|  77| 		respondChaseBeyondVision: true,
|  78|  78| 		respondStandGround: false,
|  79|    |-		respondHoldGround: false,
|    |  79|+		"respondHoldGround": false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  79|  79| 		respondHoldGround: false,
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|    |-		targetVisibleEnemies: true,
|    |  82|+		"targetVisibleEnemies": true,
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  80|  80| 	},
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|  83|    |-		targetAttackersAlways: false,
|    |  83|+		"targetAttackersAlways": false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  81|  81| 	"aggressive": {
|  82|  82| 		targetVisibleEnemies: true,
|  83|  83| 		targetAttackersAlways: false,
|  84|    |-		respondFlee: false,
|    |  84|+		"respondFlee": false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  82|  82| 		targetVisibleEnemies: true,
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|    |-		respondChase: true,
|    |  85|+		"respondChase": true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|  88|  88| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  83|  83| 		targetAttackersAlways: false,
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|    |-		respondChaseBeyondVision: false,
|    |  86|+		"respondChaseBeyondVision": false,
|  87|  87| 		respondStandGround: false,
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  84|  84| 		respondFlee: false,
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|    |-		respondStandGround: false,
|    |  87|+		"respondStandGround": false,
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  85|  85| 		respondChase: true,
|  86|  86| 		respondChaseBeyondVision: false,
|  87|  87| 		respondStandGround: false,
|  88|    |-		respondHoldGround: false,
|    |  88|+		"respondHoldGround": false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  88|  88| 		respondHoldGround: false,
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|    |-		targetVisibleEnemies: true,
|    |  91|+		"targetVisibleEnemies": true,
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  89|  89| 	},
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|  92|    |-		targetAttackersAlways: false,
|    |  92|+		"targetAttackersAlways": false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  90|  90| 	"defensive": {
|  91|  91| 		targetVisibleEnemies: true,
|  92|  92| 		targetAttackersAlways: false,
|  93|    |-		respondFlee: false,
|    |  93|+		"respondFlee": false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  91|  91| 		targetVisibleEnemies: true,
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|    |-		respondChase: false,
|    |  94|+		"respondChase": false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|  97|  97| 		respondHoldGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  92|  92| 		targetAttackersAlways: false,
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|    |-		respondChaseBeyondVision: false,
|    |  95|+		"respondChaseBeyondVision": false,
|  96|  96| 		respondStandGround: false,
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  93|  93| 		respondFlee: false,
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|    |-		respondStandGround: false,
|    |  96|+		"respondStandGround": false,
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|  99|  99| 	"passive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  94|  94| 		respondChase: false,
|  95|  95| 		respondChaseBeyondVision: false,
|  96|  96| 		respondStandGround: false,
|  97|    |-		respondHoldGround: true,
|    |  97|+		"respondHoldGround": true,
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  97|  97| 		respondHoldGround: true,
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100|    |-		targetVisibleEnemies: false,
|    | 100|+		"targetVisibleEnemies": false,
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  98|  98| 	},
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
| 101|    |-		targetAttackersAlways: false,
|    | 101|+		"targetAttackersAlways": false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|  99|  99| 	"passive": {
| 100| 100| 		targetVisibleEnemies: false,
| 101| 101| 		targetAttackersAlways: false,
| 102|    |-		respondFlee: true,
|    | 102|+		"respondFlee": true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 100| 100| 		targetVisibleEnemies: false,
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103|    |-		respondChase: false,
|    | 103|+		"respondChase": false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
| 106| 106| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 101| 101| 		targetAttackersAlways: false,
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104|    |-		respondChaseBeyondVision: false,
|    | 104|+		"respondChaseBeyondVision": false,
| 105| 105| 		respondStandGround: false,
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 102| 102| 		respondFlee: true,
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105|    |-		respondStandGround: false,
|    | 105|+		"respondStandGround": false,
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
| 108| 108| 	"standground": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 103| 103| 		respondChase: false,
| 104| 104| 		respondChaseBeyondVision: false,
| 105| 105| 		respondStandGround: false,
| 106|    |-		respondHoldGround: false,
|    | 106|+		"respondHoldGround": false,
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 106| 106| 		respondHoldGround: false,
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109|    |-		targetVisibleEnemies: true,
|    | 109|+		"targetVisibleEnemies": true,
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 107| 107| 	},
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
| 110|    |-		targetAttackersAlways: false,
|    | 110|+		"targetAttackersAlways": false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 108| 108| 	"standground": {
| 109| 109| 		targetVisibleEnemies: true,
| 110| 110| 		targetAttackersAlways: false,
| 111|    |-		respondFlee: false,
|    | 111|+		"respondFlee": false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 109| 109| 		targetVisibleEnemies: true,
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112|    |-		respondChase: false,
|    | 112|+		"respondChase": false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
| 115| 115| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 110| 110| 		targetAttackersAlways: false,
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113|    |-		respondChaseBeyondVision: false,
|    | 113|+		"respondChaseBeyondVision": false,
| 114| 114| 		respondStandGround: true,
| 115| 115| 		respondHoldGround: false,
| 116| 116| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 111| 111| 		respondFlee: false,
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114|    |-		respondStandGround: true,
|    | 114|+		"respondStandGround": true,
| 115| 115| 		respondHoldGround: false,
| 116| 116| 	},
| 117| 117| 	"none": {	// Only used by AI
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 112| 112| 		respondChase: false,
| 113| 113| 		respondChaseBeyondVision: false,
| 114| 114| 		respondStandGround: true,
| 115|    |-		respondHoldGround: false,
|    | 115|+		"respondHoldGround": false,
| 116| 116| 	},
| 117| 117| 	"none": {	// Only used by AI
| 118| 118| 		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
| 115| 115| 		respondHoldGround: false,
| 116| 116| 	},
| 117| 117| 	"none": {	// Only used by AI
| 118|    |-		targetVisibleEnemies: false,
|    | 118|+		"targetVisibleEnemies": false,
| 119| 119| 		targetAttackersAlways: false,
| 120| 120| 		respondFlee: false,
| 121| 121| 		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
| 116| 116| 	},
| 117| 117| 	"none": {	// Only used by AI
| 118| 118| 		targetVisibleEnemies: false,
| 119|    |-		targetAttackersAlways: false,
|    | 119|+		"targetAttackersAlways": false,
| 120| 120| 		respondFlee: false,
| 121| 121| 		respondChase: false,
| 122| 122| 		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
| 117| 117| 	"none": {	// Only used by AI
| 118| 118| 		targetVisibleEnemies: false,
| 119| 119| 		targetAttackersAlways: false,
| 120|    |-		respondFlee: false,
|    | 120|+		"respondFlee": false,
| 121| 121| 		respondChase: false,
| 122| 122| 		respondChaseBeyondVision: false,
| 123| 123| 		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
| 118| 118| 		targetVisibleEnemies: false,
| 119| 119| 		targetAttackersAlways: false,
| 120| 120| 		respondFlee: false,
| 121|    |-		respondChase: false,
|    | 121|+		"respondChase": false,
| 122| 122| 		respondChaseBeyondVision: false,
| 123| 123| 		respondStandGround: false,
| 124| 124| 		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
| 119| 119| 		targetAttackersAlways: false,
| 120| 120| 		respondFlee: false,
| 121| 121| 		respondChase: false,
| 122|    |-		respondChaseBeyondVision: false,
|    | 122|+		"respondChaseBeyondVision": false,
| 123| 123| 		respondStandGround: false,
| 124| 124| 		respondHoldGround: false,
| 125| 125| 	},
|    | [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
| 120| 120| 		respondFlee: false,
| 121| 121| 		respondChase: false,
| 122| 122| 		respondChaseBeyondVision: false,
| 123|    |-		respondStandGround: false,
|    | 123|+		"respondStandGround": false,
| 124| 124| 		respondHoldGround: false,
| 125| 125| 	},
| 126| 126| };
|    | [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
| 121| 121| 		respondChase: false,
| 122| 122| 		respondChaseBeyondVision: false,
| 123| 123| 		respondStandGround: false,
| 124|    |-		respondHoldGround: false,
|    | 124|+		"respondHoldGround": false,
| 125| 125| 	},
| 126| 126| };
| 127| 127| 
|    | [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
| 222| 222| 		// Move a tile outside the building
| 223| 223| 		let range = 4;
| 224| 224| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 225|    |-		{
|    | 225|+		
| 226| 226| 			// We've started walking to the given point
| 227| 227| 			this.SetNextState("INDIVIDUAL.WALKING");
| 228|    |-		}
|    | 228|+		
| 229| 229| 		else
| 230| 230| 		{
| 231| 231| 			// 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
| 227| 227| 			this.SetNextState("INDIVIDUAL.WALKING");
| 228| 228| 		}
| 229| 229| 		else
| 230|    |-		{
|    | 230|+		
| 231| 231| 			// We are already at the target, or can't move at all
| 232| 232| 			this.FinishOrder();
| 233|    |-		}
|    | 233|+		
| 234| 234| 	},
| 235| 235| 
| 236| 236| 	// 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
| 332| 332| 
| 333| 333| 		var ok = this.MoveToTarget(this.order.data.target);
| 334| 334| 		if (ok)
| 335|    |-		{
|    | 335|+		
| 336| 336| 			// We've started walking to the given point
| 337| 337| 			if (this.IsAnimal())
| 338| 338| 				this.SetNextState("ANIMAL.WALKING");
| 339| 339| 			else
| 340| 340| 				this.SetNextState("INDIVIDUAL.WALKING");
| 341|    |-		}
|    | 341|+		
| 342| 342| 		else
| 343| 343| 		{
| 344| 344| 			// 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
| 360| 360| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 361| 361| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 362| 362| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 363|    |-		{
|    | 363|+		
| 364| 364| 			// we were already on the shoreline, and have not moved since
| 365| 365| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 366| 366| 				needToMove = false;
| 367|    |-		}
|    | 367|+		
| 368| 368| 
| 369| 369| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 370| 370| 		// 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
| 358| 358| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 359| 359| 		var needToMove = true;
| 360| 360| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 361|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 362|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 361|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 362|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 363| 363| 		{
| 364| 364| 			// we were already on the shoreline, and have not moved since
| 365| 365| 			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
| 369| 369| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 370| 370| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 371| 371| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 372|    |-		{
|    | 372|+		
| 373| 373| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 374|    |-		}
|    | 374|+		
| 375| 375| 		else
| 376| 376| 		{
| 377| 377| 			// 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
| 398| 398| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 399| 399| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 400| 400| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 401|    |-		{
|    | 401|+		
| 402| 402| 			// We've started fleeing from the given target
| 403| 403| 			if (this.IsAnimal())
| 404| 404| 				this.SetNextState("ANIMAL.FLEEING");
| 405| 405| 			else
| 406| 406| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 407|    |-		}
|    | 407|+		
| 408| 408| 		else
| 409| 409| 		{
| 410| 410| 			// 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
| 454| 454| 			}
| 455| 455| 
| 456| 456| 			if (this.order.data.attackType == this.oldAttackType)
| 457|    |-			{
|    | 457|+			
| 458| 458| 				if (this.IsAnimal())
| 459| 459| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 460| 460| 				else
| 461| 461| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 462|    |-			}
|    | 462|+			
| 463| 463| 			else
| 464| 464| 			{
| 465| 465| 				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
| 461| 461| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 462| 462| 			}
| 463| 463| 			else
| 464|    |-			{
|    | 464|+			
| 465| 465| 				if (this.IsAnimal())
| 466| 466| 					this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
| 467| 467| 				else
| 468| 468| 					this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
| 469|    |-			}
|    | 469|+			
| 470| 470| 			return;
| 471| 471| 		}
| 472| 472| 
|    | [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
| 599| 599| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 600| 600| 				}
| 601| 601| 				else
| 602|    |-				{
|    | 602|+				
| 603| 603| 					// We couldn't move there, or the target moved away
| 604| 604| 					this.FinishOrder();
| 605|    |-				}
|    | 605|+				
| 606| 606| 				return;
| 607| 607| 			}
| 608| 608| 
|    | [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
| 612| 612| 
| 613| 613| 		// Try to move within range
| 614| 614| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 615|    |-		{
|    | 615|+		
| 616| 616| 			// We've started walking to the given point
| 617| 617| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 618|    |-		}
|    | 618|+		
| 619| 619| 		else
| 620| 620| 		{
| 621| 621| 			// 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
| 689| 689| 	"Order.Repair": function(msg) {
| 690| 690| 		// Try to move within range
| 691| 691| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 692|    |-		{
|    | 692|+		
| 693| 693| 			// We've started walking to the given point
| 694| 694| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 695|    |-		}
|    | 695|+		
| 696| 696| 		else
| 697| 697| 		{
| 698| 698| 			// 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
| 726| 726| 		}
| 727| 727| 
| 728| 728| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 729|    |-		{
|    | 729|+		
| 730| 730| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 731|    |-		}
|    | 731|+		
| 732| 732| 		else
| 733| 733| 		{
| 734| 734| 			// 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
| 864| 864| 			if (!this.CheckTargetAttackRange(target, target))
| 865| 865| 			{
| 866| 866| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 867|    |-				{
|    | 867|+				
| 868| 868| 					if (this.MoveToTargetAttackRange(target, target))
| 869| 869| 					{
| 870| 870| 						this.SetNextState("COMBAT.APPROACHING");
| 871| 871| 						return;
| 872| 872| 					}
| 873|    |-				}
|    | 873|+				
| 874| 874| 				this.FinishOrder();
| 875| 875| 				return;
| 876| 876| 			}
|    | [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
| 889| 889| 			}
| 890| 890| 			// Check if we are already in range, otherwise walk there
| 891| 891| 			if (!this.CheckGarrisonRange(msg.data.target))
| 892|    |-			{
|    | 892|+			
| 893| 893| 				if (!this.CheckTargetVisible(msg.data.target))
| 894| 894| 				{
| 895| 895| 					this.FinishOrder();
| 904| 904| 						return;
| 905| 905| 					}
| 906| 906| 				}
| 907|    |-			}
|    | 907|+			
| 908| 908| 
| 909| 909| 			this.SetNextState("GARRISON.GARRISONING");
| 910| 910| 		},
|    | [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
| 896| 896| 					return;
| 897| 897| 				}
| 898| 898| 				else
| 899|    |-				{
|    | 899|+				
| 900| 900| 					// Out of range; move there in formation
| 901| 901| 					if (this.MoveToGarrisonRange(msg.data.target))
| 902| 902| 					{
| 903| 903| 						this.SetNextState("GARRISON.APPROACHING");
| 904| 904| 						return;
| 905| 905| 					}
| 906|    |-				}
|    | 906|+				
| 907| 907| 			}
| 908| 908| 
| 909| 909| 			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
| 895| 895| 					this.FinishOrder();
| 896| 896| 					return;
| 897| 897| 				}
| 898|    |-				else
| 899|    |-				{
|    | 898|+				
| 900| 899| 					// Out of range; move there in formation
| 901| 900| 					if (this.MoveToGarrisonRange(msg.data.target))
| 902| 901| 					{
| 903| 902| 						this.SetNextState("GARRISON.APPROACHING");
| 904| 903| 						return;
| 905| 904| 					}
| 906|    |-				}
|    | 905|+				
| 907| 906| 			}
| 908| 907| 
| 909| 908| 			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
| 922| 922| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 923| 923| 					}
| 924| 924| 					else
| 925|    |-					{
|    | 925|+					
| 926| 926| 						// We couldn't move there, or the target moved away
| 927| 927| 						this.FinishOrder();
| 928|    |-					}
|    | 928|+					
| 929| 929| 					return;
| 930| 930| 				}
| 931| 931| 
|    | [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
|1143|1143| 			},
|1144|1144| 		},
|1145|1145| 
|1146|    |-		"GARRISON":{
|    |1146|+		"GARRISON": {
|1147|1147| 			"enter": function() {
|1148|1148| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1149|1149| 				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
|1324|1324| 			// If the controller handled an order but some members rejected it,
|1325|1325| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1326|1326| 			if (this.orderQueue.length)
|1327|    |-			{
|    |1327|+			
|1328|1328| 				// We're leaving the formation, so stop our FormationWalk order
|1329|1329| 				if (this.FinishOrder())
|1330|1330| 					return;
|1331|    |-			}
|    |1331|+			
|1332|1332| 
|1333|1333| 			// No orders left, we're an individual now
|1334|1334| 			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
|1352|1352| 			// Move a tile outside the building
|1353|1353| 			let range = 4;
|1354|1354| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1355|    |-			{
|    |1355|+			
|1356|1356| 				// We've started walking to the given point
|1357|1357| 				this.SetNextState("WALKINGTOPOINT");
|1358|    |-			}
|    |1358|+			
|1359|1359| 			else
|1360|1360| 			{
|1361|1361| 				// 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
|1357|1357| 				this.SetNextState("WALKINGTOPOINT");
|1358|1358| 			}
|1359|1359| 			else
|1360|    |-			{
|    |1360|+			
|1361|1361| 				// We are already at the target, or can't move at all
|1362|1362| 				this.FinishOrder();
|1363|    |-			}
|    |1363|+			
|1364|1364| 		},
|1365|1365| 
|1366|1366| 
|    | [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
|1375|1375| 		},
|1376|1376| 
|1377|1377| 		"WALKING": {
|1378|    |-			"enter": function () {
|    |1378|+			"enter": function() {
|1379|1379| 				var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
|1380|1380| 				var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
|1381|1381| 				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
|1558|1558| 
|1559|1559| 			"LosRangeUpdate": function(msg) {
|1560|1560| 				if (this.GetStance().targetVisibleEnemies)
|1561|    |-				{
|    |1561|+				
|1562|1562| 					// Start attacking one of the newly-seen enemy (if any)
|1563|1563| 					this.AttackEntitiesByPreference(msg.data.added);
|1564|    |-				}
|    |1564|+				
|1565|1565| 			},
|1566|1566| 
|1567|1567| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1586|1586| 		},
|1587|1587| 
|1588|1588| 		"WALKING": {
|1589|    |-			"enter": function () {
|    |1589|+			"enter": function() {
|1590|1590| 				this.SelectAnimation("move");
|1591|1591| 			},
|1592|1592| 
|    | [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
|1596|1596| 		},
|1597|1597| 
|1598|1598| 		"WALKINGANDFIGHTING": {
|1599|    |-			"enter": function () {
|    |1599|+			"enter": function() {
|1600|1600| 				// Show weapons rather than carried resources.
|1601|1601| 				this.SetAnimationVariant("combat");
|1602|1602| 
|    | [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
|1619|1619| 		},
|1620|1620| 
|1621|1621| 		"PATROL": {
|1622|    |-			"enter": function () {
|    |1622|+			"enter": function() {
|1623|1623| 				// Memorize the origin position in case that we want to go back
|1624|1624| 				let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|1625|1625| 				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
|1665|1665| 			},
|1666|1666| 
|1667|1667| 			"ESCORTING": {
|1668|    |-				"enter": function () {
|    |1668|+				"enter": function() {
|1669|1669| 					// Show weapons rather than carried resources.
|1670|1670| 					this.SetAnimationVariant("combat");
|1671|1671| 
|    | [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
|1715|1715| 			},
|1716|1716| 
|1717|1717| 			"GUARDING": {
|1718|    |-				"enter": function () {
|    |1718|+				"enter": function() {
|1719|1719| 					this.StartTimer(1000, 1000);
|1720|1720| 					this.SetHeldPositionOnEntity(this.entity);
|1721|1721| 					this.SetAnimationVariant("combat");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1744|1744| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1745|1745| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1746|1746| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1747|    |-						{
|    |1747|+						
|1748|1748| 							if (this.CanHeal(this.isGuardOf))
|1749|1749| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1750|1750| 							else if (this.CanRepair(this.isGuardOf))
|1751|1751| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1752|    |-						}
|    |1752|+						
|1753|1753| 					}
|1754|1754| 				},
|1755|1755| 
|    | [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
|1802|1802| 			},
|1803|1803| 
|1804|1804| 			"APPROACHING": {
|1805|    |-				"enter": function () {
|    |1805|+				"enter": function() {
|1806|1806| 					// Show weapons rather than carried resources.
|1807|1807| 					this.SetAnimationVariant("combat");
|1808|1808| 
|    | [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
|1832|1832| 				"MoveCompleted": function() {
|1833|1833| 
|1834|1834| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1835|    |-					{
|    |1835|+					
|1836|1836| 						// If the unit needs to unpack, do so
|1837|1837| 						if (this.CanUnpack())
|1838|1838| 						{
|1841|1841| 						}
|1842|1842| 						else
|1843|1843| 							this.SetNextState("ATTACKING");
|1844|    |-					}
|    |1844|+					
|1845|1845| 					else
|1846|1846| 					{
|1847|1847| 						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
|1839|1839| 							this.PushOrderFront("Unpack", { "force": true });
|1840|1840| 							return;
|1841|1841| 						}
|1842|    |-						else
|1843|    |-							this.SetNextState("ATTACKING");
|    |1842|+						this.SetNextState("ATTACKING");
|1844|1843| 					}
|1845|1844| 					else
|1846|1845| 					{
|    | [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
|1843|1843| 							this.SetNextState("ATTACKING");
|1844|1844| 					}
|1845|1845| 					else
|1846|    |-					{
|    |1846|+					
|1847|1847| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1848|1848| 						{
|1849|1849| 							this.SetNextState("APPROACHING");
|1853|1853| 							// Give up
|1854|1854| 							this.FinishOrder();
|1855|1855| 						}
|1856|    |-					}
|    |1856|+					
|1857|1857| 				},
|1858|1858| 			},
|1859|1859| 
|    | [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
|1845|1845| 					else
|1846|1846| 					{
|1847|1847| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1848|    |-						{
|    |1848|+						
|1849|1849| 							this.SetNextState("APPROACHING");
|1850|    |-						}
|    |1850|+						
|1851|1851| 						else
|1852|1852| 						{
|1853|1853| 							// 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
|1849|1849| 							this.SetNextState("APPROACHING");
|1850|1850| 						}
|1851|1851| 						else
|1852|    |-						{
|    |1852|+						
|1853|1853| 							// Give up
|1854|1854| 							this.FinishOrder();
|1855|    |-						}
|    |1855|+						
|1856|1856| 					}
|1857|1857| 				},
|1858|1858| 			},
|    | [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
|1870|1870| 					}
|1871|1871| 					// Check the target is still alive and attackable
|1872|1872| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1873|    |-					{
|    |1873|+					
|1874|1874| 						// Can't reach it - try to chase after it
|1875|1875| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1876|1876| 						{
|1880|1880| 								return;
|1881|1881| 							}
|1882|1882| 						}
|1883|    |-					}
|    |1883|+					
|1884|1884| 
|1885|1885| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1886|1886| 					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
|1873|1873| 					{
|1874|1874| 						// Can't reach it - try to chase after it
|1875|1875| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1876|    |-						{
|    |1876|+						
|1877|1877| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1878|1878| 							{
|1879|1879| 								this.SetNextState("COMBAT.CHASING");
|1880|1880| 								return;
|1881|1881| 							}
|1882|    |-						}
|    |1882|+						
|1883|1883| 					}
|1884|1884| 
|1885|1885| 					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
|1911|1911| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1912|1912| 
|1913|1913| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1914|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1914|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1915|1915| 
|1916|1916| 					this.FaceTowardsTarget(this.order.data.target);
|1917|1917| 
|    | [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
|1986|1986| 
|1987|1987| 						// Can't reach it - try to chase after it
|1988|1988| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1989|    |-						{
|    |1989|+						
|1990|1990| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1991|1991| 							{
|1992|1992| 								this.SetNextState("COMBAT.CHASING");
|1993|1993| 								return;
|1994|1994| 							}
|1995|    |-						}
|    |1995|+						
|1996|1996| 					}
|1997|1997| 
|1998|1998| 					// 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
|2033|2033| 
|2034|2034| 				"Attacked": function(msg) {
|2035|2035| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2036|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2037|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2036|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2037|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2038|2038| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2039|2039| 				},
|2040|2040| 			},
|    | [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
|2040|2040| 			},
|2041|2041| 
|2042|2042| 			"CHASING": {
|2043|    |-				"enter": function () {
|    |2043|+				"enter": function() {
|2044|2044| 					// Show weapons rather than carried resources.
|2045|2045| 					this.SetAnimationVariant("combat");
|2046|2046| 
|    | [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
|2115|2115| 
|2116|2116| 						// Try to find another nearby target of the same specific type
|2117|2117| 						// Also don't switch to a different type of huntable animal
|2118|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2118|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2119|2119| 							return (
|2120|2120| 								ent != oldTarget
|2121|2121| 								 && ((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
|2117|2117| 						// Also don't switch to a different type of huntable animal
|2118|2118| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2119|2119| 							return (
|2120|    |-								ent != oldTarget
|2121|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2120|+								ent != oldTarget &&
|    |2121|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2122|2122| 								 || (type.specific == oldType.specific
|2123|2123| 								 && (type.specific != "meat" || oldTemplate == template)))
|2124|2124| 							);
|    | [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| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2119|2119| 							return (
|2120|2120| 								ent != oldTarget
|2121|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2122|    |-								 || (type.specific == oldType.specific
|    |2121|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2122|+								 (type.specific == oldType.specific
|2123|2123| 								 && (type.specific != "meat" || oldTemplate == template)))
|2124|2124| 							);
|2125|2125| 						}, 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
|2119|2119| 							return (
|2120|2120| 								ent != oldTarget
|2121|2121| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2122|    |-								 || (type.specific == oldType.specific
|2123|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2122|+								 || (type.specific == oldType.specific &&
|    |2123|+								 (type.specific != "meat" || oldTemplate == template)))
|2124|2124| 							);
|2125|2125| 						}, oldTarget);
|2126|2126| 						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
|2128|2128| 							this.PerformGather(nearby, false, false);
|2129|2129| 							return true;
|2130|2130| 						}
|2131|    |-						else
|2132|    |-						{
|    |2131|+						
|2133|2132| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2134|2133| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2135|2134| 							// to order it to GatherNear the resource position.
|2150|2149| 									return true;
|2151|2150| 								}
|2152|2151| 							}
|2153|    |-						}
|    |2152|+						
|2154|2153| 						return true;
|2155|2154| 					}
|2156|2155| 					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
|2140|2140| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2141|2141| 								return true;
|2142|2142| 							}
|2143|    |-							else
|2144|    |-							{
|    |2143|+							
|2145|2144| 								// we're kind of stuck here. Return resource.
|2146|2145| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2147|2146| 								if (nearby)
|2149|2148| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2150|2149| 									return true;
|2151|2150| 								}
|2152|    |-							}
|    |2151|+							
|2153|2152| 						}
|2154|2153| 						return true;
|2155|2154| 					}
|    | [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
|2180|2180| 
|2181|2181| 						// Try to find another nearby target of the same specific type
|2182|2182| 						// Also don't switch to a different type of huntable animal
|2183|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2183|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2184|2184| 							return (
|2185|2185| 								ent != oldTarget
|2186|2186| 								&& ((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
|2182|2182| 						// Also don't switch to a different type of huntable animal
|2183|2183| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2184|2184| 							return (
|2185|    |-								ent != oldTarget
|2186|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2185|+								ent != oldTarget &&
|    |2186|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2187|2187| 								|| (type.specific == oldType.specific
|2188|2188| 								&& (type.specific != "meat" || oldTemplate == template)))
|2189|2189| 							);
|    | [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| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2184|2184| 							return (
|2185|2185| 								ent != oldTarget
|2186|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2187|    |-								|| (type.specific == oldType.specific
|    |2186|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2187|+								(type.specific == oldType.specific
|2188|2188| 								&& (type.specific != "meat" || oldTemplate == template)))
|2189|2189| 							);
|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| 							return (
|2185|2185| 								ent != oldTarget
|2186|2186| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2187|    |-								|| (type.specific == oldType.specific
|2188|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2187|+								|| (type.specific == oldType.specific &&
|    |2188|+								(type.specific != "meat" || oldTemplate == template)))
|2189|2189| 							);
|2190|2190| 						});
|2191|2191| 						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 (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
|2667|2667| 			},
|2668|2668| 
|2669|2669| 			"APPROACHINGMARKET": {
|2670|    |-				"enter": function () {
|    |2670|+				"enter": function() {
|2671|2671| 					this.SelectAnimation("move");
|2672|2672| 				},
|2673|2673| 
|    | [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
|2695|2695| 
|2696|2696| 		"REPAIR": {
|2697|2697| 			"APPROACHING": {
|2698|    |-				"enter": function () {
|    |2698|+				"enter": function() {
|2699|2699| 					this.SelectAnimation("move");
|2700|2700| 				},
|2701|2701| 
|    | [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
|2736|2736| 					{
|2737|2737| 						// The building was already finished/fully repaired before we arrived;
|2738|2738| 						// let the ConstructionFinished handler handle this.
|2739|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2739|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2740|2740| 						return true;
|2741|2741| 					}
|2742|2742| 
|    | [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
|2736|2736| 					{
|2737|2737| 						// The building was already finished/fully repaired before we arrived;
|2738|2738| 						// let the ConstructionFinished handler handle this.
|2739|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2739|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2740|2740| 						return true;
|2741|2741| 					}
|2742|2742| 
|    | [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
|2776|2776| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2777|2777| 						this.SetNextState("APPROACHING");
|2778|2778| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2779|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2779|+						this.FinishOrder(); // can't approach and isn't in reach
|2780|2780| 				},
|2781|2781| 			},
|2782|2782| 
|    | [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
|2843|2843| 					var types = cmpResourceDropsite.GetTypes();
|2844|2844| 					// TODO: Slightly undefined behavior here, we don't know what type of resource will be collected,
|2845|2845| 					//   may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that!
|2846|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2846|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2847|2847| 						return (types.indexOf(type.generic) != -1);
|2848|2848| 					}, msg.data.newentity);
|2849|2849| 					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
|2863|2863| 
|2864|2864| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2865|2865| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2866|    |-				{
|    |2866|+				
|2867|2867| 					// We're already walking to the given point, so add this as a order.
|2868|2868| 					this.WalkToTarget(msg.data.newentity, true);
|2869|    |-				}
|    |2869|+				
|2870|2870| 			},
|2871|2871| 		},
|2872|2872| 
|    | [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
|2913|2913| 
|2914|2914| 					// Check that we can garrison here
|2915|2915| 					if (this.CanGarrison(target))
|2916|    |-					{
|    |2916|+					
|2917|2917| 						// Check that we're in range of the garrison target
|2918|2918| 						if (this.CheckGarrisonRange(target))
|2919|2919| 						{
|2989|2989| 								return false;
|2990|2990| 							}
|2991|2991| 						}
|2992|    |-					}
|    |2992|+					
|2993|2993| 					// Garrisoning failed for some reason, so finish the order
|2994|2994| 					this.FinishOrder();
|2995|2995| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|3106|3106| 		"Attacked": function(msg) {
|3107|3107| 			if (this.template.NaturalBehaviour == "skittish" ||
|3108|3108| 			    this.template.NaturalBehaviour == "passive")
|3109|    |-			{
|    |3109|+			
|3110|3110| 				this.Flee(msg.data.attacker, false);
|3111|    |-			}
|    |3111|+			
|3112|3112| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3113|3113| 			{
|3114|3114| 				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
|3115|3115| 					this.Attack(msg.data.attacker, false);
|3116|3116| 			}
|3117|3117| 			else if (this.template.NaturalBehaviour == "domestic")
|3118|    |-			{
|    |3118|+			
|3119|3119| 				// Never flee, stop what we were doing
|3120|3120| 				this.SetNextState("IDLE");
|3121|    |-			}
|    |3121|+			
|3122|3122| 		},
|3123|3123| 
|3124|3124| 		"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
|3125|3125| 			// Move a tile outside the building
|3126|3126| 			var range = 4;
|3127|3127| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3128|    |-			{
|    |3128|+			
|3129|3129| 				// We've started walking to the given point
|3130|3130| 				this.SetNextState("WALKING");
|3131|    |-			}
|    |3131|+			
|3132|3132| 			else
|3133|3133| 			{
|3134|3134| 				// 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
|3130|3130| 				this.SetNextState("WALKING");
|3131|3131| 			}
|3132|3132| 			else
|3133|    |-			{
|    |3133|+			
|3134|3134| 				// We are already at the target, or can't move at all
|3135|3135| 				this.FinishOrder();
|3136|    |-			}
|    |3136|+			
|3137|3137| 		},
|3138|3138| 
|3139|3139| 		"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
|3172|3172| 				}
|3173|3173| 				// Start attacking one of the newly-seen enemy (if any)
|3174|3174| 				else if (this.IsDangerousAnimal())
|3175|    |-				{
|    |3175|+				
|3176|3176| 					this.AttackVisibleEntity(msg.data.added);
|3177|    |-				}
|    |3177|+				
|3178|3178| 
|3179|3179| 				// TODO: if two units enter our range together, we'll attack the
|3180|3180| 				// 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
|3215|3215| 				}
|3216|3216| 				// Start attacking one of the newly-seen enemy (if any)
|3217|3217| 				else if (this.template.NaturalBehaviour == "violent")
|3218|    |-				{
|    |3218|+				
|3219|3219| 					this.AttackVisibleEntity(msg.data.added);
|3220|    |-				}
|    |3220|+				
|3221|3221| 			},
|3222|3222| 
|3223|3223| 			"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
|3232|3232| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3233|3233| 
|3234|3234| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3235|    |-							// only used for domestic animals
|    |3235|+		// only used for domestic animals
|3236|3236| 	},
|3237|3237| };
|3238|3238| 
|    | [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
|3289|3289| 
|3290|3290| UnitAI.prototype.IsAnimal = function()
|3291|3291| {
|3292|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3292|+	return (!!this.template.NaturalBehaviour);
|3293|3293| };
|3294|3294| 
|3295|3295| 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
|3327|3327| UnitAI.prototype.GetGarrisonHolder = function()
|3328|3328| {
|3329|3329| 	if (this.IsGarrisoned())
|3330|    |-	{
|    |3330|+	
|3331|3331| 		for (let order of this.orderQueue)
|3332|3332| 			if (order.type == "Garrison" || order.type == "Autogarrison")
|3333|3333| 				return order.data.target;
|3334|    |-	}
|    |3334|+	
|3335|3335| 	return INVALID_ENTITY;
|3336|3336| };
|3337|3337| 
|    | [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
|3408|3408| 		{
|3409|3409| 			let index = this.GetCurrentState().indexOf(".");
|3410|3410| 			if (index != -1)
|3411|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3411|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3412|3412| 			this.Stop(false);
|3413|3413| 		}
|3414|3414| 
|    | [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
|3464|3464| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3465|3465| 			continue;
|3466|3466| 		if (i == 0)
|3467|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3467|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3468|3468| 		else
|3469|3469| 			this.orderQueue.splice(i, 1);
|3470|3470| 		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
|3464|3464| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3465|3465| 			continue;
|3466|3466| 		if (i == 0)
|3467|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3467|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3468|3468| 		else
|3469|3469| 			this.orderQueue.splice(i, 1);
|3470|3470| 		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
|3548|3548| };
|3549|3549| 
|3550|3550| 
|3551|    |-//// FSM linkage functions ////
|    |3551|+// // FSM linkage functions ////
|3552|3552| 
|3553|3553| UnitAI.prototype.SetNextState = function(state)
|3554|3554| {
|    | [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
|3599|3599| 	if (this.orderQueue.length)
|3600|3600| 	{
|3601|3601| 		let ret = this.UnitFsm.ProcessMessage(this,
|3602|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3602|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3603|3603| 		);
|3604|3604| 
|3605|3605| 		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
|3599|3599| 	if (this.orderQueue.length)
|3600|3600| 	{
|3601|3601| 		let ret = this.UnitFsm.ProcessMessage(this,
|3602|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3602|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3603|3603| 		);
|3604|3604| 
|3605|3605| 		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
|3612|3612| 		// Otherwise we've successfully processed a new order
|3613|3613| 		return true;
|3614|3614| 	}
|3615|    |-	else
|3616|    |-	{
|    |3615|+	
|3617|3616| 		this.SetNextState("IDLE");
|3618|3617| 
|3619|3618| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3634|3633| 		}
|3635|3634| 
|3636|3635| 		return false;
|3637|    |-	}
|    |3636|+	
|3638|3637| };
|3639|3638| 
|3640|3639| /**
|    | [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
|3651|3651| 	{
|3652|3652| 		this.order = order;
|3653|3653| 		let ret = this.UnitFsm.ProcessMessage(this,
|3654|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3654|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3655|3655| 		);
|3656|3656| 
|3657|3657| 		// 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
|3651|3651| 	{
|3652|3652| 		this.order = order;
|3653|3653| 		let ret = this.UnitFsm.ProcessMessage(this,
|3654|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3654|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3655|3655| 		);
|3656|3656| 
|3657|3657| 		// 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
|3687|3687| 		this.orderQueue.unshift(order);
|3688|3688| 		this.order = order;
|3689|3689| 		let ret = this.UnitFsm.ProcessMessage(this,
|3690|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3690|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3691|3691| 		);
|3692|3692| 
|3693|3693| 		// 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
|3687|3687| 		this.orderQueue.unshift(order);
|3688|3688| 		this.order = order;
|3689|3689| 		let ret = this.UnitFsm.ProcessMessage(this,
|3690|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3690|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3691|3691| 		);
|3692|3692| 
|3693|3693| 		// 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
|3721|3721| 				continue;
|3722|3722| 			if (this.orderQueue[i].type == type)
|3723|3723| 				continue;
|3724|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3724|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3725|3725| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3726|3726| 			return;
|3727|3727| 		}
|    | [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
|3721|3721| 				continue;
|3722|3722| 			if (this.orderQueue[i].type == type)
|3723|3723| 				continue;
|3724|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3724|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3725|3725| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3726|3726| 			return;
|3727|3727| 		}
|    | [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
|3735|3735| {
|3736|3736| 	// Remember the previous work orders to be able to go back to them later if required
|3737|3737| 	if (data && data.force)
|3738|    |-	{
|    |3738|+	
|3739|3739| 		if (this.IsFormationController())
|3740|3740| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3741|3741| 		else
|3742|3742| 			this.UpdateWorkOrders(type);
|3743|    |-	}
|    |3743|+	
|3744|3744| 
|3745|3745| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3746|3746| 
|    | [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
|3812|3812| 	{
|3813|3813| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3814|3814| 		if (cmpUnitAI)
|3815|    |-		{
|    |3815|+		
|3816|3816| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3817|3817| 			{
|3818|3818| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3821|3821| 					return;
|3822|3822| 				}
|3823|3823| 			}
|3824|    |-		}
|    |3824|+		
|3825|3825| 	}
|3826|3826| 
|3827|3827| 	// 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
|3814|3814| 		if (cmpUnitAI)
|3815|3815| 		{
|3816|3816| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3817|    |-			{
|    |3817|+			
|3818|3818| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3819|3819| 				{
|3820|3820| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3821|3821| 					return;
|3822|3822| 				}
|3823|    |-			}
|    |3823|+			
|3824|3824| 		}
|3825|3825| 	}
|3826|3826| 
|    | [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
|3826|3826| 
|3827|3827| 	// If nothing found, take the unit orders
|3828|3828| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3829|    |-	{
|    |3829|+	
|3830|3830| 		if (isWorkType(this.orderQueue[i].type))
|3831|3831| 		{
|3832|3832| 			this.workOrders = this.orderQueue.slice(i);
|3833|3833| 			return;
|3834|3834| 		}
|3835|    |-	}
|    |3835|+	
|3836|3836| };
|3837|3837| 
|3838|3838| 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
|3892|3892| 	if (data.timerRepeat === undefined)
|3893|3893| 		this.timer = undefined;
|3894|3894| 
|3895|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3895|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3896|3896| };
|3897|3897| 
|3898|3898| /**
|    | [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
|3892|3892| 	if (data.timerRepeat === undefined)
|3893|3893| 		this.timer = undefined;
|3894|3894| 
|3895|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3895|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3896|3896| };
|3897|3897| 
|3898|3898| /**
|    | [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
|3927|3927| 	this.timer = undefined;
|3928|3928| };
|3929|3929| 
|3930|    |-//// Message handlers /////
|    |3930|+// // Message handlers /////
|3931|3931| 
|3932|3932| UnitAI.prototype.OnMotionChanged = function(msg)
|3933|3933| {
|    | [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
|3932|3932| UnitAI.prototype.OnMotionChanged = function(msg)
|3933|3933| {
|3934|3934| 	if (msg.starting && !msg.error)
|3935|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3935|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3936|3936| 	else if (!msg.starting || msg.error)
|3937|3937| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3938|3938| };
|    | [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
|3932|3932| UnitAI.prototype.OnMotionChanged = function(msg)
|3933|3933| {
|3934|3934| 	if (msg.starting && !msg.error)
|3935|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3935|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3936|3936| 	else if (!msg.starting || msg.error)
|3937|3937| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3938|3938| };
|    | [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
|3934|3934| 	if (msg.starting && !msg.error)
|3935|3935| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3936|3936| 	else if (!msg.starting || msg.error)
|3937|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3937|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3938|3938| };
|3939|3939| 
|3940|3940| 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
|3934|3934| 	if (msg.starting && !msg.error)
|3935|3935| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3936|3936| 	else if (!msg.starting || msg.error)
|3937|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3937|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3938|3938| };
|3939|3939| 
|3940|3940| 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
|3942|3942| 	// TODO: This is a bit inefficient since every unit listens to every
|3943|3943| 	// construction message - ideally we could scope it to only the one we're building
|3944|3944| 
|3945|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3945|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3946|3946| };
|3947|3947| 
|3948|3948| 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
|3942|3942| 	// TODO: This is a bit inefficient since every unit listens to every
|3943|3943| 	// construction message - ideally we could scope it to only the one we're building
|3944|3944| 
|3945|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3945|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3946|3946| };
|3947|3947| 
|3948|3948| 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
|3967|3967| 
|3968|3968| UnitAI.prototype.OnAttacked = function(msg)
|3969|3969| {
|3970|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3970|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3971|3971| };
|3972|3972| 
|3973|3973| 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
|3967|3967| 
|3968|3968| UnitAI.prototype.OnAttacked = function(msg)
|3969|3969| {
|3970|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3970|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3971|3971| };
|3972|3972| 
|3973|3973| 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
|3972|3972| 
|3973|3973| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3974|3974| {
|3975|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3975|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3976|3976| };
|3977|3977| 
|3978|3978| 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
|3972|3972| 
|3973|3973| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3974|3974| {
|3975|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3975|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3976|3976| };
|3977|3977| 
|3978|3978| 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
|3977|3977| 
|3978|3978| UnitAI.prototype.OnHealthChanged = function(msg)
|3979|3979| {
|3980|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3980|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3981|3981| };
|3982|3982| 
|3983|3983| 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
|3977|3977| 
|3978|3978| UnitAI.prototype.OnHealthChanged = function(msg)
|3979|3979| {
|3980|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3980|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3981|3981| };
|3982|3982| 
|3983|3983| 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
|3983|3983| UnitAI.prototype.OnRangeUpdate = function(msg)
|3984|3984| {
|3985|3985| 	if (msg.tag == this.losRangeQuery)
|3986|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3986|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3987|3987| 	else if (msg.tag == this.losHealRangeQuery)
|3988|3988| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3989|3989| };
|    | [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
|3983|3983| UnitAI.prototype.OnRangeUpdate = function(msg)
|3984|3984| {
|3985|3985| 	if (msg.tag == this.losRangeQuery)
|3986|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3986|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3987|3987| 	else if (msg.tag == this.losHealRangeQuery)
|3988|3988| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3989|3989| };
|    | [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
|3985|3985| 	if (msg.tag == this.losRangeQuery)
|3986|3986| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3987|3987| 	else if (msg.tag == this.losHealRangeQuery)
|3988|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3988|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3989|3989| };
|3990|3990| 
|3991|3991| 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
|3985|3985| 	if (msg.tag == this.losRangeQuery)
|3986|3986| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3987|3987| 	else if (msg.tag == this.losHealRangeQuery)
|3988|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3988|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3989|3989| };
|3990|3990| 
|3991|3991| 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
|3990|3990| 
|3991|3991| UnitAI.prototype.OnPackFinished = function(msg)
|3992|3992| {
|3993|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3993|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3994|3994| };
|3995|3995| 
|3996|3996| //// 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
|3990|3990| 
|3991|3991| UnitAI.prototype.OnPackFinished = function(msg)
|3992|3992| {
|3993|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3993|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3994|3994| };
|3995|3995| 
|3996|3996| //// 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
|3993|3993| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3994|3994| };
|3995|3995| 
|3996|    |-//// Helper functions to be called by the FSM ////
|    |3996|+// // Helper functions to be called by the FSM ////
|3997|3997| 
|3998|3998| UnitAI.prototype.GetWalkSpeed = function()
|3999|3999| {
|    | [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
|4097|4097| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4098|4098| 		return undefined;
|4099|4099| 
|4100|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4100|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4101|4101| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4102|4102| 		return undefined;
|4103|4103| 
|    | [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
|4182|4182| 			PlaySound(name, member);
|4183|4183| 	}
|4184|4184| 	else
|4185|    |-	{
|    |4185|+	
|4186|4186| 		// Otherwise use our own sounds
|4187|4187| 		PlaySound(name, this.entity);
|4188|    |-	}
|    |4188|+	
|4189|4189| };
|4190|4190| 
|4191|4191| /*
|    | [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
|4351|4351| 	else
|4352|4352| 		// return false? Or hope you come close enough?
|4353|4353| 		var parabolicMaxRange = 0;
|4354|    |-		//return false;
|    |4354|+		// return false;
|4355|4355| 
|4356|4356| 	// the parabole changes while walking, take something in the middle
|4357|4357| 	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
|4416|4416| 	if (this.IsFormationMember())
|4417|4417| 	{
|4418|4418| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4419|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4420|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4419|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4420|+			cmpFormationUnitAI.order.data.target == target)
|4421|4421| 			return true;
|4422|4422| 	}
|4423|4423| 
|    | [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
|4536|4536| 	var pos = cmpPosition.GetPosition();
|4537|4537| 	var heldPosition = this.heldPosition;
|4538|4538| 	if (heldPosition === undefined)
|4539|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4539|+		heldPosition = { "x": pos.x, "z": pos.z};
|4540|4540| 
|4541|4541| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4542|4542| };
|    | [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
|4536|4536| 	var pos = cmpPosition.GetPosition();
|4537|4537| 	var heldPosition = this.heldPosition;
|4538|4538| 	if (heldPosition === undefined)
|4539|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4539|+		heldPosition = {"x": pos.x, "z": pos.z };
|4540|4540| 
|4541|4541| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4542|4542| };
|    | [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
|4584|4584| UnitAI.prototype.AttackEntityInZone = function(ents)
|4585|4585| {
|4586|4586| 	var target = ents.find(target =>
|4587|    |-		this.CanAttack(target)
|4588|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4587|+		this.CanAttack(target) &&
|    |4588|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4589|4589| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4590|4590| 	);
|4591|4591| 	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
|4585|4585| {
|4586|4586| 	var target = ents.find(target =>
|4587|4587| 		this.CanAttack(target)
|4588|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4589|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4588|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4589|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4590|4590| 	);
|4591|4591| 	if (!target)
|4592|4592| 		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
|4649|4649| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4650|4650| 	if (this.isGuardOf)
|4651|4651| 	{
|4652|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4652|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4653|4653| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4654|4654| 		if (cmpUnitAI && cmpAttack &&
|4655|4655| 		    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
|4653|4653| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4654|4654| 		if (cmpUnitAI && cmpAttack &&
|4655|4655| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4656|    |-				return false;
|    |4656|+			return false;
|4657|4657| 	}
|4658|4658| 
|4659|4659| 	// 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
|4658|4658| 
|4659|4659| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4660|4660| 	if (this.GetStance().respondHoldGround)
|4661|    |-	{
|    |4661|+	
|4662|4662| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4663|4663| 			return true;
|4664|    |-	}
|    |4664|+	
|4665|4665| 
|4666|4666| 	// Stop if it's left our vision range, unless we're especially persistent
|4667|4667| 	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
|4665|4665| 
|4666|4666| 	// Stop if it's left our vision range, unless we're especially persistent
|4667|4667| 	if (!this.GetStance().respondChaseBeyondVision)
|4668|    |-	{
|    |4668|+	
|4669|4669| 		if (!this.CheckTargetIsInVisionRange(target))
|4670|4670| 			return true;
|4671|    |-	}
|    |4671|+	
|4672|4672| 
|4673|4673| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4674|4674| 	// 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
|4696|4696| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4697|4697| 	if (this.isGuardOf)
|4698|4698| 	{
|4699|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4699|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4700|4700| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4701|4701| 		if (cmpUnitAI && cmpAttack &&
|4702|4702| 		    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
|4709|4709| 	return false;
|4710|4710| };
|4711|4711| 
|4712|    |-//// External interface functions ////
|    |4712|+// // External interface functions ////
|4713|4713| 
|4714|4714| UnitAI.prototype.SetFormationController = function(ent)
|4715|4715| {
|    | [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
|4719|4719| 	// of our own formation (or ourself if not in formation)
|4720|4720| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4721|4721| 	if (cmpObstruction)
|4722|    |-	{
|    |4722|+	
|4723|4723| 		if (ent == INVALID_ENTITY)
|4724|4724| 			cmpObstruction.SetControlGroup(this.entity);
|4725|4725| 		else
|4726|4726| 			cmpObstruction.SetControlGroup(ent);
|4727|    |-	}
|    |4727|+	
|4728|4728| 
|4729|4729| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4730|4730| 	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
|4862|4862| 	// if we already had an old guard order, do nothing if the target is the same
|4863|4863| 	// and the order is running, otherwise remove the previous order
|4864|4864| 	if (this.isGuardOf)
|4865|    |-	{
|    |4865|+	
|4866|4866| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4867|4867| 			return;
|4868|4868| 		else
|4869|4869| 			this.RemoveGuard();
|4870|    |-	}
|    |4870|+	
|4871|4871| 
|4872|4872| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4873|4873| };
|    | [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
|4865|4865| 	{
|4866|4866| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4867|4867| 			return;
|4868|    |-		else
|4869|    |-			this.RemoveGuard();
|    |4868|+		this.RemoveGuard();
|4870|4869| 	}
|4871|4870| 
|4872|4871| 	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
|4907|4907| 		return;
|4908|4908| 
|4909|4909| 	if (this.order.type == "Guard")
|4910|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4910|+		this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"});
|4911|4911| 	else
|4912|4912| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4913|4913| 			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
|4907|4907| 		return;
|4908|4908| 
|4909|4909| 	if (this.order.type == "Guard")
|4910|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4910|+		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" });
|4911|4911| 	else
|4912|4912| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4913|4913| 			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
|5036|5036| 			this.WalkToTarget(target, queued);
|5037|5037| 		return;
|5038|5038| 	}
|5039|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |5039|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|5040|5040| };
|5041|5041| 
|5042|5042| /**
|    | [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
|5185|5185| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5186|5186| 	{
|5187|5187| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5188|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5188|+		if (cmpTrader.HasBothMarkets() &&
|5189|5189| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5190|5190| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5191|5191| 		{
|    | [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
|5466|5466| 				{
|5467|5467| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5468|5468| 					var targetClasses = this.order.data.targetClasses;
|5469|    |-					if (targetClasses.attack && cmpIdentity
|5470|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5469|+					if (targetClasses.attack && cmpIdentity &&
|    |5470|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5471|5471| 						continue;
|5472|5472| 					if (targetClasses.avoid && cmpIdentity
|5473|5473| 						&& 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
|5469|5469| 					if (targetClasses.attack && cmpIdentity
|5470|5470| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5471|5471| 						continue;
|5472|    |-					if (targetClasses.avoid && cmpIdentity
|5473|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5472|+					if (targetClasses.avoid && cmpIdentity &&
|    |5473|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5474|5474| 						continue;
|5475|5475| 					// Only used by the AIs to prevent some choices of targets
|5476|5476| 					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
|5492|5492| 		{
|5493|5493| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5494|5494| 			var targetClasses = this.order.data.targetClasses;
|5495|    |-			if (cmpIdentity && targetClasses.attack
|5496|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5495|+			if (cmpIdentity && targetClasses.attack &&
|    |5496|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5497|5497| 				continue;
|5498|5498| 			if (cmpIdentity && targetClasses.avoid
|5499|5499| 				&& 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
|5495|5495| 			if (cmpIdentity && targetClasses.attack
|5496|5496| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5497|5497| 				continue;
|5498|    |-			if (cmpIdentity && targetClasses.avoid
|5499|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5498|+			if (cmpIdentity && targetClasses.avoid &&
|    |5499|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5500|5500| 				continue;
|5501|5501| 			// Only used by the AIs to prevent some choices of targets
|5502|5502| 			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
|5535|5535| 
|5536|5536| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5537|5537| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5538|    |-	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|    |5538|+	var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5539|5539| 		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5540|5540| 
|5541|5541| 	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
|5536|5536| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5537|5537| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5538|5538| 	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5539|    |-		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|    |5539|+		.sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5540|5540| 
|5541|5541| 	return targets;
|5542|5542| };
|    | [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
|5625|5625| 
|5626|5626| UnitAI.prototype.SetHeldPosition = function(x, z)
|5627|5627| {
|5628|    |-	this.heldPosition = {"x": x, "z": z};
|    |5628|+	this.heldPosition = { "x": x, "z": z};
|5629|5629| };
|5630|5630| 
|5631|5631| 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
|5625|5625| 
|5626|5626| UnitAI.prototype.SetHeldPosition = function(x, z)
|5627|5627| {
|5628|    |-	this.heldPosition = {"x": x, "z": z};
|    |5628|+	this.heldPosition = {"x": x, "z": z };
|5629|5629| };
|5630|5630| 
|5631|5631| 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
|5652|5652| 	return false;
|5653|5653| };
|5654|5654| 
|5655|    |-//// Helper functions ////
|    |5655|+// // Helper functions ////
|5656|5656| 
|5657|5657| UnitAI.prototype.CanAttack = function(target)
|5658|5658| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5856|5856| 	return (cmpPack && cmpPack.IsPacking());
|5857|5857| };
|5858|5858| 
|5859|    |-//// Formation specific functions ////
|    |5859|+// // Formation specific functions ////
|5860|5860| 
|5861|5861| UnitAI.prototype.IsAttackingAsFormation = function()
|5862|5862| {
|    | [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
|5861|5861| UnitAI.prototype.IsAttackingAsFormation = function()
|5862|5862| {
|5863|5863| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5864|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5865|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5864|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5865|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5866|5866| };
|5867|5867| 
|5868|5868| //// 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
|5865|5865| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5866|5866| };
|5867|5867| 
|5868|    |-//// Animal specific functions ////
|    |5868|+// // Animal specific functions ////
|5869|5869| 
|5870|5870| UnitAI.prototype.MoveRandomly = function(distance)
|5871|5871| {

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
|3797| »   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
|4571| »   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
|4586| »   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
|4632| »   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
|4655| »   »   ····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
|5116| »   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
| 362| »   »   ····&&·(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
|1903| »   »   »   »   »   »   var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation);
|    | [NORMAL] JSHintBear:
|    | 'cmpFormation' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2186| »   »   »   »   »   »   »   »   &&·((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
|2187| »   »   »   »   »   »   »   »   ||·(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
|2188| »   »   »   »   »   »   »   »   &&·(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
|2647| »   »   »   »   »   var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer);
|    | [NORMAL] JSHintBear:
|    | 'cmpResourceGatherer' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

elexis added a subscriber: elexis.Mar 10 2018, 4:16 PM

Probably no opposition from my side if it works as intended.
Might be useful for triggerscripts too, scripted ships also sometimes prefer hanging around towers.

binaries/data/mods/public/simulation/components/UnitAI.js
117 ↗(On Diff #6094)

\n

5611 ↗(On Diff #6094)

All stances are possible, "GetSelectableStances" would be a more fitting name.
A "selectable" boolean property would remove the hardcoding that is limiting if we can't rule out that this will be the only nonselectable stance.

mimo updated this revision to Diff 6115.Mar 10 2018, 4:48 PM
mimo retitled this revision from Add a null stance in UnitAI to be used by the AI to Add a null stance in UnitAI to be used by the AI.

update patch following elexis suggestions

Owners added a subscriber: Restricted Owners Package.Mar 10 2018, 4:48 PM

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 (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 462| 462| 				continue;
| 463| 463| 
| 464| 464| 			if (state.pack.progress == 0)
| 465|    |-			{
|    | 465|+			
| 466| 466| 				if (state.pack.packed)
| 467| 467| 					checks.unpackButton = true;
| 468| 468| 				else
| 469| 469| 					checks.packButton = true;
| 470|    |-			}
|    | 470|+			
| 471| 471| 			else if (state.pack.packed)
| 472| 472| 				checks.unpackCancelButton = true;
| 473| 473| 			else
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels.js
| 777| 777| 				addResearchToQueue(data.item.researchFacilityId, tech);
| 778| 778| 			};
| 779| 779| 
| 780|    |-			button.onPressRight = function () {
|    | 780|+			button.onPressRight = function() {
| 781| 781| 				let researcherTemplate;
| 782| 782| 				for (let selectedEntity of data.unitEntStates)
| 783| 783| 					if (selectedEntity.id == data.item.researchFacilityId)

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

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

binaries/data/mods/public/gui/session/selection_panels.js
| 745| »   »   »   »   »   »   switch·(entity.check)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|  66|  66| 		let phase = "";
|  67|  67| 		let cmpTechnologyManager = QueryPlayerIDInterface(i, IID_TechnologyManager);
|  68|  68| 		if (cmpTechnologyManager)
|  69|    |-		{
|    |  69|+		
|  70|  70| 			if (cmpTechnologyManager.IsTechnologyResearched("phase_city"))
|  71|  71| 				phase = "city";
|  72|  72| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_town"))
|  73|  73| 				phase = "town";
|  74|  74| 			else if (cmpTechnologyManager.IsTechnologyResearched("phase_village"))
|  75|  75| 				phase = "village";
|  76|    |-		}
|    |  76|+		
|  77|  77| 
|  78|  78| 		// store player ally/neutral/enemy data as arrays
|  79|  79| 		let allies = [];
|    | [NORMAL] ESLintBear (key-spacing):
|    | Extra space after key 'upgrades'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 286| 286| 	var cmpUpgrade = Engine.QueryInterface(ent, IID_Upgrade);
| 287| 287| 	if (cmpUpgrade)
| 288| 288| 		ret.upgrade = {
| 289|    |-			"upgrades" : cmpUpgrade.GetUpgrades(),
|    | 289|+			"upgrades": cmpUpgrade.GetUpgrades(),
| 290| 290| 			"progress": cmpUpgrade.GetProgress(),
| 291| 291| 			"template": cmpUpgrade.GetUpgradingTo()
| 292| 292| 		};
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'isIdle'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 350| 350| 			"isGuarding": cmpUnitAI.IsGuardOf(),
| 351| 351| 			"canPatrol": cmpUnitAI.CanPatrol(),
| 352| 352| 			"selectableStances": cmpUnitAI.GetSelectableStances(),
| 353|    |-			"isIdle":cmpUnitAI.IsIdle(),
|    | 353|+			"isIdle": cmpUnitAI.IsIdle(),
| 354| 354| 		};
| 355| 355| 
| 356| 356| 	let cmpGuard = Engine.QueryInterface(ent, IID_Guard);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 410| 410| 			ret.attack[type].elevationBonus = range.elevationBonus;
| 411| 411| 
| 412| 412| 			if (cmpUnitAI && cmpPosition && cmpPosition.IsInWorld())
| 413|    |-			{
|    | 413|+			
| 414| 414| 				// For units, take the range in front of it, no spread. So angle = 0
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416|    |-			}
|    | 416|+			
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418| 418| 			{
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 415| 415| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 0);
| 416| 416| 			}
| 417| 417| 			else if(cmpPosition && cmpPosition.IsInWorld())
| 418|    |-			{
|    | 418|+			
| 419| 419| 				// For buildings, take the average elevation around it. So angle = 2*pi
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421|    |-			}
|    | 421|+			
| 422| 422| 			else
| 423| 423| 			{
| 424| 424| 				// not in world, set a default?
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 420| 420| 				ret.attack[type].elevationAdaptedRange = cmpRangeManager.GetElevationAdaptedRange(cmpPosition.GetPosition(), cmpPosition.GetRotation(), range.max, range.elevationBonus, 2*Math.PI);
| 421| 421| 			}
| 422| 422| 			else
| 423|    |-			{
|    | 423|+			
| 424| 424| 				// not in world, set a default?
| 425| 425| 				ret.attack[type].elevationAdaptedRange = ret.attack.maxRange;
| 426|    |-			}
|    | 426|+			
| 427| 427| 		}
| 428| 428| 	}
| 429| 429| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 791| 791| 		updateEntityColor(data.showAllStatusBars && (i == player || player == -1) ?
| 792| 792| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer, IID_StatusBars] :
| 793| 793| 			[IID_Minimap, IID_RangeOverlayRenderer, IID_RallyPointRenderer],
| 794|    |-			cmpRangeManager.GetEntitiesByPlayer(i));
|    | 794|+		cmpRangeManager.GetEntitiesByPlayer(i));
| 795| 795| 	}
| 796| 796| 	updateEntityColor([IID_Selectable, IID_StatusBars], data.selected);
| 797| 797| 	Engine.QueryInterface(SYSTEM_ENTITY, IID_TerritoryManager).UpdateColors();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'r'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 816| 816| 		let color = playerColors[owner];
| 817| 817| 		if (!color)
| 818| 818| 		{
| 819|    |-			color = { "r":1, "g":1, "b":1 };
|    | 819|+			color = { "r": 1, "g":1, "b":1 };
| 820| 820| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 821| 821| 			if (cmpPlayer)
| 822| 822| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'g'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 816| 816| 		let color = playerColors[owner];
| 817| 817| 		if (!color)
| 818| 818| 		{
| 819|    |-			color = { "r":1, "g":1, "b":1 };
|    | 819|+			color = { "r":1, "g": 1, "b":1 };
| 820| 820| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 821| 821| 			if (cmpPlayer)
| 822| 822| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'b'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 816| 816| 		let color = playerColors[owner];
| 817| 817| 		if (!color)
| 818| 818| 		{
| 819|    |-			color = { "r":1, "g":1, "b":1 };
|    | 819|+			color = { "r":1, "g":1, "b": 1 };
| 820| 820| 			let cmpPlayer = QueryPlayerIDInterface(owner);
| 821| 821| 			if (cmpPlayer)
| 822| 822| 				color = cmpPlayer.GetDisplayedColor();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 4 spaces.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
| 895| 895| 
| 896| 896| GuiInterface.prototype.GetNonGaiaEntities = function()
| 897| 897| {
| 898|    |-    return Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager).GetNonGaiaEntities();
|    | 898|+	return Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager).GetNonGaiaEntities();
| 899| 899| };
| 900| 900| 
| 901| 901| /**
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1310|1310| 		}
|1311|1311| 	}
|1312|1312| 	else
|1313|    |-	{
|    |1313|+	
|1314|1314| 		// Didn't snap to an existing entity, add the starting tower manually. To prevent odd-looking rotation jumps
|1315|1315| 		// when shift-clicking to build a wall, reuse the placement angle that was last seen on a validly positioned
|1316|1316| 		// wall piece.
|1331|1331| 			"pos": start.pos,
|1332|1332| 			"angle": previewEntities.length > 0 ? previewEntities[0].angle : this.placementWallLastAngle
|1333|1333| 		});
|1334|    |-	}
|    |1334|+	
|1335|1335| 
|1336|1336| 	if (end.pos)
|1337|1337| 	{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1334|1334| 	}
|1335|1335| 
|1336|1336| 	if (end.pos)
|1337|    |-	{
|    |1337|+	
|1338|1338| 		// Analogous to the starting side case above
|1339|1339| 		if (end.snappedEnt && end.snappedEnt != INVALID_ENTITY)
|1340|1340| 		{
|1372|1372| 				"pos": end.pos,
|1373|1373| 				"angle": previewEntities.length > 0 ? previewEntities[previewEntities.length-1].angle : this.placementWallLastAngle
|1374|1374| 			});
|1375|    |-	}
|    |1375|+	
|1376|1376| 
|1377|1377| 	let cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain);
|1378|1378| 	if (!cmpTerrain)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1550|1550| 
|1551|1551| 		let cmpVisual = Engine.QueryInterface(ent, IID_Visual);
|1552|1552| 		if (cmpVisual)
|1553|    |-		{
|    |1553|+		
|1554|1554| 			if (!allPiecesValid || !canAfford)
|1555|1555| 				cmpVisual.SetShadingColor(1.4, 0.4, 0.4, 1);
|1556|1556| 			else
|1557|1557| 				cmpVisual.SetShadingColor(1, 1, 1, 1);
|1558|    |-		}
|    |1558|+		
|1559|1559| 
|1560|1560| 		++entPool.numUsed;
|1561|1561| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1624|1624| 			{
|1625|1625| 				minDist2 = dist2;
|1626|1626| 				minDistEntitySnapData = {
|1627|    |-						"x": pos.x,
|    |1627|+					"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1625|1625| 				minDist2 = dist2;
|1626|1626| 				minDistEntitySnapData = {
|1627|1627| 						"x": pos.x,
|1628|    |-						"z": pos.z,
|    |1628|+					"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|1631|1631| 				};
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1626|1626| 				minDistEntitySnapData = {
|1627|1627| 						"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|    |-						"angle": cmpPosition.GetRotation().y,
|    |1629|+					"angle": cmpPosition.GetRotation().y,
|1630|1630| 						"ent": ent
|1631|1631| 				};
|1632|1632| 			}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 5 tabs but found 6.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1627|1627| 						"x": pos.x,
|1628|1628| 						"z": pos.z,
|1629|1629| 						"angle": cmpPosition.GetRotation().y,
|1630|    |-						"ent": ent
|    |1630|+					"ent": ent
|1631|1631| 				};
|1632|1632| 			}
|1633|1633| 		}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1772|1772| 			result.gain = cmpEntityTrader.GetGoods().amount;
|1773|1773| 	}
|1774|1774| 	else if (data.target === secondMarket)
|1775|    |-	{
|    |1775|+	
|1776|1776| 		result = {
|1777|1777| 			"type": "is second",
|1778|1778| 			"gain": cmpEntityTrader.GetGoods().amount,
|1779|1779| 		};
|1780|    |-	}
|    |1780|+	
|1781|1781| 	else if (!firstMarket)
|1782|1782| 	{
|1783|1783| 		result = { "type": "set first" };
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1779|1779| 		};
|1780|1780| 	}
|1781|1781| 	else if (!firstMarket)
|1782|    |-	{
|    |1782|+	
|1783|1783| 		result = { "type": "set first" };
|1784|    |-	}
|    |1784|+	
|1785|1785| 	else if (!secondMarket)
|1786|1786| 	{
|1787|1787| 		result = {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1783|1783| 		result = { "type": "set first" };
|1784|1784| 	}
|1785|1785| 	else if (!secondMarket)
|1786|    |-	{
|    |1786|+	
|1787|1787| 		result = {
|1788|1788| 			"type": "set second",
|1789|1789| 			"gain": cmpEntityTrader.CalculateGain(firstMarket, data.target),
|1790|1790| 		};
|1791|    |-	}
|    |1791|+	
|1792|1792| 	else
|1793|1793| 	{
|1794|1794| 		// Else both markets are not null and target is different from them
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/GuiInterface.js
|1790|1790| 		};
|1791|1791| 	}
|1792|1792| 	else
|1793|    |-	{
|    |1793|+	
|1794|1794| 		// Else both markets are not null and target is different from them
|1795|1795| 		result = { "type": "set first" };
|1796|    |-	}
|    |1796|+	
|1797|1797| 	return result;
|1798|1798| };
|1799|1799| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
| 229| 229| 		// Move a tile outside the building
| 230| 230| 		let range = 4;
| 231| 231| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 232|    |-		{
|    | 232|+		
| 233| 233| 			// We've started walking to the given point
| 234| 234| 			this.SetNextState("INDIVIDUAL.WALKING");
| 235|    |-		}
|    | 235|+		
| 236| 236| 		else
| 237| 237| 		{
| 238| 238| 			// 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
| 234| 234| 			this.SetNextState("INDIVIDUAL.WALKING");
| 235| 235| 		}
| 236| 236| 		else
| 237|    |-		{
|    | 237|+		
| 238| 238| 			// We are already at the target, or can't move at all
| 239| 239| 			this.FinishOrder();
| 240|    |-		}
|    | 240|+		
| 241| 241| 	},
| 242| 242| 
| 243| 243| 	// 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
| 339| 339| 
| 340| 340| 		var ok = this.MoveToTarget(this.order.data.target);
| 341| 341| 		if (ok)
| 342|    |-		{
|    | 342|+		
| 343| 343| 			// We've started walking to the given point
| 344| 344| 			if (this.IsAnimal())
| 345| 345| 				this.SetNextState("ANIMAL.WALKING");
| 346| 346| 			else
| 347| 347| 				this.SetNextState("INDIVIDUAL.WALKING");
| 348|    |-		}
|    | 348|+		
| 349| 349| 		else
| 350| 350| 		{
| 351| 351| 			// 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
| 367| 367| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 368| 368| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 369| 369| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 370|    |-		{
|    | 370|+		
| 371| 371| 			// we were already on the shoreline, and have not moved since
| 372| 372| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 373| 373| 				needToMove = false;
| 374|    |-		}
|    | 374|+		
| 375| 375| 
| 376| 376| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 377| 377| 		// 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
| 365| 365| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 366| 366| 		var needToMove = true;
| 367| 367| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 368|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 369|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 368|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 369|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 370| 370| 		{
| 371| 371| 			// we were already on the shoreline, and have not moved since
| 372| 372| 			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
| 376| 376| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 377| 377| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 378| 378| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 379|    |-		{
|    | 379|+		
| 380| 380| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 381|    |-		}
|    | 381|+		
| 382| 382| 		else
| 383| 383| 		{
| 384| 384| 			// 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
| 405| 405| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 406| 406| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 407| 407| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 408|    |-		{
|    | 408|+		
| 409| 409| 			// We've started fleeing from the given target
| 410| 410| 			if (this.IsAnimal())
| 411| 411| 				this.SetNextState("ANIMAL.FLEEING");
| 412| 412| 			else
| 413| 413| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 414|    |-		}
|    | 414|+		
| 415| 415| 		else
| 416| 416| 		{
| 417| 417| 			// 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
| 461| 461| 			}
| 462| 462| 
| 463| 463| 			if (this.order.data.attackType == this.oldAttackType)
| 464|    |-			{
|    | 464|+			
| 465| 465| 				if (this.IsAnimal())
| 466| 466| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 467| 467| 				else
| 468| 468| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 469|    |-			}
|    | 469|+			
| 470| 470| 			else
| 471| 471| 			{
| 472| 472| 				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
| 468| 468| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 469| 469| 			}
| 470| 470| 			else
| 471|    |-			{
|    | 471|+			
| 472| 472| 				if (this.IsAnimal())
| 473| 473| 					this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
| 474| 474| 				else
| 475| 475| 					this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
| 476|    |-			}
|    | 476|+			
| 477| 477| 			return;
| 478| 478| 		}
| 479| 479| 
|    | [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
| 606| 606| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 607| 607| 				}
| 608| 608| 				else
| 609|    |-				{
|    | 609|+				
| 610| 610| 					// We couldn't move there, or the target moved away
| 611| 611| 					this.FinishOrder();
| 612|    |-				}
|    | 612|+				
| 613| 613| 				return;
| 614| 614| 			}
| 615| 615| 
|    | [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
| 619| 619| 
| 620| 620| 		// Try to move within range
| 621| 621| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 622|    |-		{
|    | 622|+		
| 623| 623| 			// We've started walking to the given point
| 624| 624| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 625|    |-		}
|    | 625|+		
| 626| 626| 		else
| 627| 627| 		{
| 628| 628| 			// 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
| 696| 696| 	"Order.Repair": function(msg) {
| 697| 697| 		// Try to move within range
| 698| 698| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 699|    |-		{
|    | 699|+		
| 700| 700| 			// We've started walking to the given point
| 701| 701| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 702|    |-		}
|    | 702|+		
| 703| 703| 		else
| 704| 704| 		{
| 705| 705| 			// 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
| 733| 733| 		}
| 734| 734| 
| 735| 735| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 736|    |-		{
|    | 736|+		
| 737| 737| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 738|    |-		}
|    | 738|+		
| 739| 739| 		else
| 740| 740| 		{
| 741| 741| 			// 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
| 871| 871| 			if (!this.CheckTargetAttackRange(target, target))
| 872| 872| 			{
| 873| 873| 				if (this.TargetIsAlive(target) && this.CheckTargetVisible(target))
| 874|    |-				{
|    | 874|+				
| 875| 875| 					if (this.MoveToTargetAttackRange(target, target))
| 876| 876| 					{
| 877| 877| 						this.SetNextState("COMBAT.APPROACHING");
| 878| 878| 						return;
| 879| 879| 					}
| 880|    |-				}
|    | 880|+				
| 881| 881| 				this.FinishOrder();
| 882| 882| 				return;
| 883| 883| 			}
|    | [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
| 896| 896| 			}
| 897| 897| 			// Check if we are already in range, otherwise walk there
| 898| 898| 			if (!this.CheckGarrisonRange(msg.data.target))
| 899|    |-			{
|    | 899|+			
| 900| 900| 				if (!this.CheckTargetVisible(msg.data.target))
| 901| 901| 				{
| 902| 902| 					this.FinishOrder();
| 911| 911| 						return;
| 912| 912| 					}
| 913| 913| 				}
| 914|    |-			}
|    | 914|+			
| 915| 915| 
| 916| 916| 			this.SetNextState("GARRISON.GARRISONING");
| 917| 917| 		},
|    | [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
| 903| 903| 					return;
| 904| 904| 				}
| 905| 905| 				else
| 906|    |-				{
|    | 906|+				
| 907| 907| 					// Out of range; move there in formation
| 908| 908| 					if (this.MoveToGarrisonRange(msg.data.target))
| 909| 909| 					{
| 910| 910| 						this.SetNextState("GARRISON.APPROACHING");
| 911| 911| 						return;
| 912| 912| 					}
| 913|    |-				}
|    | 913|+				
| 914| 914| 			}
| 915| 915| 
| 916| 916| 			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
| 902| 902| 					this.FinishOrder();
| 903| 903| 					return;
| 904| 904| 				}
| 905|    |-				else
| 906|    |-				{
|    | 905|+				
| 907| 906| 					// Out of range; move there in formation
| 908| 907| 					if (this.MoveToGarrisonRange(msg.data.target))
| 909| 908| 					{
| 910| 909| 						this.SetNextState("GARRISON.APPROACHING");
| 911| 910| 						return;
| 912| 911| 					}
| 913|    |-				}
|    | 912|+				
| 914| 913| 			}
| 915| 914| 
| 916| 915| 			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
| 929| 929| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 930| 930| 					}
| 931| 931| 					else
| 932|    |-					{
|    | 932|+					
| 933| 933| 						// We couldn't move there, or the target moved away
| 934| 934| 						this.FinishOrder();
| 935|    |-					}
|    | 935|+					
| 936| 936| 					return;
| 937| 937| 				}
| 938| 938| 
|    | [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
|1150|1150| 			},
|1151|1151| 		},
|1152|1152| 
|1153|    |-		"GARRISON":{
|    |1153|+		"GARRISON": {
|1154|1154| 			"enter": function() {
|1155|1155| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1156|1156| 				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
|1331|1331| 			// If the controller handled an order but some members rejected it,
|1332|1332| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1333|1333| 			if (this.orderQueue.length)
|1334|    |-			{
|    |1334|+			
|1335|1335| 				// We're leaving the formation, so stop our FormationWalk order
|1336|1336| 				if (this.FinishOrder())
|1337|1337| 					return;
|1338|    |-			}
|    |1338|+			
|1339|1339| 
|1340|1340| 			// No orders left, we're an individual now
|1341|1341| 			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
|1359|1359| 			// Move a tile outside the building
|1360|1360| 			let range = 4;
|1361|1361| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1362|    |-			{
|    |1362|+			
|1363|1363| 				// We've started walking to the given point
|1364|1364| 				this.SetNextState("WALKINGTOPOINT");
|1365|    |-			}
|    |1365|+			
|1366|1366| 			else
|1367|1367| 			{
|1368|1368| 				// 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
|1364|1364| 				this.SetNextState("WALKINGTOPOINT");
|1365|1365| 			}
|1366|1366| 			else
|1367|    |-			{
|    |1367|+			
|1368|1368| 				// We are already at the target, or can't move at all
|1369|1369| 				this.FinishOrder();
|1370|    |-			}
|    |1370|+			
|1371|1371| 		},
|1372|1372| 
|1373|1373| 
|    | [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
|1382|1382| 		},
|1383|1383| 
|1384|1384| 		"WALKING": {
|1385|    |-			"enter": function () {
|    |1385|+			"enter": function() {
|1386|1386| 				var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
|1387|1387| 				var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
|1388|1388| 				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
|1565|1565| 
|1566|1566| 			"LosRangeUpdate": function(msg) {
|1567|1567| 				if (this.GetStance().targetVisibleEnemies)
|1568|    |-				{
|    |1568|+				
|1569|1569| 					// Start attacking one of the newly-seen enemy (if any)
|1570|1570| 					this.AttackEntitiesByPreference(msg.data.added);
|1571|    |-				}
|    |1571|+				
|1572|1572| 			},
|1573|1573| 
|1574|1574| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1593|1593| 		},
|1594|1594| 
|1595|1595| 		"WALKING": {
|1596|    |-			"enter": function () {
|    |1596|+			"enter": function() {
|1597|1597| 				this.SelectAnimation("move");
|1598|1598| 			},
|1599|1599| 
|    | [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
|1603|1603| 		},
|1604|1604| 
|1605|1605| 		"WALKINGANDFIGHTING": {
|1606|    |-			"enter": function () {
|    |1606|+			"enter": function() {
|1607|1607| 				// Show weapons rather than carried resources.
|1608|1608| 				this.SetAnimationVariant("combat");
|1609|1609| 
|    | [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
|1626|1626| 		},
|1627|1627| 
|1628|1628| 		"PATROL": {
|1629|    |-			"enter": function () {
|    |1629|+			"enter": function() {
|1630|1630| 				// Memorize the origin position in case that we want to go back
|1631|1631| 				let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|1632|1632| 				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
|1672|1672| 			},
|1673|1673| 
|1674|1674| 			"ESCORTING": {
|1675|    |-				"enter": function () {
|    |1675|+				"enter": function() {
|1676|1676| 					// Show weapons rather than carried resources.
|1677|1677| 					this.SetAnimationVariant("combat");
|1678|1678| 
|    | [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
|1722|1722| 			},
|1723|1723| 
|1724|1724| 			"GUARDING": {
|1725|    |-				"enter": function () {
|    |1725|+				"enter": function() {
|1726|1726| 					this.StartTimer(1000, 1000);
|1727|1727| 					this.SetHeldPositionOnEntity(this.entity);
|1728|1728| 					this.SetAnimationVariant("combat");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|1751|1751| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1752|1752| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1753|1753| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1754|    |-						{
|    |1754|+						
|1755|1755| 							if (this.CanHeal(this.isGuardOf))
|1756|1756| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1757|1757| 							else if (this.CanRepair(this.isGuardOf))
|1758|1758| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1759|    |-						}
|    |1759|+						
|1760|1760| 					}
|1761|1761| 				},
|1762|1762| 
|    | [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
|1809|1809| 			},
|1810|1810| 
|1811|1811| 			"APPROACHING": {
|1812|    |-				"enter": function () {
|    |1812|+				"enter": function() {
|1813|1813| 					// Show weapons rather than carried resources.
|1814|1814| 					this.SetAnimationVariant("combat");
|1815|1815| 
|    | [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
|1839|1839| 				"MoveCompleted": function() {
|1840|1840| 
|1841|1841| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1842|    |-					{
|    |1842|+					
|1843|1843| 						// If the unit needs to unpack, do so
|1844|1844| 						if (this.CanUnpack())
|1845|1845| 						{
|1848|1848| 						}
|1849|1849| 						else
|1850|1850| 							this.SetNextState("ATTACKING");
|1851|    |-					}
|    |1851|+					
|1852|1852| 					else
|1853|1853| 					{
|1854|1854| 						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
|1846|1846| 							this.PushOrderFront("Unpack", { "force": true });
|1847|1847| 							return;
|1848|1848| 						}
|1849|    |-						else
|1850|    |-							this.SetNextState("ATTACKING");
|    |1849|+						this.SetNextState("ATTACKING");
|1851|1850| 					}
|1852|1851| 					else
|1853|1852| 					{
|    | [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
|1850|1850| 							this.SetNextState("ATTACKING");
|1851|1851| 					}
|1852|1852| 					else
|1853|    |-					{
|    |1853|+					
|1854|1854| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1855|1855| 						{
|1856|1856| 							this.SetNextState("APPROACHING");
|1860|1860| 							// Give up
|1861|1861| 							this.FinishOrder();
|1862|1862| 						}
|1863|    |-					}
|    |1863|+					
|1864|1864| 				},
|1865|1865| 			},
|1866|1866| 
|    | [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
|1852|1852| 					else
|1853|1853| 					{
|1854|1854| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1855|    |-						{
|    |1855|+						
|1856|1856| 							this.SetNextState("APPROACHING");
|1857|    |-						}
|    |1857|+						
|1858|1858| 						else
|1859|1859| 						{
|1860|1860| 							// 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
|1856|1856| 							this.SetNextState("APPROACHING");
|1857|1857| 						}
|1858|1858| 						else
|1859|    |-						{
|    |1859|+						
|1860|1860| 							// Give up
|1861|1861| 							this.FinishOrder();
|1862|    |-						}
|    |1862|+						
|1863|1863| 					}
|1864|1864| 				},
|1865|1865| 			},
|    | [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
|1877|1877| 					}
|1878|1878| 					// Check the target is still alive and attackable
|1879|1879| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1880|    |-					{
|    |1880|+					
|1881|1881| 						// Can't reach it - try to chase after it
|1882|1882| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1883|1883| 						{
|1887|1887| 								return;
|1888|1888| 							}
|1889|1889| 						}
|1890|    |-					}
|    |1890|+					
|1891|1891| 
|1892|1892| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1893|1893| 					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
|1880|1880| 					{
|1881|1881| 						// Can't reach it - try to chase after it
|1882|1882| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1883|    |-						{
|    |1883|+						
|1884|1884| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1885|1885| 							{
|1886|1886| 								this.SetNextState("COMBAT.CHASING");
|1887|1887| 								return;
|1888|1888| 							}
|1889|    |-						}
|    |1889|+						
|1890|1890| 					}
|1891|1891| 
|1892|1892| 					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
|1918|1918| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1919|1919| 
|1920|1920| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1921|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1921|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1922|1922| 
|1923|1923| 					this.FaceTowardsTarget(this.order.data.target);
|1924|1924| 
|    | [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
|1993|1993| 
|1994|1994| 						// Can't reach it - try to chase after it
|1995|1995| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1996|    |-						{
|    |1996|+						
|1997|1997| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1998|1998| 							{
|1999|1999| 								this.SetNextState("COMBAT.CHASING");
|2000|2000| 								return;
|2001|2001| 							}
|2002|    |-						}
|    |2002|+						
|2003|2003| 					}
|2004|2004| 
|2005|2005| 					// 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
|2040|2040| 
|2041|2041| 				"Attacked": function(msg) {
|2042|2042| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2043|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2044|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2043|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2044|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2045|2045| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2046|2046| 				},
|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
|2047|2047| 			},
|2048|2048| 
|2049|2049| 			"CHASING": {
|2050|    |-				"enter": function () {
|    |2050|+				"enter": function() {
|2051|2051| 					// Show weapons rather than carried resources.
|2052|2052| 					this.SetAnimationVariant("combat");
|2053|2053| 
|    | [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
|2122|2122| 
|2123|2123| 						// Try to find another nearby target of the same specific type
|2124|2124| 						// Also don't switch to a different type of huntable animal
|2125|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2125|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2126|2126| 							return (
|2127|2127| 								ent != oldTarget
|2128|2128| 								 && ((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
|2124|2124| 						// Also don't switch to a different type of huntable animal
|2125|2125| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2126|2126| 							return (
|2127|    |-								ent != oldTarget
|2128|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2127|+								ent != oldTarget &&
|    |2128|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2129|2129| 								 || (type.specific == oldType.specific
|2130|2130| 								 && (type.specific != "meat" || oldTemplate == template)))
|2131|2131| 							);
|    | [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
|2125|2125| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2126|2126| 							return (
|2127|2127| 								ent != oldTarget
|2128|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2129|    |-								 || (type.specific == oldType.specific
|    |2128|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2129|+								 (type.specific == oldType.specific
|2130|2130| 								 && (type.specific != "meat" || oldTemplate == template)))
|2131|2131| 							);
|2132|2132| 						}, 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
|2126|2126| 							return (
|2127|2127| 								ent != oldTarget
|2128|2128| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2129|    |-								 || (type.specific == oldType.specific
|2130|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2129|+								 || (type.specific == oldType.specific &&
|    |2130|+								 (type.specific != "meat" || oldTemplate == template)))
|2131|2131| 							);
|2132|2132| 						}, oldTarget);
|2133|2133| 						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
|2135|2135| 							this.PerformGather(nearby, false, false);
|2136|2136| 							return true;
|2137|2137| 						}
|2138|    |-						else
|2139|    |-						{
|    |2138|+						
|2140|2139| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2141|2140| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2142|2141| 							// to order it to GatherNear the resource position.
|2157|2156| 									return true;
|2158|2157| 								}
|2159|2158| 							}
|2160|    |-						}
|    |2159|+						
|2161|2160| 						return true;
|2162|2161| 					}
|2163|2162| 					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
|2147|2147| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2148|2148| 								return true;
|2149|2149| 							}
|2150|    |-							else
|2151|    |-							{
|    |2150|+							
|2152|2151| 								// we're kind of stuck here. Return resource.
|2153|2152| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2154|2153| 								if (nearby)
|2156|2155| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2157|2156| 									return true;
|2158|2157| 								}
|2159|    |-							}
|    |2158|+							
|2160|2159| 						}
|2161|2160| 						return true;
|2162|2161| 					}
|    | [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
|2187|2187| 
|2188|2188| 						// Try to find another nearby target of the same specific type
|2189|2189| 						// Also don't switch to a different type of huntable animal
|2190|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2190|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2191|2191| 							return (
|2192|2192| 								ent != oldTarget
|2193|2193| 								&& ((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
|2189|2189| 						// Also don't switch to a different type of huntable animal
|2190|2190| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2191|2191| 							return (
|2192|    |-								ent != oldTarget
|2193|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2192|+								ent != oldTarget &&
|    |2193|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2194|2194| 								|| (type.specific == oldType.specific
|2195|2195| 								&& (type.specific != "meat" || oldTemplate == template)))
|2196|2196| 							);
|    | [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
|2190|2190| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2191|2191| 							return (
|2192|2192| 								ent != oldTarget
|2193|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2194|    |-								|| (type.specific == oldType.specific
|    |2193|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2194|+								(type.specific == oldType.specific
|2195|2195| 								&& (type.specific != "meat" || oldTemplate == template)))
|2196|2196| 							);
|2197|2197| 						});
|    | [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
|2191|2191| 							return (
|2192|2192| 								ent != oldTarget
|2193|2193| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2194|    |-								|| (type.specific == oldType.specific
|2195|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2194|+								|| (type.specific == oldType.specific &&
|    |2195|+								(type.specific != "meat" || oldTemplate == template)))
|2196|2196| 							);
|2197|2197| 						});
|2198|2198| 						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
|2234|2234| 
|2235|2235| 					// Try to find another nearby target of the same specific type
|2236|2236| 					// Also don't switch to a different type of huntable animal
|2237|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2237|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2238|2238| 						return (
|2239|2239| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2240|2240| 							|| (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
|2236|2236| 					// Also don't switch to a different type of huntable animal
|2237|2237| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2238|2238| 						return (
|2239|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2240|    |-							|| (type.specific == resourceType.specific
|    |2239|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2240|+							(type.specific == resourceType.specific
|2241|2241| 							&& (type.specific != "meat" || resourceTemplate == template))
|2242|2242| 						);
|2243|2243| 					});
|    | [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
|2237|2237| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2238|2238| 						return (
|2239|2239| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2240|    |-							|| (type.specific == resourceType.specific
|2241|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2240|+							|| (type.specific == resourceType.specific &&
|    |2241|+							(type.specific != "meat" || resourceTemplate == template))
|2242|2242| 						);
|2243|2243| 					});
|2244|2244| 
|    | [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
|2353|2353| 
|2354|2354| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2355|2355| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2356|    |-					{
|    |2356|+					
|2357|2357| 						// Check we can still reach and gather from the target
|2358|2358| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2359|2359| 						{
|2419|2419| 								return;
|2420|2420| 							}
|2421|2421| 						}
|2422|    |-					}
|    |2422|+					
|2423|2423| 
|2424|2424| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2425|2425| 
|    | [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
|2443|2443| 
|2444|2444| 					// Try to find a new resource of the same specific type near our current position:
|2445|2445| 					// Also don't switch to a different type of huntable animal
|2446|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2446|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2447|2447| 						return (
|2448|2448| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2449|2449| 							|| (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
|2445|2445| 					// Also don't switch to a different type of huntable animal
|2446|2446| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2447|2447| 						return (
|2448|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2449|    |-							|| (type.specific == resourceType.specific
|    |2448|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2449|+							(type.specific == resourceType.specific
|2450|2450| 							&& (type.specific != "meat" || resourceTemplate == template))
|2451|2451| 						);
|2452|2452| 					});
|    | [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
|2446|2446| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2447|2447| 						return (
|2448|2448| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2449|    |-							|| (type.specific == resourceType.specific
|2450|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2449|+							|| (type.specific == resourceType.specific &&
|    |2450|+							(type.specific != "meat" || resourceTemplate == template))
|2451|2451| 						);
|2452|2452| 					});
|2453|2453| 					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
|2487|2487| 			},
|2488|2488| 
|2489|2489| 			"APPROACHING": {
|2490|    |-				"enter": function () {
|    |2490|+				"enter": function() {
|2491|2491| 					this.SelectAnimation("move");
|2492|2492| 					this.StartTimer(1000, 1000);
|2493|2493| 				},
|    | [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
|2533|2533| 					this.StartTimer(prepare, this.healTimers.repeat);
|2534|2534| 
|2535|2535| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2536|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2536|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2537|2537| 
|2538|2538| 					this.FaceTowardsTarget(this.order.data.target);
|2539|2539| 				},
|    | [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
|2566|2566| 						}
|2567|2567| 						// Can't reach it - try to chase after it
|2568|2568| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|2569|    |-						{
|    |2569|+						
|2570|2570| 							if (this.MoveToTargetRange(target, IID_Heal))
|2571|2571| 							{
|2572|2572| 								this.SetNextState("HEAL.CHASING");
|2573|2573| 								return;
|2574|2574| 							}
|2575|    |-						}
|    |2575|+						
|2576|2576| 					}
|2577|2577| 					// Can't reach it, healed to max hp or doesn't exist any more - give up
|2578|2578| 					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
|2588|2588| 				},
|2589|2589| 			},
|2590|2590| 			"CHASING": {
|2591|    |-				"enter": function () {
|    |2591|+				"enter": function() {
|2592|2592| 					this.SelectAnimation("move");
|2593|2593| 					this.StartTimer(1000, 1000);
|2594|2594| 				},
|    | [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
|2593|2593| 					this.StartTimer(1000, 1000);
|2594|2594| 				},
|2595|2595| 
|2596|    |-				"leave": function () {
|    |2596|+				"leave": function() {
|2597|2597| 					this.StopTimer();
|2598|2598| 				},
|2599|2599| 				"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
|2607|2607| 							this.WalkToHeldPosition();
|2608|2608| 					}
|2609|2609| 				},
|2610|    |-				"MoveCompleted": function () {
|    |2610|+				"MoveCompleted": function() {
|2611|2611| 					this.SetNextState("HEALING");
|2612|2612| 				},
|2613|2613| 			},
|    | [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
|2616|2616| 		// Returning to dropsite
|2617|2617| 		"RETURNRESOURCE": {
|2618|2618| 			"APPROACHING": {
|2619|    |-				"enter": function () {
|    |2619|+				"enter": function() {
|2620|2620| 					this.SelectAnimation("move");
|2621|2621| 				},
|2622|2622| 
|    | [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 (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
|3113|3113| 		"Attacked": function(msg) {
|3114|3114| 			if (this.template.NaturalBehaviour == "skittish" ||
|3115|3115| 			    this.template.NaturalBehaviour == "passive")
|3116|    |-			{
|    |3116|+			
|3117|3117| 				this.Flee(msg.data.attacker, false);
|3118|    |-			}
|    |3118|+			
|3119|3119| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3120|3120| 			{
|3121|3121| 				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
|3122|3122| 					this.Attack(msg.data.attacker, false);
|3123|3123| 			}
|3124|3124| 			else if (this.template.NaturalBehaviour == "domestic")
|3125|    |-			{
|    |3125|+			
|3126|3126| 				// Never flee, stop what we were doing
|3127|3127| 				this.SetNextState("IDLE");
|3128|    |-			}
|    |3128|+			
|3129|3129| 		},
|3130|3130| 
|3131|3131| 		"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
|3132|3132| 			// Move a tile outside the building
|3133|3133| 			var range = 4;
|3134|3134| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3135|    |-			{
|    |3135|+			
|3136|3136| 				// We've started walking to the given point
|3137|3137| 				this.SetNextState("WALKING");
|3138|    |-			}
|    |3138|+			
|3139|3139| 			else
|3140|3140| 			{
|3141|3141| 				// 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
|3137|3137| 				this.SetNextState("WALKING");
|3138|3138| 			}
|3139|3139| 			else
|3140|    |-			{
|    |3140|+			
|3141|3141| 				// We are already at the target, or can't move at all
|3142|3142| 				this.FinishOrder();
|3143|    |-			}
|    |3143|+			
|3144|3144| 		},
|3145|3145| 
|3146|3146| 		"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
|3179|3179| 				}
|3180|3180| 				// Start attacking one of the newly-seen enemy (if any)
|3181|3181| 				else if (this.IsDangerousAnimal())
|3182|    |-				{
|    |3182|+				
|3183|3183| 					this.AttackVisibleEntity(msg.data.added);
|3184|    |-				}
|    |3184|+				
|3185|3185| 
|3186|3186| 				// TODO: if two units enter our range together, we'll attack the
|3187|3187| 				// 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
|3222|3222| 				}
|3223|3223| 				// Start attacking one of the newly-seen enemy (if any)
|3224|3224| 				else if (this.template.NaturalBehaviour == "violent")
|3225|    |-				{
|    |3225|+				
|3226|3226| 					this.AttackVisibleEntity(msg.data.added);
|3227|    |-				}
|    |3227|+				
|3228|3228| 			},
|3229|3229| 
|3230|3230| 			"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
|3239|3239| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3240|3240| 
|3241|3241| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3242|    |-							// only used for domestic animals
|    |3242|+		// only used for domestic animals
|3243|3243| 	},
|3244|3244| };
|3245|3245| 
|    | [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
|3296|3296| 
|3297|3297| UnitAI.prototype.IsAnimal = function()
|3298|3298| {
|3299|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3299|+	return (!!this.template.NaturalBehaviour);
|3300|3300| };
|3301|3301| 
|3302|3302| 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
|3334|3334| UnitAI.prototype.GetGarrisonHolder = function()
|3335|3335| {
|3336|3336| 	if (this.IsGarrisoned())
|3337|    |-	{
|    |3337|+	
|3338|3338| 		for (let order of this.orderQueue)
|3339|3339| 			if (order.type == "Garrison" || order.type == "Autogarrison")
|3340|3340| 				return order.data.target;
|3341|    |-	}
|    |3341|+	
|3342|3342| 	return INVALID_ENTITY;
|3343|3343| };
|3344|3344| 
|    | [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
|3415|3415| 		{
|3416|3416| 			let index = this.GetCurrentState().indexOf(".");
|3417|3417| 			if (index != -1)
|3418|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3418|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3419|3419| 			this.Stop(false);
|3420|3420| 		}
|3421|3421| 
|    | [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
|3471|3471| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3472|3472| 			continue;
|3473|3473| 		if (i == 0)
|3474|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3474|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3475|3475| 		else
|3476|3476| 			this.orderQueue.splice(i, 1);
|3477|3477| 		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
|3471|3471| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3472|3472| 			continue;
|3473|3473| 		if (i == 0)
|3474|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3474|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3475|3475| 		else
|3476|3476| 			this.orderQueue.splice(i, 1);
|3477|3477| 		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
|3555|3555| };
|3556|3556| 
|3557|3557| 
|3558|    |-//// FSM linkage functions ////
|    |3558|+// // FSM linkage functions ////
|3559|3559| 
|3560|3560| UnitAI.prototype.SetNextState = function(state)
|3561|3561| {
|    | [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
|3606|3606| 	if (this.orderQueue.length)
|3607|3607| 	{
|3608|3608| 		let ret = this.UnitFsm.ProcessMessage(this,
|3609|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3609|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3610|3610| 		);
|3611|3611| 
|3612|3612| 		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
|3606|3606| 	if (this.orderQueue.length)
|3607|3607| 	{
|3608|3608| 		let ret = this.UnitFsm.ProcessMessage(this,
|3609|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3609|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3610|3610| 		);
|3611|3611| 
|3612|3612| 		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
|3619|3619| 		// Otherwise we've successfully processed a new order
|3620|3620| 		return true;
|3621|3621| 	}
|3622|    |-	else
|3623|    |-	{
|    |3622|+	
|3624|3623| 		this.SetNextState("IDLE");
|3625|3624| 
|3626|3625| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3641|3640| 		}
|3642|3641| 
|3643|3642| 		return false;
|3644|    |-	}
|    |3643|+	
|3645|3644| };
|3646|3645| 
|3647|3646| /**
|    | [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
|3658|3658| 	{
|3659|3659| 		this.order = order;
|3660|3660| 		let ret = this.UnitFsm.ProcessMessage(this,
|3661|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3661|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3662|3662| 		);
|3663|3663| 
|3664|3664| 		// 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
|3658|3658| 	{
|3659|3659| 		this.order = order;
|3660|3660| 		let ret = this.UnitFsm.ProcessMessage(this,
|3661|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3661|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3662|3662| 		);
|3663|3663| 
|3664|3664| 		// 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
|3694|3694| 		this.orderQueue.unshift(order);
|3695|3695| 		this.order = order;
|3696|3696| 		let ret = this.UnitFsm.ProcessMessage(this,
|3697|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3697|+			{ "type": "Order."+this.order.type, "data": this.order.data}
|3698|3698| 		);
|3699|3699| 
|3700|3700| 		// 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
|3694|3694| 		this.orderQueue.unshift(order);
|3695|3695| 		this.order = order;
|3696|3696| 		let ret = this.UnitFsm.ProcessMessage(this,
|3697|    |-			{"type": "Order."+this.order.type, "data": this.order.data}
|    |3697|+			{"type": "Order."+this.order.type, "data": this.order.data }
|3698|3698| 		);
|3699|3699| 
|3700|3700| 		// 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
|3728|3728| 				continue;
|3729|3729| 			if (this.orderQueue[i].type == type)
|3730|3730| 				continue;
|3731|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3731|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3732|3732| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3733|3733| 			return;
|3734|3734| 		}
|    | [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
|3728|3728| 				continue;
|3729|3729| 			if (this.orderQueue[i].type == type)
|3730|3730| 				continue;
|3731|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3731|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3732|3732| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3733|3733| 			return;
|3734|3734| 		}
|    | [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
|3742|3742| {
|3743|3743| 	// Remember the previous work orders to be able to go back to them later if required
|3744|3744| 	if (data && data.force)
|3745|    |-	{
|    |3745|+	
|3746|3746| 		if (this.IsFormationController())
|3747|3747| 			this.CallMemberFunction("UpdateWorkOrders", [type]);
|3748|3748| 		else
|3749|3749| 			this.UpdateWorkOrders(type);
|3750|    |-	}
|    |3750|+	
|3751|3751| 
|3752|3752| 	let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null;
|3753|3753| 
|    | [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
|3819|3819| 	{
|3820|3820| 		var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|3821|3821| 		if (cmpUnitAI)
|3822|    |-		{
|    |3822|+		
|3823|3823| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3824|3824| 			{
|3825|3825| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3828|3828| 					return;
|3829|3829| 				}
|3830|3830| 			}
|3831|    |-		}
|    |3831|+		
|3832|3832| 	}
|3833|3833| 
|3834|3834| 	// 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
|3821|3821| 		if (cmpUnitAI)
|3822|3822| 		{
|3823|3823| 			for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
|3824|    |-			{
|    |3824|+			
|3825|3825| 				if (isWorkType(cmpUnitAI.orderQueue[i].type))
|3826|3826| 				{
|3827|3827| 					this.workOrders = cmpUnitAI.orderQueue.slice(i);
|3828|3828| 					return;
|3829|3829| 				}
|3830|    |-			}
|    |3830|+			
|3831|3831| 		}
|3832|3832| 	}
|3833|3833| 
|    | [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
|3833|3833| 
|3834|3834| 	// If nothing found, take the unit orders
|3835|3835| 	for (var i = 0; i < this.orderQueue.length; ++i)
|3836|    |-	{
|    |3836|+	
|3837|3837| 		if (isWorkType(this.orderQueue[i].type))
|3838|3838| 		{
|3839|3839| 			this.workOrders = this.orderQueue.slice(i);
|3840|3840| 			return;
|3841|3841| 		}
|3842|    |-	}
|    |3842|+	
|3843|3843| };
|3844|3844| 
|3845|3845| 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
|3899|3899| 	if (data.timerRepeat === undefined)
|3900|3900| 		this.timer = undefined;
|3901|3901| 
|3902|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3902|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3903|3903| };
|3904|3904| 
|3905|3905| /**
|    | [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
|3899|3899| 	if (data.timerRepeat === undefined)
|3900|3900| 		this.timer = undefined;
|3901|3901| 
|3902|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3902|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3903|3903| };
|3904|3904| 
|3905|3905| /**
|    | [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
|3934|3934| 	this.timer = undefined;
|3935|3935| };
|3936|3936| 
|3937|    |-//// Message handlers /////
|    |3937|+// // Message handlers /////
|3938|3938| 
|3939|3939| UnitAI.prototype.OnMotionChanged = function(msg)
|3940|3940| {
|    | [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
|3939|3939| UnitAI.prototype.OnMotionChanged = function(msg)
|3940|3940| {
|3941|3941| 	if (msg.starting && !msg.error)
|3942|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3942|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg});
|3943|3943| 	else if (!msg.starting || msg.error)
|3944|3944| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3945|3945| };
|    | [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
|3939|3939| UnitAI.prototype.OnMotionChanged = function(msg)
|3940|3940| {
|3941|3941| 	if (msg.starting && !msg.error)
|3942|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|    |3942|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg });
|3943|3943| 	else if (!msg.starting || msg.error)
|3944|3944| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|3945|3945| };
|    | [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
|3941|3941| 	if (msg.starting && !msg.error)
|3942|3942| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3943|3943| 	else if (!msg.starting || msg.error)
|3944|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3944|+		this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg});
|3945|3945| };
|3946|3946| 
|3947|3947| 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
|3941|3941| 	if (msg.starting && !msg.error)
|3942|3942| 		this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg});
|3943|3943| 	else if (!msg.starting || msg.error)
|3944|    |-		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg});
|    |3944|+		this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg });
|3945|3945| };
|3946|3946| 
|3947|3947| 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
|3949|3949| 	// TODO: This is a bit inefficient since every unit listens to every
|3950|3950| 	// construction message - ideally we could scope it to only the one we're building
|3951|3951| 
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3952|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3949|3949| 	// TODO: This is a bit inefficient since every unit listens to every
|3950|3950| 	// construction message - ideally we could scope it to only the one we're building
|3951|3951| 
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3952|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3974|3974| 
|3975|3975| UnitAI.prototype.OnAttacked = function(msg)
|3976|3976| {
|3977|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3977|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3974|3974| 
|3975|3975| UnitAI.prototype.OnAttacked = function(msg)
|3976|3976| {
|3977|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3977|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3978|3978| };
|3979|3979| 
|3980|3980| 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3982|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3983|3983| };
|3984|3984| 
|3985|3985| 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
|3979|3979| 
|3980|3980| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3981|3981| {
|3982|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3982|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3983|3983| };
|3984|3984| 
|3985|3985| 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
|3984|3984| 
|3985|3985| UnitAI.prototype.OnHealthChanged = function(msg)
|3986|3986| {
|3987|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3987|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3988|3988| };
|3989|3989| 
|3990|3990| 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
|3984|3984| 
|3985|3985| UnitAI.prototype.OnHealthChanged = function(msg)
|3986|3986| {
|3987|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3987|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3988|3988| };
|3989|3989| 
|3990|3990| 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
|3990|3990| UnitAI.prototype.OnRangeUpdate = function(msg)
|3991|3991| {
|3992|3992| 	if (msg.tag == this.losRangeQuery)
|3993|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3993|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3994|3994| 	else if (msg.tag == this.losHealRangeQuery)
|3995|3995| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3996|3996| };
|    | [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
|3990|3990| UnitAI.prototype.OnRangeUpdate = function(msg)
|3991|3991| {
|3992|3992| 	if (msg.tag == this.losRangeQuery)
|3993|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3993|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3994|3994| 	else if (msg.tag == this.losHealRangeQuery)
|3995|3995| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3996|3996| };
|    | [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
|3992|3992| 	if (msg.tag == this.losRangeQuery)
|3993|3993| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3994|3994| 	else if (msg.tag == this.losHealRangeQuery)
|3995|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3995|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3996|3996| };
|3997|3997| 
|3998|3998| 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
|3992|3992| 	if (msg.tag == this.losRangeQuery)
|3993|3993| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3994|3994| 	else if (msg.tag == this.losHealRangeQuery)
|3995|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3995|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3996|3996| };
|3997|3997| 
|3998|3998| 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
|3997|3997| 
|3998|3998| UnitAI.prototype.OnPackFinished = function(msg)
|3999|3999| {
|4000|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4000|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4001|4001| };
|4002|4002| 
|4003|4003| //// 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
|3997|3997| 
|3998|3998| UnitAI.prototype.OnPackFinished = function(msg)
|3999|3999| {
|4000|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4000|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4001|4001| };
|4002|4002| 
|4003|4003| //// 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
|4000|4000| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4001|4001| };
|4002|4002| 
|4003|    |-//// Helper functions to be called by the FSM ////
|    |4003|+// // Helper functions to be called by the FSM ////
|4004|4004| 
|4005|4005| UnitAI.prototype.GetWalkSpeed = function()
|4006|4006| {
|    | [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
|4104|4104| 	if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER)
|4105|4105| 		return undefined;
|4106|4106| 
|4107|    |-	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position)
|    |4107|+	let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|4108|4108| 	if (!cmpPosition || !cmpPosition.IsInWorld())
|4109|4109| 		return undefined;
|4110|4110| 
|    | [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
|4189|4189| 			PlaySound(name, member);
|4190|4190| 	}
|4191|4191| 	else
|4192|    |-	{
|    |4192|+	
|4193|4193| 		// Otherwise use our own sounds
|4194|4194| 		PlaySound(name, this.entity);
|4195|    |-	}
|    |4195|+	
|4196|4196| };
|4197|4197| 
|4198|4198| /*
|    | [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
|4358|4358| 	else
|4359|4359| 		// return false? Or hope you come close enough?
|4360|4360| 		var parabolicMaxRange = 0;
|4361|    |-		//return false;
|    |4361|+		// return false;
|4362|4362| 
|4363|4363| 	// the parabole changes while walking, take something in the middle
|4364|4364| 	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
|4423|4423| 	if (this.IsFormationMember())
|4424|4424| 	{
|4425|4425| 		var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
|4426|    |-		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
|4427|    |-			&& cmpFormationUnitAI.order.data.target == target)
|    |4426|+		if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
|    |4427|+			cmpFormationUnitAI.order.data.target == target)
|4428|4428| 			return true;
|4429|4429| 	}
|4430|4430| 
|    | [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
|4543|4543| 	var pos = cmpPosition.GetPosition();
|4544|4544| 	var heldPosition = this.heldPosition;
|4545|4545| 	if (heldPosition === undefined)
|4546|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4546|+		heldPosition = { "x": pos.x, "z": pos.z};
|4547|4547| 
|4548|4548| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4549|4549| };
|    | [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
|4543|4543| 	var pos = cmpPosition.GetPosition();
|4544|4544| 	var heldPosition = this.heldPosition;
|4545|4545| 	if (heldPosition === undefined)
|4546|    |-		heldPosition = {"x": pos.x, "z": pos.z};
|    |4546|+		heldPosition = {"x": pos.x, "z": pos.z };
|4547|4547| 
|4548|4548| 	return Math.euclidDistance2D(pos.x, pos.z, heldPosition.x, heldPosition.z) < halfvision + range.max;
|4549|4549| };
|    | [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
|4591|4591| UnitAI.prototype.AttackEntityInZone = function(ents)
|4592|4592| {
|4593|4593| 	var target = ents.find(target =>
|4594|    |-		this.CanAttack(target)
|4595|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4594|+		this.CanAttack(target) &&
|    |4595|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4596|4596| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4597|4597| 	);
|4598|4598| 	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
|4592|4592| {
|4593|4593| 	var target = ents.find(target =>
|4594|4594| 		this.CanAttack(target)
|4595|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4596|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4595|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4596|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4597|4597| 	);
|4598|4598| 	if (!target)
|4599|4599| 		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
|4656|4656| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4657|4657| 	if (this.isGuardOf)
|4658|4658| 	{
|4659|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4659|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4660|4660| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4661|4661| 		if (cmpUnitAI && cmpAttack &&
|4662|4662| 		    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
|4660|4660| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4661|4661| 		if (cmpUnitAI && cmpAttack &&
|4662|4662| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4663|    |-				return false;
|    |4663|+			return false;
|4664|4664| 	}
|4665|4665| 
|4666|4666| 	// 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
|4665|4665| 
|4666|4666| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|4667|4667| 	if (this.GetStance().respondHoldGround)
|4668|    |-	{
|    |4668|+	
|4669|4669| 		if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type))
|4670|4670| 			return true;
|4671|    |-	}
|    |4671|+	
|4672|4672| 
|4673|4673| 	// Stop if it's left our vision range, unless we're especially persistent
|4674|4674| 	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
|4672|4672| 
|4673|4673| 	// Stop if it's left our vision range, unless we're especially persistent
|4674|4674| 	if (!this.GetStance().respondChaseBeyondVision)
|4675|    |-	{
|    |4675|+	
|4676|4676| 		if (!this.CheckTargetIsInVisionRange(target))
|4677|4677| 			return true;
|4678|    |-	}
|    |4678|+	
|4679|4679| 
|4680|4680| 	// (Note that CCmpUnitMotion will detect if the target is lost in FoW,
|4681|4681| 	// 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
|4703|4703| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4704|4704| 	if (this.isGuardOf)
|4705|4705| 	{
|4706|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4706|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4707|4707| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4708|4708| 		if (cmpUnitAI && cmpAttack &&
|4709|4709| 		    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
|4716|4716| 	return false;
|4717|4717| };
|4718|4718| 
|4719|    |-//// External interface functions ////
|    |4719|+// // External interface functions ////
|4720|4720| 
|4721|4721| UnitAI.prototype.SetFormationController = function(ent)
|4722|4722| {
|    | [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
|4726|4726| 	// of our own formation (or ourself if not in formation)
|4727|4727| 	var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction);
|4728|4728| 	if (cmpObstruction)
|4729|    |-	{
|    |4729|+	
|4730|4730| 		if (ent == INVALID_ENTITY)
|4731|4731| 			cmpObstruction.SetControlGroup(this.entity);
|4732|4732| 		else
|4733|4733| 			cmpObstruction.SetControlGroup(ent);
|4734|    |-	}
|    |4734|+	
|4735|4735| 
|4736|4736| 	// If we were removed from a formation, let the FSM switch back to INDIVIDUAL
|4737|4737| 	if (ent == INVALID_ENTITY)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4869|4869| 	// if we already had an old guard order, do nothing if the target is the same
|4870|4870| 	// and the order is running, otherwise remove the previous order
|4871|4871| 	if (this.isGuardOf)
|4872|    |-	{
|    |4872|+	
|4873|4873| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4874|4874| 			return;
|4875|4875| 		else
|4876|4876| 			this.RemoveGuard();
|4877|    |-	}
|    |4877|+	
|4878|4878| 
|4879|4879| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|4880|4880| };
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4872|4872| 	{
|4873|4873| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4874|4874| 			return;
|4875|    |-		else
|4876|    |-			this.RemoveGuard();
|    |4875|+		this.RemoveGuard();
|4877|4876| 	}
|4878|4877| 
|4879|4878| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4914|4914| 		return;
|4915|4915| 
|4916|4916| 	if (this.order.type == "Guard")
|4917|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4917|+		this.UnitFsm.ProcessMessage(this, { "type": "RemoveGuard"});
|4918|4918| 	else
|4919|4919| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4920|4920| 			if (this.orderQueue[i].type == "Guard")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|4914|4914| 		return;
|4915|4915| 
|4916|4916| 	if (this.order.type == "Guard")
|4917|    |-		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard"});
|    |4917|+		this.UnitFsm.ProcessMessage(this, {"type": "RemoveGuard" });
|4918|4918| 	else
|4919|4919| 		for (let i = 1; i < this.orderQueue.length; ++i)
|4920|4920| 			if (this.orderQueue[i].type == "Guard")
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js
|5043|5043| 			this.WalkToTarget(target, queued);
|5044|5044| 		return;
|5045|5045| 	}
|5046|    |-	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued);
|    |5046|+	this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued);
|5047|5047| };
|5048|5048| 
|5049|5049| /**
|    | [NORMAL] ESLintBear (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
|5192|5192| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5193|5193| 	{
|5194|5194| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5195|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5195|+		if (cmpTrader.HasBothMarkets() &&
|5196|5196| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5197|5197| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5198|5198| 		{
|    | [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
|5473|5473| 				{
|5474|5474| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5475|5475| 					var targetClasses = this.order.data.targetClasses;
|5476|    |-					if (targetClasses.attack && cmpIdentity
|5477|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5476|+					if (targetClasses.attack && cmpIdentity &&
|    |5477|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5478|5478| 						continue;
|5479|5479| 					if (targetClasses.avoid && cmpIdentity
|5480|5480| 						&& 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
|5476|5476| 					if (targetClasses.attack && cmpIdentity
|5477|5477| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5478|5478| 						continue;
|5479|    |-					if (targetClasses.avoid && cmpIdentity
|5480|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5479|+					if (targetClasses.avoid && cmpIdentity &&
|    |5480|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5481|5481| 						continue;
|5482|5482| 					// Only used by the AIs to prevent some choices of targets
|5483|5483| 					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
|5499|5499| 		{
|5500|5500| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5501|5501| 			var targetClasses = this.order.data.targetClasses;
|5502|    |-			if (cmpIdentity && targetClasses.attack
|5503|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5502|+			if (cmpIdentity && targetClasses.attack &&
|    |5503|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5504|5504| 				continue;
|5505|5505| 			if (cmpIdentity && targetClasses.avoid
|5506|5506| 				&& 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
|5502|5502| 			if (cmpIdentity && targetClasses.attack
|5503|5503| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5504|5504| 				continue;
|5505|    |-			if (cmpIdentity && targetClasses.avoid
|5506|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5505|+			if (cmpIdentity && targetClasses.avoid &&
|    |5506|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5507|5507| 				continue;
|5508|5508| 			// Only used by the AIs to prevent some choices of targets
|5509|5509| 			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
|5542|5542| 
|5543|5543| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5544|5544| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5545|    |-	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|    |5545|+	var targets = entities.filter(function(v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5546|5546| 		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5547|5547| 
|5548|5548| 	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
|5543|5543| 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
|5544|5544| 	var entities = cmpRangeManager.ResetActiveQuery(this.losRangeQuery);
|5545|5545| 	var targets = entities.filter(function (v) { return cmpAttack.CanAttack(v) && attackfilter(v); })
|5546|    |-		.sort(function (a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|    |5546|+		.sort(function(a, b) { return cmpAttack.CompareEntitiesByPreference(a, b); });
|5547|5547| 
|5548|5548| 	return targets;
|5549|5549| };
|    | [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
|5632|5632| 
|5633|5633| UnitAI.prototype.SetHeldPosition = function(x, z)
|5634|5634| {
|5635|    |-	this.heldPosition = {"x": x, "z": z};
|    |5635|+	this.heldPosition = { "x": x, "z": z};
|5636|5636| };
|5637|5637| 
|5638|5638| 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
|5632|5632| 
|5633|5633| UnitAI.prototype.SetHeldPosition = function(x, z)
|5634|5634| {
|5635|    |-	this.heldPosition = {"x": x, "z": z};
|    |5635|+	this.heldPosition = {"x": x, "z": z };
|5636|5636| };
|5637|5637| 
|5638|5638| 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
|5659|5659| 	return false;
|5660|5660| };
|5661|5661| 
|5662|    |-//// Helper functions ////
|    |5662|+// // Helper functions ////
|5663|5663| 
|5664|5664| UnitAI.prototype.CanAttack = function(target)
|5665|5665| {
|    | [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
|5863|5863| 	return (cmpPack && cmpPack.IsPacking());
|5864|5864| };
|5865|5865| 
|5866|    |-//// Formation specific functions ////
|    |5866|+// // Formation specific functions ////
|5867|5867| 
|5868|5868| UnitAI.prototype.IsAttackingAsFormation = function()
|5869|5869| {
|    | [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
|5868|5868| UnitAI.prototype.IsAttackingAsFormation = function()
|5869|5869| {
|5870|5870| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5871|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5872|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5871|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5872|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5873|5873| };
|5874|5874| 
|5875|5875| //// 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
|5872|5872| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5873|5873| };
|5874|5874| 
|5875|    |-//// Animal specific functions ////
|    |5875|+// // Animal specific functions ////
|5876|5876| 
|5877|5877| UnitAI.prototype.MoveRandomly = function(distance)
|5878|5878| {

binaries/data/mods/public/simulation/components/UnitAI.js
|2435| »   »   »   »   »   »   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
|3804| »   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
|4578| »   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
|4593| »   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
|4639| »   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
|4662| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|2449| »   »   »   »   »   »   »   ||·(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
|2450| »   »   »   »   »   »   »   &&·(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
|2470| »   »   »   »   »   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
|3766| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4371| »   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
|4427| »   »   »   &&·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
|4595| »   »   &&·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
|4596| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5123| »   var·lastPos·=·undefined;
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'lastPos' to 'undefined'.

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

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

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

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

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

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

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

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

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

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

bb accepted this revision.Mar 10 2018, 6:15 PM
bb added a subscriber: bb.

For now I have no objections, seems useful in a way

However the stances imo hardcode behaviour too much, probably we need more like "user defined stances" (so a player could make up their own stances from the given values), then the ai/triggerscript could simply add this stance if it needs it. Anyway for another time

binaries/data/mods/public/simulation/components/UnitAI.js
74 ↗(On Diff #6115)

thx, gets rid of a ton of linting errors

80 ↗(On Diff #6115)

trailing comma's, might be meh

This revision is now accepted and ready to land.Mar 10 2018, 6:15 PM
mimo added inline comments.Mar 10 2018, 8:03 PM
binaries/data/mods/public/simulation/components/UnitAI.js
80 ↗(On Diff #6115)

ok (i'm also not fond of them, but kept them as they were already there), but i'll remove them when commiting.

This revision was automatically updated to reflect the committed changes.