rP22197 changed the way we compute speed.
This:
- cleans up a code duplication and clarifies the intent.
- reorders things around for clarity
- improves variable names.
Differential D1840
RunSpeedMultiplier cleanup: improve variable names and reuse a duplicated function (rP22197) wraitii on Apr 21 2019, 5:53 PM. Authored by
Details
rP22197 changed the way we compute speed. This:
Review names and comments.
Diff Detail
Event TimelineComment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/differential/1248/display/redirect Comment Actions If the value that SetSpeedRatio computes differs from the serialized value, by definition it's OOS? Comment Actions Yes. However, that value can only differ if m_SpeedRatio > std::min(ratio, m_RunSpeedMultiplier). Comment Actions consider modifiying m_RunSpeedMultiplier too, which is only done on ownershipchange and valuemodification (afaik), where we set the value too Comment Actions So if you want to keep the statement that is a null-statement in the MT_Deserialize case in order to minimize the code, okay. Perhaps you could mention that for Deserialize, the SetSpeedRatio call is only for computing m_Speed (and the absence of mentioning a reason for m_SpeedRatio may imply that this is about code minimization). For example: // For MT_Deserialize compute m_Speed. // For MT_ValueModification and MT_OwnershipChanged, limit the unit speed by the new run multiplier. Comment Actions Following elexis' comments (I'll link this one but see the whole thread), adjust variable names for clarity:
So now in UnitMotion.cpp we have m_[Template]WalkSpeed, m_[Template]RunMultiplier as the "template" values, then m_SpeedMultiplier which is serialised and from which we compute the cached speed m_Speed. m_CurSpeed remains for now (I think D13 removes it) as the 'real' speed. Also reuse elexis' comments from here Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... source/tools/atlas/GameInterface/ActorViewer.cpp | 213| » void·UpdatePropListRecursive(CModelAbstract*·model); | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character '{' when these macros are defined: 'MESSAGESSETUP_NOTFIRST'. Executing section JS... | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 74| 74| var newangle = angle; | 75| 75| var canTurn = true; | 76| 76| if (this.landing) | 77| |- { | | 77|+ | 78| 78| if (this.speed > 0 && this.onGround) | 79| 79| { | 80| 80| if (pos.y <= cmpWaterManager.GetWaterLevel(pos.x, pos.z) && this.template.DiesInWater == "true") | 153| 153| this.waterDeath = true; | 154| 154| } | 155| 155| } | 156| |- } | | 156|+ | 157| 157| else | 158| 158| { | 159| 159| // If we haven't reached max speed yet then we're still on the ground; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 93| 93| pos.y = Math.max(ground, pos.y - turnLength * this.template.ClimbRate); | 94| 94| } | 95| 95| else if (this.speed == 0 && this.onGround) | 96| |- { | | 96|+ | 97| 97| if (this.waterDeath && cmpHealth) | 98| 98| cmpHealth.Kill(); | 99| 99| else | 128| 128| newangle += Math.PI; | 129| 129| } | 130| 130| } | 131| |- } | | 131|+ | 132| 132| else | 133| 133| { | 134| 134| // Final Approach | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 101| 101| this.pitch = 0; | 102| 102| // We've stopped. | 103| 103| if (cmpGarrisonHolder) | 104| |- cmpGarrisonHolder.AllowGarrisoning(true,"UnitMotionFlying"); | | 104|+ cmpGarrisonHolder.AllowGarrisoning(true, "UnitMotionFlying"); | 105| 105| canTurn = false; | 106| 106| this.hasTarget = false; | 107| 107| this.landing = false; | | [NORMAL] ESLintBear (space-unary-ops): | | Unexpected space after unary operator '-'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 138| 138| var targetHeight = ground; | 139| 139| // Steep, then gradual descent. | 140| 140| if ((pos.y - targetHeight) / this.template.FlyingHeight > 1 / SHORT_FINAL) | 141| |- this.pitch = - Math.PI / 18; | | 141|+ this.pitch = -Math.PI / 18; | 142| 142| else | 143| 143| this.pitch = Math.PI / 18; | 144| 144| var descentRate = ((pos.y - targetHeight) / this.template.FlyingHeight * this.template.ClimbRate + SHORT_FINAL) * SHORT_FINAL; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 155| 155| } | 156| 156| } | 157| 157| else | 158| |- { | | 158|+ | 159| 159| // If we haven't reached max speed yet then we're still on the ground; | 160| 160| // otherwise we're taking off or flying | 161| 161| // this.onGround in case of a go-around after landing (but not fully stopped) | 195| 195| this.pitch = -1 * this.pitch; | 196| 196| } | 197| 197| } | 198| |- } | | 198|+ | 199| 199| | 200| 200| // If we're in range of the target then tell people that we've reached it | 201| 201| // (TODO: quantisation breaks this) | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 163| 163| if (this.speed < this.template.TakeoffSpeed && this.onGround) | 164| 164| { | 165| 165| if (cmpGarrisonHolder) | 166| |- cmpGarrisonHolder.AllowGarrisoning(false,"UnitMotionFlying"); | | 166|+ cmpGarrisonHolder.AllowGarrisoning(false, "UnitMotionFlying"); | 167| 167| this.pitch = 0; | 168| 168| // Accelerate forwards | 169| 169| this.speed = Math.min(this.template.MaxSpeed, this.speed + turnLength * this.template.AccelRate); | | [NORMAL] ESLintBear (space-unary-ops): | | Unexpected space after unary operator '-'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 230| 230| if (newangle - angle > Math.PI / 18) | 231| 231| this.roll = Math.PI / 9; | 232| 232| else if (newangle - angle < -Math.PI / 18) | 233| |- this.roll = - Math.PI / 9; | | 233|+ this.roll = -Math.PI / 9; | 234| 234| else | 235| 235| this.roll = newangle - angle; | 236| 236| } | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 322| 322| UnitMotionFlying.prototype.GetSpeedMultiplier = function() | 323| 323| { | 324| 324| return this.GetCurrentSpeed() / this.GetWalkSpeed(); | 325| |-} | | 325|+}; | 326| 326| | 327| 327| UnitMotionFlying.prototype.GetPassabilityClassName = function() | 328| 328| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 346| 346| | 347| 347| UnitMotionFlying.prototype.StopMoving = function() | 348| 348| { | 349| |- //Invert | | 349|+ // Invert | 350| 350| if (!this.waterDeath) | 351| 351| this.landing = !this.landing; | 352| 352| binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 182| » » » var·targetHeight·=·ground·+·(+this.template.FlyingHeight); | | [NORMAL] JSHintBear: | | 'targetHeight' is already defined. binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 325| } | | [NORMAL] JSHintBear: | | Missing semicolon. | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 34| 34| | 35| 35| | 36| 36| AddMock(SYSTEM_ENTITY, IID_Timer, { | 37| |- SetInterval: function() { }, | | 37|+ "SetInterval": function() { }, | 38| 38| SetTimeout: function() { }, | 39| 39| }); | 40| 40| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 35| 35| | 36| 36| AddMock(SYSTEM_ENTITY, IID_Timer, { | 37| 37| SetInterval: function() { }, | 38| |- SetTimeout: function() { }, | | 38|+ "SetTimeout": function() { }, | 39| 39| }); | 40| 40| | 41| 41| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 39| 39| }); | 40| 40| | 41| 41| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 42| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 42|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 42| 42| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 43| 43| return 1; | 44| 44| }, | 45| |- EnableActiveQuery: function(id) { }, | | 45|+ "EnableActiveQuery": function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 46|+ "ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 46|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| |- DisableActiveQuery: function(id) { }, | | 47|+ "DisableActiveQuery": function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | 50| 50| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 45| 45| EnableActiveQuery: function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| |- GetEntityFlagMask: function(identifier) { }, | | 48|+ "GetEntityFlagMask": function(identifier) { }, | 49| 49| }); | 50| 50| | 51| 51| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 49| 49| }); | 50| 50| | 51| 51| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 52| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 52|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 53| 53| }); | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 53| 53| }); | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 56| |- GetPlayerByID: function(id) { return playerEntity; }, | | 56|+ "GetPlayerByID": function(id) { return playerEntity; }, | 57| 57| GetNumPlayers: function() { return 2; }, | 58| 58| }); | 59| 59| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 56| 56| GetPlayerByID: function(id) { return playerEntity; }, | 57| |- GetNumPlayers: function() { return 2; }, | | 57|+ "GetNumPlayers": function() { return 2; }, | 58| 58| }); | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 58| 58| }); | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | 61| |- IsAlly: function() { return false; }, | | 61|+ "IsAlly": function() { return false; }, | 62| 62| IsEnemy: function() { return true; }, | 63| 63| GetEnemies: function() { return []; }, | 64| 64| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | 61| 61| IsAlly: function() { return false; }, | 62| |- IsEnemy: function() { return true; }, | | 62|+ "IsEnemy": function() { return true; }, | 63| 63| GetEnemies: function() { return []; }, | 64| 64| }); | 65| 65| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 60| 60| AddMock(playerEntity, IID_Player, { | 61| 61| IsAlly: function() { return false; }, | 62| 62| IsEnemy: function() { return true; }, | 63| |- GetEnemies: function() { return []; }, | | 63|+ "GetEnemies": function() { return []; }, | 64| 64| }); | 65| 65| | 66| 66| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 67| 67| var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 68| 68| | 69| 69| AddMock(unit, IID_Identity, { | 70| |- GetClassesList: function() { return []; }, | | 70|+ "GetClassesList": function() { return []; }, | 71| 71| }); | 72| 72| | 73| 73| AddMock(unit, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 71| 71| }); | 72| 72| | 73| 73| AddMock(unit, IID_Ownership, { | 74| |- GetOwner: function() { return 1; }, | | 74|+ "GetOwner": function() { return 1; }, | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | 78| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 78|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| |- GetPosition: function() { return new Vector3D(); }, | | 79|+ "GetPosition": function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 77| 77| AddMock(unit, IID_Position, { | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| |- GetPosition2D: function() { return new Vector2D(); }, | | 80|+ "GetPosition2D": function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | 83| 83| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| |- GetRotation: function() { return { "y": 0 }; }, | | 81|+ "GetRotation": function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | 83| 83| }); | 84| 84| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| |- IsInWorld: function() { return true; }, | | 82|+ "IsInWorld": function() { return true; }, | 83| 83| }); | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 83| 83| }); | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| |- GetWalkSpeed: function() { return 1; }, | | 86|+ "GetWalkSpeed": function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| |- MoveToFormationOffset: function(target, x, z) { }, | | 87|+ "MoveToFormationOffset": function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| |- IsInTargetRange: function(target, min, max) { return true; }, | | 88|+ "IsInTargetRange": function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| |- MoveToTargetRange: function(target, min, max) { }, | | 89|+ "MoveToTargetRange": function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | 92| 92| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| |- StopMoving: function() { }, | | 90|+ "StopMoving": function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | 92| 92| }); | 93| 93| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| |- GetPassabilityClassName: function() { return "default"; }, | | 91|+ "GetPassabilityClassName": function() { return "default"; }, | 92| 92| }); | 93| 93| | 94| 94| AddMock(unit, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 92| 92| }); | 93| 93| | 94| 94| AddMock(unit, IID_Vision, { | 95| |- GetRange: function() { return 10; }, | | 95|+ "GetRange": function() { return 10; }, | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 99|+ "GetRange": function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 99|+ GetRange: function() { return { "max": 10, "min": 0 }; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 100|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 100|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 101|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| |- GetPreference: function(t) { return 0; }, | | 102|+ "GetPreference": function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 103|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | 106| 106| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| |- CanAttack: function(v) { return true; }, | | 104|+ "CanAttack": function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | 106| 106| }); | 107| 107| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 105|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 106| 106| }); | 107| 107| | 108| 108| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 113| 113| if (mode == 1) | 114| 114| { | 115| 115| AddMock(enemy, IID_Health, { | 116| |- GetHitpoints: function() { return 10; }, | | 116|+ "GetHitpoints": function() { return 10; }, | 117| 117| }); | 118| 118| AddMock(enemy, IID_UnitAI, { | 119| 119| IsAnimal: function() { return false; } | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAnimal' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 116| 116| GetHitpoints: function() { return 10; }, | 117| 117| }); | 118| 118| AddMock(enemy, IID_UnitAI, { | 119| |- IsAnimal: function() { return false; } | | 119|+ "IsAnimal": function() { return false; } | 120| 120| }); | 121| 121| } | 122| 122| else if (mode == 2) | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 121| 121| } | 122| 122| else if (mode == 2) | 123| 123| AddMock(enemy, IID_Health, { | 124| |- GetHitpoints: function() { return 0; }, | | 124|+ "GetHitpoints": function() { return 0; }, | 125| 125| }); | 126| 126| | 127| 127| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 124| 124| GetHitpoints: function() { return 0; }, | 125| 125| }); | 126| 126| | 127| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 127|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 124| 124| GetHitpoints: function() { return 0; }, | 125| 125| }); | 126| 126| | 127| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 127|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | 131| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 131|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 132|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 130| 130| AddMock(controller, IID_Position, { | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 133|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 134|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | 137| 137| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| |- GetRotation: function() { return { "y": 0 }; }, | | 135|+ "GetRotation": function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | 137| 137| }); | 138| 138| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| |- IsInWorld: function() { return true; }, | | 136|+ "IsInWorld": function() { return true; }, | 137| 137| }); | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 137| 137| }); | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| |- GetWalkSpeed: function() { return 1; }, | | 140|+ "GetWalkSpeed": function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeedMultiplier' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| |- SetSpeedMultiplier: function(speed) { }, | | 141|+ "SetSpeedMultiplier": function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 142|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | 145| 145| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| |- GetPassabilityClassName: function() { return "default"; }, | | 143|+ "GetPassabilityClassName": function() { return "default"; }, | 144| 144| }); | 145| 145| | 146| 146| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 181| 181| var unitAIs = []; | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| |- SetInterval: function() { }, | | 184|+ "SetInterval": function() { }, | 185| 185| SetTimeout: function() { }, | 186| 186| }); | 187| 187| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| 184| SetInterval: function() { }, | 185| |- SetTimeout: function() { }, | | 185|+ "SetTimeout": function() { }, | 186| 186| }); | 187| 187| | 188| 188| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 187| 187| | 188| 188| | 189| 189| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 190| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 190|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 190| 190| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| |- EnableActiveQuery: function(id) { }, | | 193|+ "EnableActiveQuery": function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| |- ResetActiveQuery: function(id) { return [enemy]; }, | | 194|+ "ResetActiveQuery": function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| |- DisableActiveQuery: function(id) { }, | | 195|+ "DisableActiveQuery": function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | 198| 198| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| |- GetEntityFlagMask: function(identifier) { }, | | 196|+ "GetEntityFlagMask": function(identifier) { }, | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 200| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 200|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| |- GetPlayerByID: function(id) { return playerEntity; }, | | 204|+ "GetPlayerByID": function(id) { return playerEntity; }, | 205| 205| GetNumPlayers: function() { return 2; }, | 206| 206| }); | 207| 207| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| 204| GetPlayerByID: function(id) { return playerEntity; }, | 205| |- GetNumPlayers: function() { return 2; }, | | 205|+ "GetNumPlayers": function() { return 2; }, | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| |- IsAlly: function() { return false; }, | | 209|+ "IsAlly": function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| |- IsEnemy: function() { return true; }, | | 210|+ "IsEnemy": function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | 213| 213| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| |- GetEnemies: function() { return []; }, | | 211|+ "GetEnemies": function() { return []; }, | 212| 212| }); | 213| 213| | 214| 214| // create units | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 219| 219| var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 220| 220| | 221| 221| AddMock(unit + i, IID_Identity, { | 222| |- GetClassesList: function() { return []; }, | | 222|+ "GetClassesList": function() { return []; }, | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | 226| |- GetOwner: function() { return 1; }, | | 226|+ "GetOwner": function() { return 1; }, | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 230|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| |- GetPosition: function() { return new Vector3D(); }, | | 231|+ "GetPosition": function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| |- GetPosition2D: function() { return new Vector2D(); }, | | 232|+ "GetPosition2D": function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| |- GetRotation: function() { return { "y": 0 }; }, | | 233|+ "GetRotation": function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | 236| 236| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| |- IsInWorld: function() { return true; }, | | 234|+ "IsInWorld": function() { return true; }, | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| |- GetWalkSpeed: function() { return 1; }, | | 238|+ "GetWalkSpeed": function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| |- MoveToFormationOffset: function(target, x, z) { }, | | 239|+ "MoveToFormationOffset": function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| |- IsInTargetRange: function(target, min, max) { return true; }, | | 240|+ "IsInTargetRange": function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| |- MoveToTargetRange: function(target, min, max) { }, | | 241|+ "MoveToTargetRange": function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| |- StopMoving: function() { }, | | 242|+ "StopMoving": function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | 245| 245| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| |- GetPassabilityClassName: function() { return "default"; }, | | 243|+ "GetPassabilityClassName": function() { return "default"; }, | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | 247| |- GetRange: function() { return 10; }, | | 247|+ "GetRange": function() { return 10; }, | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return { "max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 253|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 254|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| |- CanAttack: function(v) { return true; }, | | 255|+ "CanAttack": function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 256|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | 259| 259| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 265| 265| | 266| 266| // create enemy | 267| 267| AddMock(enemy, IID_Health, { | 268| |- GetHitpoints: function() { return 40; }, | | 268|+ "GetHitpoints": function() { return 40; }, | 269| 269| }); | 270| 270| | 271| 271| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 275|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 276|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 277|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 278|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| |- GetRotation: function() { return { "y": 0 }; }, | | 279|+ "GetRotation": function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | 282| 282| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| |- IsInWorld: function() { return true; }, | | 280|+ "IsInWorld": function() { return true; }, | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| |- GetWalkSpeed: function() { return 1; }, | | 284|+ "GetWalkSpeed": function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeedMultiplier' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| |- SetSpeedMultiplier: function(speed) { }, | | 285|+ "SetSpeedMultiplier": function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 286|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| |- IsInTargetRange: function(target, min, max) { return true; }, | | 287|+ "IsInTargetRange": function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | 290| 290| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| |- StopMoving: function() { }, | | 288|+ "StopMoving": function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | 290| 290| }); | 291| 291| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| |- GetPassabilityClassName: function() { return "default"; }, | | 289|+ "GetPassabilityClassName": function() { return "default"; }, | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return { "max":10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttackAsFormation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| 293| GetRange: function() { return {"max":10, "min": 0}; }, | 294| |- CanAttackAsFormation: function() { return false; }, | | 294|+ "CanAttackAsFormation": function() { return false; }, | 295| 295| }); | 296| 296| | 297| 297| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 303| 303| for (var ent of unitAIs) | 304| 304| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 305| 305| | 306| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 306|+ controllerAI.MoveIntoFormation({ "name": "Circle"}); | 307| 307| | 308| 308| // let all units be in position | 309| 309| for (var ent of unitAIs) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 303| 303| for (var ent of unitAIs) | 304| 304| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 305| 305| | 306| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 306|+ controllerAI.MoveIntoFormation({"name": "Circle" }); | 307| 307| | 308| 308| // let all units be in position | 309| 309| for (var ent of unitAIs) binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| » » ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·}, | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Closing curly brace appears on the same line as the subsequent block. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 215| » for·(var·i·=·0;·i·<·unitCount;·i++)·{ | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Opening curly brace appears on the same line as controlling statement. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 309| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 312| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 304| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 313| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 126| 126| this.formationMembersWithAura = []; // Members with a formation aura | 127| 127| this.width = 0; | 128| 128| this.depth = 0; | 129| |- this.oldOrientation = {"sin": 0, "cos": 0}; | | 129|+ this.oldOrientation = { "sin": 0, "cos": 0}; | 130| 130| this.twinFormations = []; | 131| 131| // distance from which two twin formations will merge into one. | 132| 132| this.formationSeparation = 0; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 126| 126| this.formationMembersWithAura = []; // Members with a formation aura | 127| 127| this.width = 0; | 128| 128| this.depth = 0; | 129| |- this.oldOrientation = {"sin": 0, "cos": 0}; | | 129|+ this.oldOrientation = {"sin": 0, "cos": 0 }; | 130| 130| this.twinFormations = []; | 131| 131| // distance from which two twin formations will merge into one. | 132| 132| this.formationSeparation = 0; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 144| 144| | 145| 145| Formation.prototype.GetSize = function() | 146| 146| { | 147| |- return {"width": this.width, "depth": this.depth}; | | 147|+ return { "width": this.width, "depth": this.depth}; | 148| 148| }; | 149| 149| | 150| 150| Formation.prototype.GetSpeedMultiplier = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 144| 144| | 145| 145| Formation.prototype.GetSize = function() | 146| 146| { | 147| |- return {"width": this.width, "depth": this.depth}; | | 147|+ return {"width": this.width, "depth": this.depth }; | 148| 148| }; | 149| 149| | 150| 150| Formation.prototype.GetSpeedMultiplier = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return { "width":1, "depth": 1}; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'width'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return {"width": 1, "depth": 1}; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return {"width":1, "depth": 1 }; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 565| 565| if (!footprints.length) | 566| 566| return {"width":1, "depth": 1}; | 567| 567| | 568| |- var r = {"width": 0, "depth": 0}; | | 568|+ var r = { "width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | 570| 570| { | 571| 571| if (shape.type == "circle") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 565| 565| if (!footprints.length) | 566| 566| return {"width":1, "depth": 1}; | 567| 567| | 568| |- var r = {"width": 0, "depth": 0}; | | 568|+ var r = {"width": 0, "depth": 0 }; | 569| 569| for (var shape of footprints) | 570| 570| { | 571| 571| if (shape.type == "circle") | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for-of'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | 570| |- { | | 570|+ | 571| 571| if (shape.type == "circle") | 572| 572| { | 573| 573| r.width += shape.radius * 2; | 578| 578| r.width += shape.width; | 579| 579| r.depth += shape.depth; | 580| 580| } | 581| |- } | | 581|+ | 582| 582| r.width /= footprints.length; | 583| 583| r.depth /= footprints.length; | 584| 584| return r; | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 591| 591| separation.depth *= this.separationMultiplier.depth; | 592| 592| | 593| 593| if (this.columnar) | 594| |- var sortingClasses = ["Cavalry","Infantry"]; | | 594|+ var sortingClasses = ["Cavalry", "Infantry"]; | 595| 595| else | 596| 596| var sortingClasses = this.sortingClasses.slice(); | 597| 597| sortingClasses.push("Unknown"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 608| 608| var classes = cmpIdentity.GetClassesList(); | 609| 609| var done = false; | 610| 610| for (var c = 0; c < sortingClasses.length; ++c) | 611| |- { | | 611|+ | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| 614| types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | 618| |- } | | 618|+ | 619| 619| if (!done) | 620| 620| types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | 621| 621| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 611| 611| { | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| |- types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | | 614|+ types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]}); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 611| 611| { | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| |- types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | | 614|+ types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] }); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | | [NORMAL] ESLintBear (dot-notation): | | ["Unknown"] is better written in dot notation. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types.Unknown.push({"ent": active[i], "pos": positions[i]}); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types["Unknown"].push({ "ent": active[i], "pos": positions[i]}); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types["Unknown"].push({"ent": active[i], "pos": positions[i] }); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 635| 635| if (this.columnar) | 636| 636| { | 637| 637| shape = "square"; | 638| |- cols = Math.min(count,3); | | 638|+ cols = Math.min(count, 3); | 639| 639| shiftRows = false; | 640| 640| centerGap = 0; | 641| 641| sortingOrder = null; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 689| 689| n -= r%2; | 690| 690| } | 691| 691| else if (shape == "triangle") | 692| |- { | | 692|+ | 693| 693| if (shiftRows) | 694| 694| var n = r + 1; | 695| 695| else | 696| 696| var n = r * 2 + 1; | 697| |- } | | 697|+ | 698| 698| if (!shiftRows && n > left) | 699| 699| n = left; | 700| 700| for (var c = 0; c < n && left > 0; ++c) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 730| 730| // calculating offset distances without a zero average makes no sense, as the formation | 731| 731| // will jump to a different position any time | 732| 732| var avgoffset = Vector2D.average(offsets); | 733| |- offsets.forEach(function (o) {o.sub(avgoffset);}); | | 733|+ offsets.forEach(function(o) {o.sub(avgoffset);}); | 734| 734| | 735| 735| // sort the available places in certain ways | 736| 736| // the places first in the list will contain the heaviest units as defined by the order | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'column'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column}; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column }; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos) | 800| 800| { | 801| 801| var offsetPositions = []; | 802| |- var {sin, cos} = this.GetEstimatedOrientation(pos); | | 802|+ var { sin, cos} = this.GetEstimatedOrientation(pos); | 803| 803| // calculate the world positions | 804| 804| for (var o of offsets) | 805| 805| offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin)); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos) | 800| 800| { | 801| 801| var offsetPositions = []; | 802| |- var {sin, cos} = this.GetEstimatedOrientation(pos); | | 802|+ var {sin, cos } = this.GetEstimatedOrientation(pos); | 803| 803| // calculate the world positions | 804| 804| for (var o of offsets) | 805| 805| offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin)); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos) | 817| 817| { | 818| 818| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); | 819| |- var r = {"sin": 0, "cos": 1}; | | 819|+ var r = { "sin": 0, "cos": 1}; | 820| 820| var unitAIState = cmpUnitAI.GetCurrentState(); | 821| 821| if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING") | 822| 822| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos) | 817| 817| { | 818| 818| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); | 819| |- var r = {"sin": 0, "cos": 1}; | | 819|+ var r = {"sin": 0, "cos": 1 }; | 820| 820| var unitAIState = cmpUnitAI.GetCurrentState(); | 821| 821| if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING") | 822| 822| { | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 898| 898| cmpOtherFormation.RemoveMembers(otherMembers); | 899| 899| this.AddMembers(otherMembers); | 900| 900| Engine.DestroyEntity(this.twinFormations[i]); | 901| |- this.twinFormations.splice(i,1); | | 901|+ this.twinFormations.splice(i, 1); | 902| 902| } | 903| 903| // Switch between column and box if necessary | 904| 904| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); binaries/data/mods/public/simulation/components/Formation.js | 335| » for·(var·ent·of·this.formationMembersWithAura) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 422| » for·(var·ent·of·this.formationMembersWithAura) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 468| » var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position); | | [NORMAL] JSHintBear: | | 'cmpPosition' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 509| » » var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'cmpUnitAI' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 544| » var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position); | | [NORMAL] JSHintBear: | | 'cmpPosition' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 596| » » var·sortingClasses·=·this.sortingClasses.slice(); | | [NORMAL] JSHintBear: | | 'sortingClasses' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 605| » for·(var·i·in·active) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 620| » » » types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]}); | | [NORMAL] JSHintBear: | | ['Unknown'] is better written in dot notation. binaries/data/mods/public/simulation/components/Formation.js | 660| » » for·(var·i·=·0;·i·<·count;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 694| » » » » » var·n·=·r·+·1; | | [NORMAL] JSHintBear: | | 'n' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 696| » » » » » var·n·=·r·*·2·+·1; | | [NORMAL] JSHintBear: | | 'n' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 700| » » » for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c) | | [NORMAL] JSHintBear: | | 'c' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 707| » » » » » var·x·=·side·*·Math.ceil(c/2)·*·separation.width; | | [NORMAL] JSHintBear: | | 'x' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 710| » » » » » if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 712| » » » » » x·+=·side·*·centerGap·/·2; | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 718| » » » » offsets.push(new·Vector2D(x·+·r1,·z·+·r2)); | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 698| » » » if·(!shiftRows·&&·n·>·left) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 699| » » » » n·=·left; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 700| » » » for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 704| » » » » if·(n%2·==·0) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 714| » » » » var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 724| » » » this.maxColumnsUsed[r]·=·n; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 753| » for·(var·i·=·sortingClasses.length;·i;·--i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 597| » sortingClasses.push("Unknown"); | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 602| » for·(var·i·=·0;·i·<·sortingClasses.length;·++i) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 603| » » types[sortingClasses[i]]·=·[]; | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 610| » » for·(var·c·=·0;·c·<·sortingClasses.length;·++c) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 612| » » » if·(classes.indexOf(sortingClasses[c])·>·-1) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 614| » » » » types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]}); | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 753| » for·(var·i·=·sortingClasses.length;·i;·--i) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 755| » » var·t·=·types[sortingClasses[i-1]]; | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 860| » var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion); | | [NORMAL] JSHintBear: | | 'cmpUnitMotion' is already defined. | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClass' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | 8| 8| let height = 5; | 9| 9| | 10| 10| AddMock(SYSTEM_ENTITY, IID_Pathfinder, { | 11| |- GetPassabilityClass: (name) => 1 << 8 | | 11|+ "GetPassabilityClass": (name) => 1 << 8 | 12| 12| }); | 13| 13| | 14| 14| let cmpUnitMotionFlying = ConstructComponent(entity, "UnitMotionFlying", { binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | 45| » "SetHeightFixed":·(y)·=>·height·=·y, | | [NORMAL] ESLintBear (no-return-assign): | | Arrow function should not return assignment. | | [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 (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 (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 | 228| 228| // Move a tile outside the building | 229| 229| let range = 4; | 230| 230| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) | 231| |- { | | 231|+ | 232| 232| // We've started walking to the given point | 233| 233| this.SetNextState("INDIVIDUAL.WALKING"); | 234| |- } | | 234|+ | 235| 235| else | 236| 236| { | 237| 237| // 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 | 233| 233| this.SetNextState("INDIVIDUAL.WALKING"); | 234| 234| } | 235| 235| else | 236| |- { | | 236|+ | 237| 237| // We are already at the target, or can't move at all | 238| 238| this.FinishOrder(); | 239| |- } | | 239|+ | 240| 240| }, | 241| 241| | 242| 242| // 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 | 335| 335| | 336| 336| var ok = this.MoveToTarget(this.order.data.target); | 337| 337| if (ok) | 338| |- { | | 338|+ | 339| 339| // We've started walking to the given point | 340| 340| if (this.IsAnimal()) | 341| 341| this.SetNextState("ANIMAL.WALKING"); | 342| 342| else | 343| 343| this.SetNextState("INDIVIDUAL.WALKING"); | 344| |- } | | 344|+ | 345| 345| else | 346| 346| { | 347| 347| // 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 | 363| 363| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 364| 364| if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 365| 365| && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 366| |- { | | 366|+ | 367| 367| // we were already on the shoreline, and have not moved since | 368| 368| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | 369| 369| needToMove = false; | 370| |- } | | 370|+ | 371| 371| | 372| 372| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 373| 373| // 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 | 361| 361| // Check if we need to move TODO implement a better way to know if we are on the shoreline | 362| 362| var needToMove = true; | 363| 363| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 364| |- if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 365| |- && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | | 364|+ if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) && | | 365|+ (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 366| 366| { | 367| 367| // we were already on the shoreline, and have not moved since | 368| 368| 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 | 372| 372| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 373| 373| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | 374| 374| if (needToMove && this.MoveToTarget(this.order.data.target)) | 375| |- { | | 375|+ | 376| 376| this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING"); | 377| |- } | | 377|+ | 378| 378| else | 379| 379| { | 380| 380| // 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 | 401| 401| var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance); | 402| 402| var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | 403| 403| if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) | 404| |- { | | 404|+ | 405| 405| // We've started fleeing from the given target | 406| 406| if (this.IsAnimal()) | 407| 407| this.SetNextState("ANIMAL.FLEEING"); | 408| 408| else | 409| 409| this.SetNextState("INDIVIDUAL.FLEEING"); | 410| |- } | | 410|+ | 411| 411| else | 412| 412| { | 413| 413| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 448| 448| } | 449| 449| | 450| 450| if (this.order.data.attackType == this.oldAttackType) | 451| |- { | | 451|+ | 452| 452| if (this.IsAnimal()) | 453| 453| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 454| 454| else | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| |- } | | 456|+ | 457| 457| else | 458| 458| { | 459| 459| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| 456| } | 457| 457| else | 458| |- { | | 458|+ | 459| 459| if (this.IsAnimal()) | 460| 460| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 461| 461| else | 462| 462| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 463| |- } | | 463|+ | 464| 464| return; | 465| 465| } | 466| 466| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 580| 580| this.PushOrderFront("Walk", this.order.data.lastPos); | 581| 581| } | 582| 582| else | 583| |- { | | 583|+ | 584| 584| // We couldn't move there, or the target moved away | 585| 585| this.FinishOrder(); | 586| |- } | | 586|+ | 587| 587| return; | 588| 588| } | 589| 589| | | [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 | 593| 593| | 594| 594| // Try to move within range | 595| 595| if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer)) | 596| |- { | | 596|+ | 597| 597| // We've started walking to the given point | 598| 598| this.SetNextState("INDIVIDUAL.GATHER.APPROACHING"); | 599| |- } | | 599|+ | 600| 600| else | 601| 601| { | 602| 602| // 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 | 670| 670| "Order.Repair": function(msg) { | 671| 671| // Try to move within range | 672| 672| if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) | 673| |- { | | 673|+ | 674| 674| // We've started walking to the given point | 675| 675| this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING"); | 676| |- } | | 676|+ | 677| 677| else | 678| 678| { | 679| 679| // 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 | 706| 706| } | 707| 707| | 708| 708| if (this.MoveToGarrisonRange(this.order.data.target)) | 709| |- { | | 709|+ | 710| 710| this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING"); | 711| |- } | | 711|+ | 712| 712| else | 713| 713| { | 714| 714| // 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 | 834| 834| if (!this.CheckTargetAttackRange(target, target)) | 835| 835| { | 836| 836| if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) | 837| |- { | | 837|+ | 838| 838| if (this.MoveToTargetAttackRange(target, target)) | 839| 839| { | 840| 840| this.SetNextState("COMBAT.APPROACHING"); | 841| 841| return; | 842| 842| } | 843| |- } | | 843|+ | 844| 844| this.FinishOrder(); | 845| 845| return; | 846| 846| } | | [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 | 859| 859| } | 860| 860| // Check if we are already in range, otherwise walk there | 861| 861| if (!this.CheckGarrisonRange(msg.data.target)) | 862| |- { | | 862|+ | 863| 863| if (!this.CheckTargetVisible(msg.data.target)) | 864| 864| { | 865| 865| this.FinishOrder(); | 874| 874| return; | 875| 875| } | 876| 876| } | 877| |- } | | 877|+ | 878| 878| | 879| 879| this.SetNextState("GARRISON.GARRISONING"); | 880| 880| }, | | [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 | 866| 866| return; | 867| 867| } | 868| 868| else | 869| |- { | | 869|+ | 870| 870| // Out of range; move there in formation | 871| 871| if (this.MoveToGarrisonRange(msg.data.target)) | 872| 872| { | 873| 873| this.SetNextState("GARRISON.APPROACHING"); | 874| 874| return; | 875| 875| } | 876| |- } | | 876|+ | 877| 877| } | 878| 878| | 879| 879| 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 | 865| 865| this.FinishOrder(); | 866| 866| return; | 867| 867| } | 868| |- else | 869| |- { | | 868|+ | 870| 869| // Out of range; move there in formation | 871| 870| if (this.MoveToGarrisonRange(msg.data.target)) | 872| 871| { | 873| 872| this.SetNextState("GARRISON.APPROACHING"); | 874| 873| return; | 875| 874| } | 876| |- } | | 875|+ | 877| 876| } | 878| 877| | 879| 878| 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 | 892| 892| this.PushOrderFront("Walk", msg.data.lastPos); | 893| 893| } | 894| 894| else | 895| |- { | | 895|+ | 896| 896| // We couldn't move there, or the target moved away | 897| 897| this.FinishOrder(); | 898| |- } | | 898|+ | 899| 899| return; | 900| 900| } | 901| 901| | | [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 |1113|1113| }, |1114|1114| }, |1115|1115| |1116| |- "GARRISON":{ | |1116|+ "GARRISON": { |1117|1117| "enter": function() { |1118|1118| // If the garrisonholder should pickup, warn it so it can take needed action |1119|1119| 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 |1297|1297| // If the controller handled an order but some members rejected it, |1298|1298| // they will have no orders and be in the FORMATIONMEMBER.IDLE state. |1299|1299| if (this.orderQueue.length) |1300| |- { | |1300|+ |1301|1301| // We're leaving the formation, so stop our FormationWalk order |1302|1302| if (this.FinishOrder()) |1303|1303| return; |1304| |- } | |1304|+ |1305|1305| |1306|1306| // No orders left, we're an individual now |1307|1307| 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 |1325|1325| // Move a tile outside the building |1326|1326| let range = 4; |1327|1327| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |1328| |- { | |1328|+ |1329|1329| // We've started walking to the given point |1330|1330| this.SetNextState("WALKINGTOPOINT"); |1331| |- } | |1331|+ |1332|1332| else |1333|1333| { |1334|1334| // 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 |1330|1330| this.SetNextState("WALKINGTOPOINT"); |1331|1331| } |1332|1332| else |1333| |- { | |1333|+ |1334|1334| // We are already at the target, or can't move at all |1335|1335| this.FinishOrder(); |1336| |- } | |1336|+ |1337|1337| }, |1338|1338| |1339|1339| | | [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 |1531|1531| |1532|1532| "LosRangeUpdate": function(msg) { |1533|1533| if (this.GetStance().targetVisibleEnemies) |1534| |- { | |1534|+ |1535|1535| // Start attacking one of the newly-seen enemy (if any) |1536|1536| this.AttackEntitiesByPreference(msg.data.added); |1537| |- } | |1537|+ |1538|1538| }, |1539|1539| |1540|1540| "LosHealRangeUpdate": 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 |1717|1717| // if nothing better to do, check if the guarded needs to be healed or repaired |1718|1718| var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health); |1719|1719| if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints())) |1720| |- { | |1720|+ |1721|1721| if (this.CanHeal(this.isGuardOf)) |1722|1722| this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false }); |1723|1723| else if (this.CanRepair(this.isGuardOf)) |1724|1724| this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false }); |1725| |- } | |1725|+ |1726|1726| } |1727|1727| }, |1728|1728| | | [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 |1802|1802| "MoveCompleted": function() { |1803|1803| |1804|1804| if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1805| |- { | |1805|+ |1806|1806| // If the unit needs to unpack, do so |1807|1807| if (this.CanUnpack()) |1808|1808| { |1811|1811| } |1812|1812| else |1813|1813| this.SetNextState("ATTACKING"); |1814| |- } | |1814|+ |1815|1815| else |1816|1816| { |1817|1817| 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 |1809|1809| this.PushOrderFront("Unpack", { "force": true }); |1810|1810| return; |1811|1811| } |1812| |- else |1813| |- this.SetNextState("ATTACKING"); | |1812|+ this.SetNextState("ATTACKING"); |1814|1813| } |1815|1814| else |1816|1815| { | | [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 |1813|1813| this.SetNextState("ATTACKING"); |1814|1814| } |1815|1815| else |1816| |- { | |1816|+ |1817|1817| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1818|1818| { |1819|1819| this.SetNextState("APPROACHING"); |1823|1823| // Give up |1824|1824| this.FinishOrder(); |1825|1825| } |1826| |- } | |1826|+ |1827|1827| }, |1828|1828| }, |1829|1829| | | [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 |1815|1815| else |1816|1816| { |1817|1817| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1818| |- { | |1818|+ |1819|1819| this.SetNextState("APPROACHING"); |1820| |- } | |1820|+ |1821|1821| else |1822|1822| { |1823|1823| // 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 |1819|1819| this.SetNextState("APPROACHING"); |1820|1820| } |1821|1821| else |1822| |- { | |1822|+ |1823|1823| // Give up |1824|1824| this.FinishOrder(); |1825| |- } | |1825|+ |1826|1826| } |1827|1827| }, |1828|1828| }, | | [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 |1840|1840| } |1841|1841| // Check the target is still alive and attackable |1842|1842| if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType)) |1843| |- { | |1843|+ |1844|1844| // Can't reach it - try to chase after it |1845|1845| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1846|1846| { |1855|1855| return; |1856|1856| } |1857|1857| } |1858| |- } | |1858|+ |1859|1859| |1860|1860| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |1861|1861| this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType); | | [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 |1886|1886| // TODO: we should probably only bother syncing projectile attacks, not melee |1887|1887| |1888|1888| // If using a non-default prepare time, re-sync the animation when the timer runs. |1889| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1889|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1890|1890| |1891|1891| this.FaceTowardsTarget(this.order.data.target); |1892|1892| | | [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 |2015|2015| |2016|2016| "Attacked": function(msg) { |2017|2017| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2018| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2019| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2018|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2019|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2020|2020| this.RespondToTargetedEntities([msg.data.attacker]); |2021|2021| }, |2022|2022| }, | | [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 |2029|2029| this.SelectAnimation("move"); |2030|2030| var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI); |2031|2031| if (cmpUnitAI && cmpUnitAI.IsFleeing()) |2032| |- { | |2032|+ |2033|2033| // Run after a fleeing target |2034|2034| this.SetMoveSpeedRatio(this.GetRunMultiplier()); |2035| |- } | |2035|+ |2036|2036| this.StartTimer(1000, 1000); |2037|2037| }, |2038|2038| | | [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 |2088|2088| // Also don't switch to a different type of huntable animal |2089|2089| var nearby = this.FindNearbyResource(function(ent, type, template) { |2090|2090| return ( |2091| |- ent != oldTarget |2092| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2091|+ ent != oldTarget && | |2092|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2093|2093| || (type.specific == oldType.specific |2094|2094| && (type.specific != "meat" || oldTemplate == template))) |2095|2095| ); | | [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 |2089|2089| var nearby = this.FindNearbyResource(function(ent, type, template) { |2090|2090| return ( |2091|2091| ent != oldTarget |2092| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2093| |- || (type.specific == oldType.specific | |2092|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2093|+ (type.specific == oldType.specific |2094|2094| && (type.specific != "meat" || oldTemplate == template))) |2095|2095| ); |2096|2096| }, 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 |2090|2090| return ( |2091|2091| ent != oldTarget |2092|2092| && ((type.generic == "treasure" && oldType.generic == "treasure") |2093| |- || (type.specific == oldType.specific |2094| |- && (type.specific != "meat" || oldTemplate == template))) | |2093|+ || (type.specific == oldType.specific && | |2094|+ (type.specific != "meat" || oldTemplate == template))) |2095|2095| ); |2096|2096| }, oldTarget); |2097|2097| 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 |2099|2099| this.PerformGather(nearby, false, false); |2100|2100| return true; |2101|2101| } |2102| |- else |2103| |- { | |2102|+ |2104|2103| // It's probably better in this case, to avoid units getting stuck around a dropsite |2105|2104| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2106|2105| // to order it to GatherNear the resource position. |2121|2120| return true; |2122|2121| } |2123|2122| } |2124| |- } | |2123|+ |2125|2124| return true; |2126|2125| } |2127|2126| 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 |2111|2111| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2112|2112| return true; |2113|2113| } |2114| |- else |2115| |- { | |2114|+ |2116|2115| // we're kind of stuck here. Return resource. |2117|2116| var nearby = this.FindNearestDropsite(oldType.generic); |2118|2117| if (nearby) |2120|2119| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2121|2120| return true; |2122|2121| } |2123| |- } | |2122|+ |2124|2123| } |2125|2124| return true; |2126|2125| } | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |2153|2153| // Also don't switch to a different type of huntable animal |2154|2154| var nearby = this.FindNearbyResource(function(ent, type, template) { |2155|2155| return ( |2156| |- ent != oldTarget |2157| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2156|+ ent != oldTarget && | |2157|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2158|2158| || (type.specific == oldType.specific |2159|2159| && (type.specific != "meat" || oldTemplate == template))) |2160|2160| ); | | [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 |2154|2154| var nearby = this.FindNearbyResource(function(ent, type, template) { |2155|2155| return ( |2156|2156| ent != oldTarget |2157| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2158| |- || (type.specific == oldType.specific | |2157|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2158|+ (type.specific == oldType.specific |2159|2159| && (type.specific != "meat" || oldTemplate == template))) |2160|2160| ); |2161|2161| }); | | [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 |2155|2155| return ( |2156|2156| ent != oldTarget |2157|2157| && ((type.generic == "treasure" && oldType.generic == "treasure") |2158| |- || (type.specific == oldType.specific |2159| |- && (type.specific != "meat" || oldTemplate == template))) | |2158|+ || (type.specific == oldType.specific && | |2159|+ (type.specific != "meat" || oldTemplate == template))) |2160|2160| ); |2161|2161| }); |2162|2162| if (nearby) | | [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 |2200|2200| // Also don't switch to a different type of huntable animal |2201|2201| var nearby = this.FindNearbyResource(function(ent, type, template) { |2202|2202| return ( |2203| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2204| |- || (type.specific == resourceType.specific | |2203|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2204|+ (type.specific == resourceType.specific |2205|2205| && (type.specific != "meat" || resourceTemplate == template)) |2206|2206| ); |2207|2207| }); | | [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 |2201|2201| var nearby = this.FindNearbyResource(function(ent, type, template) { |2202|2202| return ( |2203|2203| (type.generic == "treasure" && resourceType.generic == "treasure") |2204| |- || (type.specific == resourceType.specific |2205| |- && (type.specific != "meat" || resourceTemplate == template)) | |2204|+ || (type.specific == resourceType.specific && | |2205|+ (type.specific != "meat" || resourceTemplate == template)) |2206|2206| ); |2207|2207| }); |2208|2208| | | [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 |2317|2317| |2318|2318| var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply); |2319|2319| if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity)) |2320| |- { | |2320|+ |2321|2321| // Check we can still reach and gather from the target |2322|2322| if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget)) |2323|2323| { |2383|2383| return; |2384|2384| } |2385|2385| } |2386| |- } | |2386|+ |2387|2387| |2388|2388| // We're already in range, can't get anywhere near it or the target is exhausted. |2389|2389| | | [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 |2409|2409| // Also don't switch to a different type of huntable animal |2410|2410| var nearby = this.FindNearbyResource(function(ent, type, template) { |2411|2411| return ( |2412| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2413| |- || (type.specific == resourceType.specific | |2412|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2413|+ (type.specific == resourceType.specific |2414|2414| && (type.specific != "meat" || resourceTemplate == template)) |2415|2415| ); |2416|2416| }); | | [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 |2410|2410| var nearby = this.FindNearbyResource(function(ent, type, template) { |2411|2411| return ( |2412|2412| (type.generic == "treasure" && resourceType.generic == "treasure") |2413| |- || (type.specific == resourceType.specific |2414| |- && (type.specific != "meat" || resourceTemplate == template)) | |2413|+ || (type.specific == resourceType.specific && | |2414|+ (type.specific != "meat" || resourceTemplate == template)) |2415|2415| ); |2416|2416| }); |2417|2417| if (nearby) | | [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 |2497|2497| this.StartTimer(prepare, this.healTimers.repeat); |2498|2498| |2499|2499| // If using a non-default prepare time, re-sync the animation when the timer runs. |2500| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2500|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2501|2501| |2502|2502| this.FaceTowardsTarget(this.order.data.target); |2503|2503| }, | | [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 |2712|2712| { |2713|2713| // The building was already finished/fully repaired before we arrived; |2714|2714| // let the ConstructionFinished handler handle this. |2715| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2715|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2716|2716| return true; |2717|2717| } |2718|2718| | | [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 |2712|2712| { |2713|2713| // The building was already finished/fully repaired before we arrived; |2714|2714| // let the ConstructionFinished handler handle this. |2715| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2715|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2716|2716| return true; |2717|2717| } |2718|2718| | | [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 |2752|2752| if (this.MoveToTargetRange(this.repairTarget, IID_Builder)) |2753|2753| this.SetNextState("APPROACHING"); |2754|2754| else if (!this.CheckTargetRange(this.repairTarget, IID_Builder)) |2755| |- this.FinishOrder(); //can't approach and isn't in reach | |2755|+ this.FinishOrder(); // can't approach and isn't in reach |2756|2756| }, |2757|2757| }, |2758|2758| | | [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 |2839|2839| |2840|2840| // Unit was approaching and there's nothing to do now, so switch to walking |2841|2841| if (oldState === "INDIVIDUAL.REPAIR.APPROACHING") |2842| |- { | |2842|+ |2843|2843| // We're already walking to the given point, so add this as a order. |2844|2844| this.WalkToTarget(msg.data.newentity, true); |2845| |- } | |2845|+ |2846|2846| }, |2847|2847| }, |2848|2848| | | [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 |2892|2892| |2893|2893| // Check that we can garrison here |2894|2894| if (this.CanGarrison(target)) |2895| |- { | |2895|+ |2896|2896| // Check that we're in range of the garrison target |2897|2897| if (this.CheckGarrisonRange(target)) |2898|2898| { |2968|2968| return false; |2969|2969| } |2970|2970| } |2971| |- } | |2971|+ |2972|2972| // Garrisoning failed for some reason, so finish the order |2973|2973| this.FinishOrder(); |2974|2974| 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 |3075|3075| "Attacked": function(msg) { |3076|3076| if (this.template.NaturalBehaviour == "skittish" || |3077|3077| this.template.NaturalBehaviour == "passive") |3078| |- { | |3078|+ |3079|3079| this.Flee(msg.data.attacker, false); |3080| |- } | |3080|+ |3081|3081| else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive") |3082|3082| { |3083|3083| 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 |3084|3084| this.Attack(msg.data.attacker, false); |3085|3085| } |3086|3086| else if (this.template.NaturalBehaviour == "domestic") |3087| |- { | |3087|+ |3088|3088| // Never flee, stop what we were doing |3089|3089| this.SetNextState("IDLE"); |3090| |- } | |3090|+ |3091|3091| }, |3092|3092| |3093|3093| "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 |3094|3094| // Move a tile outside the building |3095|3095| var range = 4; |3096|3096| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |3097| |- { | |3097|+ |3098|3098| // We've started walking to the given point |3099|3099| this.SetNextState("WALKING"); |3100| |- } | |3100|+ |3101|3101| else |3102|3102| { |3103|3103| // 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 |3099|3099| this.SetNextState("WALKING"); |3100|3100| } |3101|3101| else |3102| |- { | |3102|+ |3103|3103| // We are already at the target, or can't move at all |3104|3104| this.FinishOrder(); |3105| |- } | |3105|+ |3106|3106| }, |3107|3107| |3108|3108| "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 |3141|3141| } |3142|3142| // Start attacking one of the newly-seen enemy (if any) |3143|3143| else if (this.IsDangerousAnimal()) |3144| |- { | |3144|+ |3145|3145| this.AttackVisibleEntity(msg.data.added); |3146| |- } | |3146|+ |3147|3147| |3148|3148| // TODO: if two units enter our range together, we'll attack the |3149|3149| // 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 |3184|3184| } |3185|3185| // Start attacking one of the newly-seen enemy (if any) |3186|3186| else if (this.template.NaturalBehaviour == "violent") |3187| |- { | |3187|+ |3188|3188| this.AttackVisibleEntity(msg.data.added); |3189| |- } | |3189|+ |3190|3190| }, |3191|3191| |3192|3192| "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 |3201|3201| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3202|3202| |3203|3203| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3204| |- // only used for domestic animals | |3204|+ // only used for domestic animals |3205|3205| }, |3206|3206| }; |3207|3207| | | [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 |3258|3258| |3259|3259| UnitAI.prototype.IsAnimal = function() |3260|3260| { |3261| |- return (this.template.NaturalBehaviour ? true : false); | |3261|+ return (!!this.template.NaturalBehaviour); |3262|3262| }; |3263|3263| |3264|3264| 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 |3296|3296| UnitAI.prototype.GetGarrisonHolder = function() |3297|3297| { |3298|3298| if (this.IsGarrisoned()) |3299| |- { | |3299|+ |3300|3300| for (let order of this.orderQueue) |3301|3301| if (order.type == "Garrison") |3302|3302| return order.data.target; |3303| |- } | |3303|+ |3304|3304| return INVALID_ENTITY; |3305|3305| }; |3306|3306| | | [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 |3374|3374| { |3375|3375| let index = this.GetCurrentState().indexOf("."); |3376|3376| if (index != -1) |3377| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3377|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3378|3378| this.Stop(false); |3379|3379| } |3380|3380| | | [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 |3430|3430| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3431|3431| continue; |3432|3432| if (i == 0) |3433| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3433|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3434|3434| else |3435|3435| this.orderQueue.splice(i, 1); |3436|3436| 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 |3430|3430| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3431|3431| continue; |3432|3432| if (i == 0) |3433| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3433|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3434|3434| else |3435|3435| this.orderQueue.splice(i, 1); |3436|3436| 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 |3514|3514| }; |3515|3515| |3516|3516| |3517| |-//// FSM linkage functions //// | |3517|+// // FSM linkage functions //// |3518|3518| |3519|3519| // Setting the next state to the current state will leave/re-enter the top-most substate. |3520|3520| UnitAI.prototype.SetNextState = function(state) | | [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 |3686|3686| continue; |3687|3687| if (this.orderQueue[i].type == type) |3688|3688| continue; |3689| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3689|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3690|3690| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3691|3691| return; |3692|3692| } | | [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 |3686|3686| continue; |3687|3687| if (this.orderQueue[i].type == type) |3688|3688| continue; |3689| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3689|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3690|3690| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3691|3691| return; |3692|3692| } | | [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 |3700|3700| { |3701|3701| // Remember the previous work orders to be able to go back to them later if required |3702|3702| if (data && data.force) |3703| |- { | |3703|+ |3704|3704| if (this.IsFormationController()) |3705|3705| this.CallMemberFunction("UpdateWorkOrders", [type]); |3706|3706| else |3707|3707| this.UpdateWorkOrders(type); |3708| |- } | |3708|+ |3709|3709| |3710|3710| let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null; |3711|3711| | | [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 |3777|3777| { |3778|3778| var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |3779|3779| if (cmpUnitAI) |3780| |- { | |3780|+ |3781|3781| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3782|3782| { |3783|3783| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3786|3786| return; |3787|3787| } |3788|3788| } |3789| |- } | |3789|+ |3790|3790| } |3791|3791| |3792|3792| // 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 |3779|3779| if (cmpUnitAI) |3780|3780| { |3781|3781| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3782| |- { | |3782|+ |3783|3783| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3784|3784| { |3785|3785| this.workOrders = cmpUnitAI.orderQueue.slice(i); |3786|3786| return; |3787|3787| } |3788| |- } | |3788|+ |3789|3789| } |3790|3790| } |3791|3791| | | [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 |3791|3791| |3792|3792| // If nothing found, take the unit orders |3793|3793| for (var i = 0; i < this.orderQueue.length; ++i) |3794| |- { | |3794|+ |3795|3795| if (isWorkType(this.orderQueue[i].type)) |3796|3796| { |3797|3797| this.workOrders = this.orderQueue.slice(i); |3798|3798| return; |3799|3799| } |3800| |- } | |3800|+ |3801|3801| }; |3802|3802| |3803|3803| 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 |3857|3857| if (data.timerRepeat === undefined) |3858|3858| this.timer = undefined; |3859|3859| |3860| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3860|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3861|3861| }; |3862|3862| |3863|3863| /** | | [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 |3857|3857| if (data.timerRepeat === undefined) |3858|3858| this.timer = undefined; |3859|3859| |3860| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3860|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3861|3861| }; |3862|3862| |3863|3863| /** | | [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 |3892|3892| this.timer = undefined; |3893|3893| }; |3894|3894| |3895| |-//// Message handlers ///// | |3895|+// // Message handlers ///// |3896|3896| |3897|3897| UnitAI.prototype.OnMotionChanged = function(msg) |3898|3898| { | | [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 |3897|3897| UnitAI.prototype.OnMotionChanged = function(msg) |3898|3898| { |3899|3899| if (msg.starting && !msg.error) |3900| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3900|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg}); |3901|3901| else if (!msg.starting || msg.error) |3902|3902| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3903|3903| }; | | [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 |3897|3897| UnitAI.prototype.OnMotionChanged = function(msg) |3898|3898| { |3899|3899| if (msg.starting && !msg.error) |3900| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3900|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg }); |3901|3901| else if (!msg.starting || msg.error) |3902|3902| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3903|3903| }; | | [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 (msg.starting && !msg.error) |3900|3900| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3901|3901| else if (!msg.starting || msg.error) |3902| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3902|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg}); |3903|3903| }; |3904|3904| |3905|3905| 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 |3899|3899| if (msg.starting && !msg.error) |3900|3900| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3901|3901| else if (!msg.starting || msg.error) |3902| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3902|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg }); |3903|3903| }; |3904|3904| |3905|3905| 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 |3907|3907| // TODO: This is a bit inefficient since every unit listens to every |3908|3908| // construction message - ideally we could scope it to only the one we're building |3909|3909| |3910| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3910|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3911|3911| }; |3912|3912| |3913|3913| 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 |3907|3907| // TODO: This is a bit inefficient since every unit listens to every |3908|3908| // construction message - ideally we could scope it to only the one we're building |3909|3909| |3910| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3910|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3911|3911| }; |3912|3912| |3913|3913| 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 |3932|3932| |3933|3933| UnitAI.prototype.OnAttacked = function(msg) |3934|3934| { |3935| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3935|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3936|3936| }; |3937|3937| |3938|3938| 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 |3932|3932| |3933|3933| UnitAI.prototype.OnAttacked = function(msg) |3934|3934| { |3935| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3935|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3936|3936| }; |3937|3937| |3938|3938| 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 |3937|3937| |3938|3938| UnitAI.prototype.OnGuardedAttacked = function(msg) |3939|3939| { |3940| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3940|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3941|3941| }; |3942|3942| |3943|3943| 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 |3937|3937| |3938|3938| UnitAI.prototype.OnGuardedAttacked = function(msg) |3939|3939| { |3940| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3940|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3941|3941| }; |3942|3942| |3943|3943| 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 |3942|3942| |3943|3943| UnitAI.prototype.OnHealthChanged = function(msg) |3944|3944| { |3945| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3945|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3946|3946| }; |3947|3947| |3948|3948| 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 |3942|3942| |3943|3943| UnitAI.prototype.OnHealthChanged = function(msg) |3944|3944| { |3945| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3945|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3946|3946| }; |3947|3947| |3948|3948| 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 |3948|3948| UnitAI.prototype.OnRangeUpdate = function(msg) |3949|3949| { |3950|3950| if (msg.tag == this.losRangeQuery) |3951| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3951|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3952|3952| else if (msg.tag == this.losHealRangeQuery) |3953|3953| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3954|3954| }; | | [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 |3948|3948| UnitAI.prototype.OnRangeUpdate = function(msg) |3949|3949| { |3950|3950| if (msg.tag == this.losRangeQuery) |3951| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3951|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3952|3952| else if (msg.tag == this.losHealRangeQuery) |3953|3953| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3954|3954| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js |3950|3950| if (msg.tag == this.losRangeQuery) |3951|3951| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3952|3952| else if (msg.tag == this.losHealRangeQuery) |3953| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3953|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3954|3954| }; |3955|3955| |3956|3956| 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 |3950|3950| if (msg.tag == this.losRangeQuery) |3951|3951| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3952|3952| else if (msg.tag == this.losHealRangeQuery) |3953| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3953|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3954|3954| }; |3955|3955| |3956|3956| 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 |3955|3955| |3956|3956| UnitAI.prototype.OnPackFinished = function(msg) |3957|3957| { |3958| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3958|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3959|3959| }; |3960|3960| |3961|3961| //// 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 |3955|3955| |3956|3956| UnitAI.prototype.OnPackFinished = function(msg) |3957|3957| { |3958| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3958|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3959|3959| }; |3960|3960| |3961|3961| //// 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 |3958|3958| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3959|3959| }; |3960|3960| |3961| |-//// Helper functions to be called by the FSM //// | |3961|+// // Helper functions to be called by the FSM //// |3962|3962| |3963|3963| UnitAI.prototype.GetWalkSpeed = function() |3964|3964| { | | [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 |4060|4060| if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER) |4061|4061| return undefined; |4062|4062| |4063| |- let cmpPosition = Engine.QueryInterface(this.entity, IID_Position) | |4063|+ let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |4064|4064| if (!cmpPosition || !cmpPosition.IsInWorld()) |4065|4065| return undefined; |4066|4066| | | [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 |4145|4145| PlaySound(name, member); |4146|4146| } |4147|4147| else |4148| |- { | |4148|+ |4149|4149| // Otherwise use our own sounds |4150|4150| PlaySound(name, this.entity); |4151| |- } | |4151|+ |4152|4152| }; |4153|4153| |4154|4154| /* | | [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 |4314|4314| else |4315|4315| // return false? Or hope you come close enough? |4316|4316| var parabolicMaxRange = 0; |4317| |- //return false; | |4317|+ // return false; |4318|4318| |4319|4319| // the parabole changes while walking, take something in the middle |4320|4320| 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 |4379|4379| if (this.IsFormationMember()) |4380|4380| { |4381|4381| var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |4382| |- if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() |4383| |- && cmpFormationUnitAI.order.data.target == target) | |4382|+ if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() && | |4383|+ cmpFormationUnitAI.order.data.target == target) |4384|4384| return true; |4385|4385| } |4386|4386| | | [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 |4547|4547| UnitAI.prototype.AttackEntityInZone = function(ents) |4548|4548| { |4549|4549| var target = ents.find(target => |4550| |- this.CanAttack(target) |4551| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4550|+ this.CanAttack(target) && | |4551|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4552|4552| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4553|4553| ); |4554|4554| 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 |4548|4548| { |4549|4549| var target = ents.find(target => |4550|4550| this.CanAttack(target) |4551| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4552| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4551|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4552|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4553|4553| ); |4554|4554| if (!target) |4555|4555| 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 |4612|4612| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4613|4613| if (this.isGuardOf) |4614|4614| { |4615| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4615|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4616|4616| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4617|4617| if (cmpUnitAI && cmpAttack && |4618|4618| 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 |4616|4616| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4617|4617| if (cmpUnitAI && cmpAttack && |4618|4618| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4619| |- return false; | |4619|+ return false; |4620|4620| } |4621|4621| |4622|4622| // 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 |4621|4621| |4622|4622| // Stop if we're in hold-ground mode and it's too far from the holding point |4623|4623| if (this.GetStance().respondHoldGround) |4624| |- { | |4624|+ |4625|4625| if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type)) |4626|4626| return true; |4627| |- } | |4627|+ |4628|4628| |4629|4629| // Stop if it's left our vision range, unless we're especially persistent |4630|4630| 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 |4628|4628| |4629|4629| // Stop if it's left our vision range, unless we're especially persistent |4630|4630| if (!this.GetStance().respondChaseBeyondVision) |4631| |- { | |4631|+ |4632|4632| if (!this.CheckTargetIsInVisionRange(target)) |4633|4633| return true; |4634| |- } | |4634|+ |4635|4635| |4636|4636| // (Note that CCmpUnitMotion will detect if the target is lost in FoW, |4637|4637| // 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 |4654|4654| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4655|4655| if (this.isGuardOf) |4656|4656| { |4657| |- let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4657|+ let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4658|4658| let cmpAttack = Engine.QueryInterface(target, IID_Attack); |4659|4659| if (cmpUnitAI && cmpAttack && |4660|4660| 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 |4667|4667| return false; |4668|4668| }; |4669|4669| |4670| |-//// External interface functions //// | |4670|+// // External interface functions //// |4671|4671| |4672|4672| UnitAI.prototype.SetFormationController = function(ent) |4673|4673| { | | [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 |4677|4677| // of our own formation (or ourself if not in formation) |4678|4678| var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); |4679|4679| if (cmpObstruction) |4680| |- { | |4680|+ |4681|4681| if (ent == INVALID_ENTITY) |4682|4682| cmpObstruction.SetControlGroup(this.entity); |4683|4683| else |4684|4684| cmpObstruction.SetControlGroup(ent); |4685| |- } | |4685|+ |4686|4686| |4687|4687| // If we were removed from a formation, let the FSM switch back to INDIVIDUAL |4688|4688| 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 |4820|4820| // if we already had an old guard order, do nothing if the target is the same |4821|4821| // and the order is running, otherwise remove the previous order |4822|4822| if (this.isGuardOf) |4823| |- { | |4823|+ |4824|4824| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4825|4825| return; |4826|4826| else |4827|4827| this.RemoveGuard(); |4828| |- } | |4828|+ |4829|4829| |4830|4830| this.AddOrder("Guard", { "target": target, "force": false }, queued); |4831|4831| }; | | [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 |4823|4823| { |4824|4824| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4825|4825| return; |4826| |- else |4827| |- this.RemoveGuard(); | |4826|+ this.RemoveGuard(); |4828|4827| } |4829|4828| |4830|4829| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [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 |4994|4994| this.WalkToTarget(target, queued); |4995|4995| return; |4996|4996| } |4997| |- this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued); | |4997|+ this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued); |4998|4998| }; |4999|4999| |5000|5000| /** | | [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 |5143|5143| this.workOrders.length && this.workOrders[0].type == "Trade") |5144|5144| { |5145|5145| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5146| |- if (cmpTrader.HasBothMarkets() && | |5146|+ if (cmpTrader.HasBothMarkets() && |5147|5147| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5148|5148| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5149|5149| { | | [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 |5424|5424| { |5425|5425| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5426|5426| var targetClasses = this.order.data.targetClasses; |5427| |- if (targetClasses.attack && cmpIdentity |5428| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5427|+ if (targetClasses.attack && cmpIdentity && | |5428|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5429|5429| continue; |5430|5430| if (targetClasses.avoid && cmpIdentity |5431|5431| && 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 |5427|5427| if (targetClasses.attack && cmpIdentity |5428|5428| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5429|5429| continue; |5430| |- if (targetClasses.avoid && cmpIdentity |5431| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5430|+ if (targetClasses.avoid && cmpIdentity && | |5431|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5432|5432| continue; |5433|5433| // Only used by the AIs to prevent some choices of targets |5434|5434| 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 |5450|5450| { |5451|5451| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5452|5452| var targetClasses = this.order.data.targetClasses; |5453| |- if (cmpIdentity && targetClasses.attack |5454| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5453|+ if (cmpIdentity && targetClasses.attack && | |5454|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5455|5455| continue; |5456|5456| if (cmpIdentity && targetClasses.avoid |5457|5457| && 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 |5453|5453| if (cmpIdentity && targetClasses.attack |5454|5454| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5455|5455| continue; |5456| |- if (cmpIdentity && targetClasses.avoid |5457| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5456|+ if (cmpIdentity && targetClasses.avoid && | |5457|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5458|5458| continue; |5459|5459| // Only used by the AIs to prevent some choices of targets |5460|5460| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [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 |5596|5596| |5597|5597| UnitAI.prototype.SetHeldPosition = function(x, z) |5598|5598| { |5599| |- this.heldPosition = {"x": x, "z": z}; | |5599|+ this.heldPosition = { "x": x, "z": z}; |5600|5600| }; |5601|5601| |5602|5602| 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 |5596|5596| |5597|5597| UnitAI.prototype.SetHeldPosition = function(x, z) |5598|5598| { |5599| |- this.heldPosition = {"x": x, "z": z}; | |5599|+ this.heldPosition = {"x": x, "z": z }; |5600|5600| }; |5601|5601| |5602|5602| 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 |5623|5623| return false; |5624|5624| }; |5625|5625| |5626| |-//// Helper functions //// | |5626|+// // Helper functions //// |5627|5627| |5628|5628| UnitAI.prototype.CanAttack = function(target) |5629|5629| { | | [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 |5827|5827| return cmpPack && cmpPack.IsPacking(); |5828|5828| }; |5829|5829| |5830| |-//// Formation specific functions //// | |5830|+// // Formation specific functions //// |5831|5831| |5832|5832| UnitAI.prototype.IsAttackingAsFormation = function() |5833|5833| { | | [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 |5832|5832| UnitAI.prototype.IsAttackingAsFormation = function() |5833|5833| { |5834|5834| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5835| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5836| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5835|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5836|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5837|5837| }; |5838|5838| |5839|5839| //// 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 |5836|5836| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5837|5837| }; |5838|5838| |5839| |-//// Animal specific functions //// | |5839|+// // Animal specific functions //// |5840|5840| |5841|5841| UnitAI.prototype.MoveRandomly = function(distance) |5842|5842| { binaries/data/mods/public/simulation/components/UnitAI.js |2399| » » » » » » 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 |3762| » 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 |4534| » 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 |4549| » 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 |4595| » 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 |4618| » » ····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 |5074| » 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 | 365| » » ····&&·(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 |1878| » » » » » » var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2019| » » » » » » &&·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 |2092| » » » » » » » » ·&&·((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 |2093| » » » » » » » » ·||·(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 |2094| » » » » » » » » ·&&·(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 |2117| » » » » » » » » var·nearby·=·this.FindNearestDropsite(oldType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2157| » » » » » » » » &&·((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 |2158| » » » » » » » » ||·(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 |2159| » » » » » » » » &&·(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 |2204| » » » » » » » ||·(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 |2205| » » » » » » » &&·(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 |2221| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2394| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2410| » » » » » var·nearby·=·this.FindNearbyResource(function(ent,·type,·template)·{ | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2413| » » » » » » » ||·(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 |2414| » » » » » » » &&·(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 |2434| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2623| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2818| » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'cmpResourceDropsite' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2894| » » » » » if·(this.CanGarrison(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2897| » » » » » » if·(this.CheckGarrisonRange(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2899| » » » » » » » var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2921| » » » » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2922| » » » » » » » » if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2937| » » » » » » » » » var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2938| » » » » » » » » » var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2965| » » » » » » » if·(this.MoveToTarget(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |3724| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3793| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4063| » let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |4316| » » var·parabolicMaxRange·=·0; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4320| » var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4327| » 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 |4383| » » » &&·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 |4551| » » &&·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 |4552| » » &&·(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 |5074| » var·lastPos·=·undefined; | | [NORMAL] JSHintBear: | | It's not necessary to initialize 'lastPos' to 'undefined'. binaries/data/mods/public/simulation/components/UnitAI.js |5428| » » » » » » &&·!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 |5431| » » » » » » &&·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 |5444| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5445| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5451| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5452| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5454| » » » » &&·!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 |5457| » » » » &&·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 |5532| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5535| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5540| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5543| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5543| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [MAJOR] JSHintBear: | | Too many errors. (92% scanned). Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/differential/1250/display/redirect Comment Actions
(Also wondering whether it's better to serialize the multiplier than the actual speed. Wondering if precision could be lost, leading to an OOS? I guess not, as I expect more stuff to blow up if that were the case.) (Also wondering whether Itms was right that keeping two variables in sync might be more asking for trouble and complexity than recomputing it. It's a tradeoff between performance benefit, memory disadvantage and two different kinds of code complexity. One would have to look at all the JS code calling that function, testing whether it's called often enough to be necessary, but I don't care about that now)
Comment Actions Will update with your comments, except for the "runspeedmultiplier" thingy.
Comment Actions
Thanks for taking the time.
Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... source/tools/atlas/GameInterface/ActorViewer.cpp | 213| » void·UpdatePropListRecursive(CModelAbstract*·model); | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character '{' when these macros are defined: 'MESSAGESSETUP_NOTFIRST'. Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClass' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | 8| 8| let height = 5; | 9| 9| | 10| 10| AddMock(SYSTEM_ENTITY, IID_Pathfinder, { | 11| |- GetPassabilityClass: (name) => 1 << 8 | | 11|+ "GetPassabilityClass": (name) => 1 << 8 | 12| 12| }); | 13| 13| | 14| 14| let cmpUnitMotionFlying = ConstructComponent(entity, "UnitMotionFlying", { binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | 45| » "SetHeightFixed":·(y)·=>·height·=·y, | | [NORMAL] ESLintBear (no-return-assign): | | Arrow function should not return assignment. | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 34| 34| | 35| 35| | 36| 36| AddMock(SYSTEM_ENTITY, IID_Timer, { | 37| |- SetInterval: function() { }, | | 37|+ "SetInterval": function() { }, | 38| 38| SetTimeout: function() { }, | 39| 39| }); | 40| 40| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 35| 35| | 36| 36| AddMock(SYSTEM_ENTITY, IID_Timer, { | 37| 37| SetInterval: function() { }, | 38| |- SetTimeout: function() { }, | | 38|+ "SetTimeout": function() { }, | 39| 39| }); | 40| 40| | 41| 41| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 39| 39| }); | 40| 40| | 41| 41| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 42| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 42|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 42| 42| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 43| 43| return 1; | 44| 44| }, | 45| |- EnableActiveQuery: function(id) { }, | | 45|+ "EnableActiveQuery": function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 46|+ "ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 46|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| |- DisableActiveQuery: function(id) { }, | | 47|+ "DisableActiveQuery": function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | 50| 50| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 45| 45| EnableActiveQuery: function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| |- GetEntityFlagMask: function(identifier) { }, | | 48|+ "GetEntityFlagMask": function(identifier) { }, | 49| 49| }); | 50| 50| | 51| 51| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 49| 49| }); | 50| 50| | 51| 51| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 52| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 52|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 53| 53| }); | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 53| 53| }); | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 56| |- GetPlayerByID: function(id) { return playerEntity; }, | | 56|+ "GetPlayerByID": function(id) { return playerEntity; }, | 57| 57| GetNumPlayers: function() { return 2; }, | 58| 58| }); | 59| 59| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 56| 56| GetPlayerByID: function(id) { return playerEntity; }, | 57| |- GetNumPlayers: function() { return 2; }, | | 57|+ "GetNumPlayers": function() { return 2; }, | 58| 58| }); | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 58| 58| }); | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | 61| |- IsAlly: function() { return false; }, | | 61|+ "IsAlly": function() { return false; }, | 62| 62| IsEnemy: function() { return true; }, | 63| 63| GetEnemies: function() { return []; }, | 64| 64| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | 61| 61| IsAlly: function() { return false; }, | 62| |- IsEnemy: function() { return true; }, | | 62|+ "IsEnemy": function() { return true; }, | 63| 63| GetEnemies: function() { return []; }, | 64| 64| }); | 65| 65| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 60| 60| AddMock(playerEntity, IID_Player, { | 61| 61| IsAlly: function() { return false; }, | 62| 62| IsEnemy: function() { return true; }, | 63| |- GetEnemies: function() { return []; }, | | 63|+ "GetEnemies": function() { return []; }, | 64| 64| }); | 65| 65| | 66| 66| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 67| 67| var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 68| 68| | 69| 69| AddMock(unit, IID_Identity, { | 70| |- GetClassesList: function() { return []; }, | | 70|+ "GetClassesList": function() { return []; }, | 71| 71| }); | 72| 72| | 73| 73| AddMock(unit, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 71| 71| }); | 72| 72| | 73| 73| AddMock(unit, IID_Ownership, { | 74| |- GetOwner: function() { return 1; }, | | 74|+ "GetOwner": function() { return 1; }, | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | 78| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 78|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| |- GetPosition: function() { return new Vector3D(); }, | | 79|+ "GetPosition": function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 77| 77| AddMock(unit, IID_Position, { | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| |- GetPosition2D: function() { return new Vector2D(); }, | | 80|+ "GetPosition2D": function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | 83| 83| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| |- GetRotation: function() { return { "y": 0 }; }, | | 81|+ "GetRotation": function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | 83| 83| }); | 84| 84| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| |- IsInWorld: function() { return true; }, | | 82|+ "IsInWorld": function() { return true; }, | 83| 83| }); | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 83| 83| }); | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| |- GetWalkSpeed: function() { return 1; }, | | 86|+ "GetWalkSpeed": function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| |- MoveToFormationOffset: function(target, x, z) { }, | | 87|+ "MoveToFormationOffset": function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| |- IsInTargetRange: function(target, min, max) { return true; }, | | 88|+ "IsInTargetRange": function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| |- MoveToTargetRange: function(target, min, max) { }, | | 89|+ "MoveToTargetRange": function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | 92| 92| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| |- StopMoving: function() { }, | | 90|+ "StopMoving": function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | 92| 92| }); | 93| 93| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| |- GetPassabilityClassName: function() { return "default"; }, | | 91|+ "GetPassabilityClassName": function() { return "default"; }, | 92| 92| }); | 93| 93| | 94| 94| AddMock(unit, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 92| 92| }); | 93| 93| | 94| 94| AddMock(unit, IID_Vision, { | 95| |- GetRange: function() { return 10; }, | | 95|+ "GetRange": function() { return 10; }, | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 99|+ "GetRange": function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 99|+ GetRange: function() { return { "max": 10, "min": 0 }; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 100|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 100|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 101|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| |- GetPreference: function(t) { return 0; }, | | 102|+ "GetPreference": function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 103|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | 106| 106| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| |- CanAttack: function(v) { return true; }, | | 104|+ "CanAttack": function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | 106| 106| }); | 107| 107| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 105|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 106| 106| }); | 107| 107| | 108| 108| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 113| 113| if (mode == 1) | 114| 114| { | 115| 115| AddMock(enemy, IID_Health, { | 116| |- GetHitpoints: function() { return 10; }, | | 116|+ "GetHitpoints": function() { return 10; }, | 117| 117| }); | 118| 118| AddMock(enemy, IID_UnitAI, { | 119| 119| IsAnimal: function() { return false; } | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAnimal' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 116| 116| GetHitpoints: function() { return 10; }, | 117| 117| }); | 118| 118| AddMock(enemy, IID_UnitAI, { | 119| |- IsAnimal: function() { return false; } | | 119|+ "IsAnimal": function() { return false; } | 120| 120| }); | 121| 121| } | 122| 122| else if (mode == 2) | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 121| 121| } | 122| 122| else if (mode == 2) | 123| 123| AddMock(enemy, IID_Health, { | 124| |- GetHitpoints: function() { return 0; }, | | 124|+ "GetHitpoints": function() { return 0; }, | 125| 125| }); | 126| 126| | 127| 127| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 124| 124| GetHitpoints: function() { return 0; }, | 125| 125| }); | 126| 126| | 127| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 127|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 124| 124| GetHitpoints: function() { return 0; }, | 125| 125| }); | 126| 126| | 127| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 127|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | 131| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 131|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 132|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 130| 130| AddMock(controller, IID_Position, { | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 133|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 134|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | 137| 137| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| |- GetRotation: function() { return { "y": 0 }; }, | | 135|+ "GetRotation": function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | 137| 137| }); | 138| 138| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| |- IsInWorld: function() { return true; }, | | 136|+ "IsInWorld": function() { return true; }, | 137| 137| }); | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 137| 137| }); | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| |- GetWalkSpeed: function() { return 1; }, | | 140|+ "GetWalkSpeed": function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeedMultiplier' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| |- SetSpeedMultiplier: function(speed) { }, | | 141|+ "SetSpeedMultiplier": function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 142|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | 145| 145| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| |- GetPassabilityClassName: function() { return "default"; }, | | 143|+ "GetPassabilityClassName": function() { return "default"; }, | 144| 144| }); | 145| 145| | 146| 146| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 181| 181| var unitAIs = []; | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| |- SetInterval: function() { }, | | 184|+ "SetInterval": function() { }, | 185| 185| SetTimeout: function() { }, | 186| 186| }); | 187| 187| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| 184| SetInterval: function() { }, | 185| |- SetTimeout: function() { }, | | 185|+ "SetTimeout": function() { }, | 186| 186| }); | 187| 187| | 188| 188| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 187| 187| | 188| 188| | 189| 189| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 190| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 190|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 190| 190| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| |- EnableActiveQuery: function(id) { }, | | 193|+ "EnableActiveQuery": function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| |- ResetActiveQuery: function(id) { return [enemy]; }, | | 194|+ "ResetActiveQuery": function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| |- DisableActiveQuery: function(id) { }, | | 195|+ "DisableActiveQuery": function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | 198| 198| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| |- GetEntityFlagMask: function(identifier) { }, | | 196|+ "GetEntityFlagMask": function(identifier) { }, | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 200| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 200|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| |- GetPlayerByID: function(id) { return playerEntity; }, | | 204|+ "GetPlayerByID": function(id) { return playerEntity; }, | 205| 205| GetNumPlayers: function() { return 2; }, | 206| 206| }); | 207| 207| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| 204| GetPlayerByID: function(id) { return playerEntity; }, | 205| |- GetNumPlayers: function() { return 2; }, | | 205|+ "GetNumPlayers": function() { return 2; }, | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| |- IsAlly: function() { return false; }, | | 209|+ "IsAlly": function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| |- IsEnemy: function() { return true; }, | | 210|+ "IsEnemy": function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | 213| 213| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| |- GetEnemies: function() { return []; }, | | 211|+ "GetEnemies": function() { return []; }, | 212| 212| }); | 213| 213| | 214| 214| // create units | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 219| 219| var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 220| 220| | 221| 221| AddMock(unit + i, IID_Identity, { | 222| |- GetClassesList: function() { return []; }, | | 222|+ "GetClassesList": function() { return []; }, | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | 226| |- GetOwner: function() { return 1; }, | | 226|+ "GetOwner": function() { return 1; }, | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 230|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| |- GetPosition: function() { return new Vector3D(); }, | | 231|+ "GetPosition": function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| |- GetPosition2D: function() { return new Vector2D(); }, | | 232|+ "GetPosition2D": function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| |- GetRotation: function() { return { "y": 0 }; }, | | 233|+ "GetRotation": function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | 236| 236| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| |- IsInWorld: function() { return true; }, | | 234|+ "IsInWorld": function() { return true; }, | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| |- GetWalkSpeed: function() { return 1; }, | | 238|+ "GetWalkSpeed": function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| |- MoveToFormationOffset: function(target, x, z) { }, | | 239|+ "MoveToFormationOffset": function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| |- IsInTargetRange: function(target, min, max) { return true; }, | | 240|+ "IsInTargetRange": function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| |- MoveToTargetRange: function(target, min, max) { }, | | 241|+ "MoveToTargetRange": function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| |- StopMoving: function() { }, | | 242|+ "StopMoving": function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | 245| 245| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| |- GetPassabilityClassName: function() { return "default"; }, | | 243|+ "GetPassabilityClassName": function() { return "default"; }, | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | 247| |- GetRange: function() { return 10; }, | | 247|+ "GetRange": function() { return 10; }, | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return { "max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 253|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 254|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| |- CanAttack: function(v) { return true; }, | | 255|+ "CanAttack": function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 256|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | 259| 259| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 265| 265| | 266| 266| // create enemy | 267| 267| AddMock(enemy, IID_Health, { | 268| |- GetHitpoints: function() { return 40; }, | | 268|+ "GetHitpoints": function() { return 40; }, | 269| 269| }); | 270| 270| | 271| 271| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 275|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 276|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 277|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 278|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| |- GetRotation: function() { return { "y": 0 }; }, | | 279|+ "GetRotation": function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | 282| 282| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| |- IsInWorld: function() { return true; }, | | 280|+ "IsInWorld": function() { return true; }, | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| |- GetWalkSpeed: function() { return 1; }, | | 284|+ "GetWalkSpeed": function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeedMultiplier' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| |- SetSpeedMultiplier: function(speed) { }, | | 285|+ "SetSpeedMultiplier": function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 286|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| |- IsInTargetRange: function(target, min, max) { return true; }, | | 287|+ "IsInTargetRange": function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | 290| 290| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| |- StopMoving: function() { }, | | 288|+ "StopMoving": function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | 290| 290| }); | 291| 291| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| |- GetPassabilityClassName: function() { return "default"; }, | | 289|+ "GetPassabilityClassName": function() { return "default"; }, | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return { "max":10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttackAsFormation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| 293| GetRange: function() { return {"max":10, "min": 0}; }, | 294| |- CanAttackAsFormation: function() { return false; }, | | 294|+ "CanAttackAsFormation": function() { return false; }, | 295| 295| }); | 296| 296| | 297| 297| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 303| 303| for (var ent of unitAIs) | 304| 304| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 305| 305| | 306| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 306|+ controllerAI.MoveIntoFormation({ "name": "Circle"}); | 307| 307| | 308| 308| // let all units be in position | 309| 309| for (var ent of unitAIs) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 303| 303| for (var ent of unitAIs) | 304| 304| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 305| 305| | 306| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 306|+ controllerAI.MoveIntoFormation({"name": "Circle" }); | 307| 307| | 308| 308| // let all units be in position | 309| 309| for (var ent of unitAIs) binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| » » ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·}, | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Closing curly brace appears on the same line as the subsequent block. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 215| » for·(var·i·=·0;·i·<·unitCount;·i++)·{ | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Opening curly brace appears on the same line as controlling statement. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 309| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 312| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 304| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 313| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 126| 126| this.formationMembersWithAura = []; // Members with a formation aura | 127| 127| this.width = 0; | 128| 128| this.depth = 0; | 129| |- this.oldOrientation = {"sin": 0, "cos": 0}; | | 129|+ this.oldOrientation = { "sin": 0, "cos": 0}; | 130| 130| this.twinFormations = []; | 131| 131| // distance from which two twin formations will merge into one. | 132| 132| this.formationSeparation = 0; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 126| 126| this.formationMembersWithAura = []; // Members with a formation aura | 127| 127| this.width = 0; | 128| 128| this.depth = 0; | 129| |- this.oldOrientation = {"sin": 0, "cos": 0}; | | 129|+ this.oldOrientation = {"sin": 0, "cos": 0 }; | 130| 130| this.twinFormations = []; | 131| 131| // distance from which two twin formations will merge into one. | 132| 132| this.formationSeparation = 0; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 144| 144| | 145| 145| Formation.prototype.GetSize = function() | 146| 146| { | 147| |- return {"width": this.width, "depth": this.depth}; | | 147|+ return { "width": this.width, "depth": this.depth}; | 148| 148| }; | 149| 149| | 150| 150| Formation.prototype.GetSpeedMultiplier = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 144| 144| | 145| 145| Formation.prototype.GetSize = function() | 146| 146| { | 147| |- return {"width": this.width, "depth": this.depth}; | | 147|+ return {"width": this.width, "depth": this.depth }; | 148| 148| }; | 149| 149| | 150| 150| Formation.prototype.GetSpeedMultiplier = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return { "width":1, "depth": 1}; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'width'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return {"width": 1, "depth": 1}; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return {"width":1, "depth": 1 }; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 565| 565| if (!footprints.length) | 566| 566| return {"width":1, "depth": 1}; | 567| 567| | 568| |- var r = {"width": 0, "depth": 0}; | | 568|+ var r = { "width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | 570| 570| { | 571| 571| if (shape.type == "circle") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 565| 565| if (!footprints.length) | 566| 566| return {"width":1, "depth": 1}; | 567| 567| | 568| |- var r = {"width": 0, "depth": 0}; | | 568|+ var r = {"width": 0, "depth": 0 }; | 569| 569| for (var shape of footprints) | 570| 570| { | 571| 571| if (shape.type == "circle") | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for-of'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | 570| |- { | | 570|+ | 571| 571| if (shape.type == "circle") | 572| 572| { | 573| 573| r.width += shape.radius * 2; | 578| 578| r.width += shape.width; | 579| 579| r.depth += shape.depth; | 580| 580| } | 581| |- } | | 581|+ | 582| 582| r.width /= footprints.length; | 583| 583| r.depth /= footprints.length; | 584| 584| return r; | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 591| 591| separation.depth *= this.separationMultiplier.depth; | 592| 592| | 593| 593| if (this.columnar) | 594| |- var sortingClasses = ["Cavalry","Infantry"]; | | 594|+ var sortingClasses = ["Cavalry", "Infantry"]; | 595| 595| else | 596| 596| var sortingClasses = this.sortingClasses.slice(); | 597| 597| sortingClasses.push("Unknown"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 608| 608| var classes = cmpIdentity.GetClassesList(); | 609| 609| var done = false; | 610| 610| for (var c = 0; c < sortingClasses.length; ++c) | 611| |- { | | 611|+ | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| 614| types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | 618| |- } | | 618|+ | 619| 619| if (!done) | 620| 620| types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | 621| 621| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 611| 611| { | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| |- types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | | 614|+ types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]}); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 611| 611| { | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| |- types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | | 614|+ types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] }); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | | [NORMAL] ESLintBear (dot-notation): | | ["Unknown"] is better written in dot notation. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types.Unknown.push({"ent": active[i], "pos": positions[i]}); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types["Unknown"].push({ "ent": active[i], "pos": positions[i]}); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types["Unknown"].push({"ent": active[i], "pos": positions[i] }); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 635| 635| if (this.columnar) | 636| 636| { | 637| 637| shape = "square"; | 638| |- cols = Math.min(count,3); | | 638|+ cols = Math.min(count, 3); | 639| 639| shiftRows = false; | 640| 640| centerGap = 0; | 641| 641| sortingOrder = null; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 689| 689| n -= r%2; | 690| 690| } | 691| 691| else if (shape == "triangle") | 692| |- { | | 692|+ | 693| 693| if (shiftRows) | 694| 694| var n = r + 1; | 695| 695| else | 696| 696| var n = r * 2 + 1; | 697| |- } | | 697|+ | 698| 698| if (!shiftRows && n > left) | 699| 699| n = left; | 700| 700| for (var c = 0; c < n && left > 0; ++c) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 730| 730| // calculating offset distances without a zero average makes no sense, as the formation | 731| 731| // will jump to a different position any time | 732| 732| var avgoffset = Vector2D.average(offsets); | 733| |- offsets.forEach(function (o) {o.sub(avgoffset);}); | | 733|+ offsets.forEach(function(o) {o.sub(avgoffset);}); | 734| 734| | 735| 735| // sort the available places in certain ways | 736| 736| // the places first in the list will contain the heaviest units as defined by the order | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'column'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column}; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column }; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos) | 800| 800| { | 801| 801| var offsetPositions = []; | 802| |- var {sin, cos} = this.GetEstimatedOrientation(pos); | | 802|+ var { sin, cos} = this.GetEstimatedOrientation(pos); | 803| 803| // calculate the world positions | 804| 804| for (var o of offsets) | 805| 805| offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin)); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos) | 800| 800| { | 801| 801| var offsetPositions = []; | 802| |- var {sin, cos} = this.GetEstimatedOrientation(pos); | | 802|+ var {sin, cos } = this.GetEstimatedOrientation(pos); | 803| 803| // calculate the world positions | 804| 804| for (var o of offsets) | 805| 805| offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin)); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos) | 817| 817| { | 818| 818| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); | 819| |- var r = {"sin": 0, "cos": 1}; | | 819|+ var r = { "sin": 0, "cos": 1}; | 820| 820| var unitAIState = cmpUnitAI.GetCurrentState(); | 821| 821| if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING") | 822| 822| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos) | 817| 817| { | 818| 818| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); | 819| |- var r = {"sin": 0, "cos": 1}; | | 819|+ var r = {"sin": 0, "cos": 1 }; | 820| 820| var unitAIState = cmpUnitAI.GetCurrentState(); | 821| 821| if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING") | 822| 822| { | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 898| 898| cmpOtherFormation.RemoveMembers(otherMembers); | 899| 899| this.AddMembers(otherMembers); | 900| 900| Engine.DestroyEntity(this.twinFormations[i]); | 901| |- this.twinFormations.splice(i,1); | | 901|+ this.twinFormations.splice(i, 1); | 902| 902| } | 903| 903| // Switch between column and box if necessary | 904| 904| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); binaries/data/mods/public/simulation/components/Formation.js | 335| » for·(var·ent·of·this.formationMembersWithAura) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 422| » for·(var·ent·of·this.formationMembersWithAura) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 468| » var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position); | | [NORMAL] JSHintBear: | | 'cmpPosition' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 509| » » var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'cmpUnitAI' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 544| » var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position); | | [NORMAL] JSHintBear: | | 'cmpPosition' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 596| » » var·sortingClasses·=·this.sortingClasses.slice(); | | [NORMAL] JSHintBear: | | 'sortingClasses' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 605| » for·(var·i·in·active) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 620| » » » types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]}); | | [NORMAL] JSHintBear: | | ['Unknown'] is better written in dot notation. binaries/data/mods/public/simulation/components/Formation.js | 660| » » for·(var·i·=·0;·i·<·count;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 694| » » » » » var·n·=·r·+·1; | | [NORMAL] JSHintBear: | | 'n' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 696| » » » » » var·n·=·r·*·2·+·1; | | [NORMAL] JSHintBear: | | 'n' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 700| » » » for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c) | | [NORMAL] JSHintBear: | | 'c' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 707| » » » » » var·x·=·side·*·Math.ceil(c/2)·*·separation.width; | | [NORMAL] JSHintBear: | | 'x' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 710| » » » » » if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 712| » » » » » x·+=·side·*·centerGap·/·2; | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 718| » » » » offsets.push(new·Vector2D(x·+·r1,·z·+·r2)); | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 698| » » » if·(!shiftRows·&&·n·>·left) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 699| » » » » n·=·left; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 700| » » » for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 704| » » » » if·(n%2·==·0) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 714| » » » » var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 724| » » » this.maxColumnsUsed[r]·=·n; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 753| » for·(var·i·=·sortingClasses.length;·i;·--i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 597| » sortingClasses.push("Unknown"); | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 602| » for·(var·i·=·0;·i·<·sortingClasses.length;·++i) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 603| » » types[sortingClasses[i]]·=·[]; | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 610| » » for·(var·c·=·0;·c·<·sortingClasses.length;·++c) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 612| » » » if·(classes.indexOf(sortingClasses[c])·>·-1) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 614| » » » » types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]}); | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 753| » for·(var·i·=·sortingClasses.length;·i;·--i) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 755| » » var·t·=·types[sortingClasses[i-1]]; | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 860| » var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion); | | [NORMAL] JSHintBear: | | 'cmpUnitMotion' is already defined. | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 74| 74| var newangle = angle; | 75| 75| var canTurn = true; | 76| 76| if (this.landing) | 77| |- { | | 77|+ | 78| 78| if (this.speed > 0 && this.onGround) | 79| 79| { | 80| 80| if (pos.y <= cmpWaterManager.GetWaterLevel(pos.x, pos.z) && this.template.DiesInWater == "true") | 153| 153| this.waterDeath = true; | 154| 154| } | 155| 155| } | 156| |- } | | 156|+ | 157| 157| else | 158| 158| { | 159| 159| // If we haven't reached max speed yet then we're still on the ground; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 93| 93| pos.y = Math.max(ground, pos.y - turnLength * this.template.ClimbRate); | 94| 94| } | 95| 95| else if (this.speed == 0 && this.onGround) | 96| |- { | | 96|+ | 97| 97| if (this.waterDeath && cmpHealth) | 98| 98| cmpHealth.Kill(); | 99| 99| else | 128| 128| newangle += Math.PI; | 129| 129| } | 130| 130| } | 131| |- } | | 131|+ | 132| 132| else | 133| 133| { | 134| 134| // Final Approach | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 101| 101| this.pitch = 0; | 102| 102| // We've stopped. | 103| 103| if (cmpGarrisonHolder) | 104| |- cmpGarrisonHolder.AllowGarrisoning(true,"UnitMotionFlying"); | | 104|+ cmpGarrisonHolder.AllowGarrisoning(true, "UnitMotionFlying"); | 105| 105| canTurn = false; | 106| 106| this.hasTarget = false; | 107| 107| this.landing = false; | | [NORMAL] ESLintBear (space-unary-ops): | | Unexpected space after unary operator '-'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 138| 138| var targetHeight = ground; | 139| 139| // Steep, then gradual descent. | 140| 140| if ((pos.y - targetHeight) / this.template.FlyingHeight > 1 / SHORT_FINAL) | 141| |- this.pitch = - Math.PI / 18; | | 141|+ this.pitch = -Math.PI / 18; | 142| 142| else | 143| 143| this.pitch = Math.PI / 18; | 144| 144| var descentRate = ((pos.y - targetHeight) / this.template.FlyingHeight * this.template.ClimbRate + SHORT_FINAL) * SHORT_FINAL; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 155| 155| } | 156| 156| } | 157| 157| else | 158| |- { | | 158|+ | 159| 159| // If we haven't reached max speed yet then we're still on the ground; | 160| 160| // otherwise we're taking off or flying | 161| 161| // this.onGround in case of a go-around after landing (but not fully stopped) | 195| 195| this.pitch = -1 * this.pitch; | 196| 196| } | 197| 197| } | 198| |- } | | 198|+ | 199| 199| | 200| 200| // If we're in range of the target then tell people that we've reached it | 201| 201| // (TODO: quantisation breaks this) | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 163| 163| if (this.speed < this.template.TakeoffSpeed && this.onGround) | 164| 164| { | 165| 165| if (cmpGarrisonHolder) | 166| |- cmpGarrisonHolder.AllowGarrisoning(false,"UnitMotionFlying"); | | 166|+ cmpGarrisonHolder.AllowGarrisoning(false, "UnitMotionFlying"); | 167| 167| this.pitch = 0; | 168| 168| // Accelerate forwards | 169| 169| this.speed = Math.min(this.template.MaxSpeed, this.speed + turnLength * this.template.AccelRate); | | [NORMAL] ESLintBear (space-unary-ops): | | Unexpected space after unary operator '-'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 230| 230| if (newangle - angle > Math.PI / 18) | 231| 231| this.roll = Math.PI / 9; | 232| 232| else if (newangle - angle < -Math.PI / 18) | 233| |- this.roll = - Math.PI / 9; | | 233|+ this.roll = -Math.PI / 9; | 234| 234| else | 235| 235| this.roll = newangle - angle; | 236| 236| } | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 322| 322| UnitMotionFlying.prototype.GetSpeedMultiplier = function() | 323| 323| { | 324| 324| return this.GetCurrentSpeed() / this.GetWalkSpeed(); | 325| |-} | | 325|+}; | 326| 326| | 327| 327| UnitMotionFlying.prototype.GetPassabilityClassName = function() | 328| 328| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 346| 346| | 347| 347| UnitMotionFlying.prototype.StopMoving = function() | 348| 348| { | 349| |- //Invert | | 349|+ // Invert | 350| 350| if (!this.waterDeath) | 351| 351| this.landing = !this.landing; | 352| 352| binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 182| » » » var·targetHeight·=·ground·+·(+this.template.FlyingHeight); | | [NORMAL] JSHintBear: | | 'targetHeight' is already defined. binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 325| } | | [NORMAL] JSHintBear: | | Missing semicolon. | | [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 (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 (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 | 228| 228| // Move a tile outside the building | 229| 229| let range = 4; | 230| 230| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) | 231| |- { | | 231|+ | 232| 232| // We've started walking to the given point | 233| 233| this.SetNextState("INDIVIDUAL.WALKING"); | 234| |- } | | 234|+ | 235| 235| else | 236| 236| { | 237| 237| // 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 | 233| 233| this.SetNextState("INDIVIDUAL.WALKING"); | 234| 234| } | 235| 235| else | 236| |- { | | 236|+ | 237| 237| // We are already at the target, or can't move at all | 238| 238| this.FinishOrder(); | 239| |- } | | 239|+ | 240| 240| }, | 241| 241| | 242| 242| // 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 | 335| 335| | 336| 336| var ok = this.MoveToTarget(this.order.data.target); | 337| 337| if (ok) | 338| |- { | | 338|+ | 339| 339| // We've started walking to the given point | 340| 340| if (this.IsAnimal()) | 341| 341| this.SetNextState("ANIMAL.WALKING"); | 342| 342| else | 343| 343| this.SetNextState("INDIVIDUAL.WALKING"); | 344| |- } | | 344|+ | 345| 345| else | 346| 346| { | 347| 347| // 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 | 363| 363| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 364| 364| if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 365| 365| && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 366| |- { | | 366|+ | 367| 367| // we were already on the shoreline, and have not moved since | 368| 368| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | 369| 369| needToMove = false; | 370| |- } | | 370|+ | 371| 371| | 372| 372| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 373| 373| // 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 | 361| 361| // Check if we need to move TODO implement a better way to know if we are on the shoreline | 362| 362| var needToMove = true; | 363| 363| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 364| |- if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 365| |- && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | | 364|+ if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) && | | 365|+ (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 366| 366| { | 367| 367| // we were already on the shoreline, and have not moved since | 368| 368| 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 | 372| 372| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 373| 373| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | 374| 374| if (needToMove && this.MoveToTarget(this.order.data.target)) | 375| |- { | | 375|+ | 376| 376| this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING"); | 377| |- } | | 377|+ | 378| 378| else | 379| 379| { | 380| 380| // 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 | 401| 401| var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance); | 402| 402| var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | 403| 403| if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) | 404| |- { | | 404|+ | 405| 405| // We've started fleeing from the given target | 406| 406| if (this.IsAnimal()) | 407| 407| this.SetNextState("ANIMAL.FLEEING"); | 408| 408| else | 409| 409| this.SetNextState("INDIVIDUAL.FLEEING"); | 410| |- } | | 410|+ | 411| 411| else | 412| 412| { | 413| 413| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 448| 448| } | 449| 449| | 450| 450| if (this.order.data.attackType == this.oldAttackType) | 451| |- { | | 451|+ | 452| 452| if (this.IsAnimal()) | 453| 453| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 454| 454| else | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| |- } | | 456|+ | 457| 457| else | 458| 458| { | 459| 459| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| 456| } | 457| 457| else | 458| |- { | | 458|+ | 459| 459| if (this.IsAnimal()) | 460| 460| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 461| 461| else | 462| 462| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 463| |- } | | 463|+ | 464| 464| return; | 465| 465| } | 466| 466| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 580| 580| this.PushOrderFront("Walk", this.order.data.lastPos); | 581| 581| } | 582| 582| else | 583| |- { | | 583|+ | 584| 584| // We couldn't move there, or the target moved away | 585| 585| this.FinishOrder(); | 586| |- } | | 586|+ | 587| 587| return; | 588| 588| } | 589| 589| | | [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 | 593| 593| | 594| 594| // Try to move within range | 595| 595| if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer)) | 596| |- { | | 596|+ | 597| 597| // We've started walking to the given point | 598| 598| this.SetNextState("INDIVIDUAL.GATHER.APPROACHING"); | 599| |- } | | 599|+ | 600| 600| else | 601| 601| { | 602| 602| // 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 | 670| 670| "Order.Repair": function(msg) { | 671| 671| // Try to move within range | 672| 672| if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) | 673| |- { | | 673|+ | 674| 674| // We've started walking to the given point | 675| 675| this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING"); | 676| |- } | | 676|+ | 677| 677| else | 678| 678| { | 679| 679| // 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 | 706| 706| } | 707| 707| | 708| 708| if (this.MoveToGarrisonRange(this.order.data.target)) | 709| |- { | | 709|+ | 710| 710| this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING"); | 711| |- } | | 711|+ | 712| 712| else | 713| 713| { | 714| 714| // 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 | 834| 834| if (!this.CheckTargetAttackRange(target, target)) | 835| 835| { | 836| 836| if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) | 837| |- { | | 837|+ | 838| 838| if (this.MoveToTargetAttackRange(target, target)) | 839| 839| { | 840| 840| this.SetNextState("COMBAT.APPROACHING"); | 841| 841| return; | 842| 842| } | 843| |- } | | 843|+ | 844| 844| this.FinishOrder(); | 845| 845| return; | 846| 846| } | | [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 | 859| 859| } | 860| 860| // Check if we are already in range, otherwise walk there | 861| 861| if (!this.CheckGarrisonRange(msg.data.target)) | 862| |- { | | 862|+ | 863| 863| if (!this.CheckTargetVisible(msg.data.target)) | 864| 864| { | 865| 865| this.FinishOrder(); | 874| 874| return; | 875| 875| } | 876| 876| } | 877| |- } | | 877|+ | 878| 878| | 879| 879| this.SetNextState("GARRISON.GARRISONING"); | 880| 880| }, | | [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 | 866| 866| return; | 867| 867| } | 868| 868| else | 869| |- { | | 869|+ | 870| 870| // Out of range; move there in formation | 871| 871| if (this.MoveToGarrisonRange(msg.data.target)) | 872| 872| { | 873| 873| this.SetNextState("GARRISON.APPROACHING"); | 874| 874| return; | 875| 875| } | 876| |- } | | 876|+ | 877| 877| } | 878| 878| | 879| 879| 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 | 865| 865| this.FinishOrder(); | 866| 866| return; | 867| 867| } | 868| |- else | 869| |- { | | 868|+ | 870| 869| // Out of range; move there in formation | 871| 870| if (this.MoveToGarrisonRange(msg.data.target)) | 872| 871| { | 873| 872| this.SetNextState("GARRISON.APPROACHING"); | 874| 873| return; | 875| 874| } | 876| |- } | | 875|+ | 877| 876| } | 878| 877| | 879| 878| 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 | 892| 892| this.PushOrderFront("Walk", msg.data.lastPos); | 893| 893| } | 894| 894| else | 895| |- { | | 895|+ | 896| 896| // We couldn't move there, or the target moved away | 897| 897| this.FinishOrder(); | 898| |- } | | 898|+ | 899| 899| return; | 900| 900| } | 901| 901| | | [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 |1113|1113| }, |1114|1114| }, |1115|1115| |1116| |- "GARRISON":{ | |1116|+ "GARRISON": { |1117|1117| "enter": function() { |1118|1118| // If the garrisonholder should pickup, warn it so it can take needed action |1119|1119| 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 |1297|1297| // If the controller handled an order but some members rejected it, |1298|1298| // they will have no orders and be in the FORMATIONMEMBER.IDLE state. |1299|1299| if (this.orderQueue.length) |1300| |- { | |1300|+ |1301|1301| // We're leaving the formation, so stop our FormationWalk order |1302|1302| if (this.FinishOrder()) |1303|1303| return; |1304| |- } | |1304|+ |1305|1305| |1306|1306| // No orders left, we're an individual now |1307|1307| 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 |1325|1325| // Move a tile outside the building |1326|1326| let range = 4; |1327|1327| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |1328| |- { | |1328|+ |1329|1329| // We've started walking to the given point |1330|1330| this.SetNextState("WALKINGTOPOINT"); |1331| |- } | |1331|+ |1332|1332| else |1333|1333| { |1334|1334| // 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 |1330|1330| this.SetNextState("WALKINGTOPOINT"); |1331|1331| } |1332|1332| else |1333| |- { | |1333|+ |1334|1334| // We are already at the target, or can't move at all |1335|1335| this.FinishOrder(); |1336| |- } | |1336|+ |1337|1337| }, |1338|1338| |1339|1339| | | [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 |1531|1531| |1532|1532| "LosRangeUpdate": function(msg) { |1533|1533| if (this.GetStance().targetVisibleEnemies) |1534| |- { | |1534|+ |1535|1535| // Start attacking one of the newly-seen enemy (if any) |1536|1536| this.AttackEntitiesByPreference(msg.data.added); |1537| |- } | |1537|+ |1538|1538| }, |1539|1539| |1540|1540| "LosHealRangeUpdate": 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 |1717|1717| // if nothing better to do, check if the guarded needs to be healed or repaired |1718|1718| var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health); |1719|1719| if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints())) |1720| |- { | |1720|+ |1721|1721| if (this.CanHeal(this.isGuardOf)) |1722|1722| this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false }); |1723|1723| else if (this.CanRepair(this.isGuardOf)) |1724|1724| this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false }); |1725| |- } | |1725|+ |1726|1726| } |1727|1727| }, |1728|1728| | | [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 |1802|1802| "MoveCompleted": function() { |1803|1803| |1804|1804| if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1805| |- { | |1805|+ |1806|1806| // If the unit needs to unpack, do so |1807|1807| if (this.CanUnpack()) |1808|1808| { |1811|1811| } |1812|1812| else |1813|1813| this.SetNextState("ATTACKING"); |1814| |- } | |1814|+ |1815|1815| else |1816|1816| { |1817|1817| 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 |1809|1809| this.PushOrderFront("Unpack", { "force": true }); |1810|1810| return; |1811|1811| } |1812| |- else |1813| |- this.SetNextState("ATTACKING"); | |1812|+ this.SetNextState("ATTACKING"); |1814|1813| } |1815|1814| else |1816|1815| { | | [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 |1813|1813| this.SetNextState("ATTACKING"); |1814|1814| } |1815|1815| else |1816| |- { | |1816|+ |1817|1817| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1818|1818| { |1819|1819| this.SetNextState("APPROACHING"); |1823|1823| // Give up |1824|1824| this.FinishOrder(); |1825|1825| } |1826| |- } | |1826|+ |1827|1827| }, |1828|1828| }, |1829|1829| | | [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 |1815|1815| else |1816|1816| { |1817|1817| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1818| |- { | |1818|+ |1819|1819| this.SetNextState("APPROACHING"); |1820| |- } | |1820|+ |1821|1821| else |1822|1822| { |1823|1823| // 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 |1819|1819| this.SetNextState("APPROACHING"); |1820|1820| } |1821|1821| else |1822| |- { | |1822|+ |1823|1823| // Give up |1824|1824| this.FinishOrder(); |1825| |- } | |1825|+ |1826|1826| } |1827|1827| }, |1828|1828| }, | | [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 |1840|1840| } |1841|1841| // Check the target is still alive and attackable |1842|1842| if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType)) |1843| |- { | |1843|+ |1844|1844| // Can't reach it - try to chase after it |1845|1845| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1846|1846| { |1855|1855| return; |1856|1856| } |1857|1857| } |1858| |- } | |1858|+ |1859|1859| |1860|1860| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |1861|1861| this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType); | | [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 |1886|1886| // TODO: we should probably only bother syncing projectile attacks, not melee |1887|1887| |1888|1888| // If using a non-default prepare time, re-sync the animation when the timer runs. |1889| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1889|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1890|1890| |1891|1891| this.FaceTowardsTarget(this.order.data.target); |1892|1892| | | [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 |2015|2015| |2016|2016| "Attacked": function(msg) { |2017|2017| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2018| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2019| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2018|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2019|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2020|2020| this.RespondToTargetedEntities([msg.data.attacker]); |2021|2021| }, |2022|2022| }, | | [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 |2029|2029| this.SelectAnimation("move"); |2030|2030| var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI); |2031|2031| if (cmpUnitAI && cmpUnitAI.IsFleeing()) |2032| |- { | |2032|+ |2033|2033| // Run after a fleeing target |2034|2034| this.SetMoveSpeedRatio(this.GetRunMultiplier()); |2035| |- } | |2035|+ |2036|2036| this.StartTimer(1000, 1000); |2037|2037| }, |2038|2038| | | [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 |2090|2090| // Also don't switch to a different type of huntable animal |2091|2091| var nearby = this.FindNearbyResource(function(ent, type, template) { |2092|2092| return ( |2093| |- ent != oldTarget |2094| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2093|+ ent != oldTarget && | |2094|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2095|2095| || (type.specific == oldType.specific |2096|2096| && (type.specific != "meat" || oldTemplate == template))) |2097|2097| ); | | [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 |2091|2091| var nearby = this.FindNearbyResource(function(ent, type, template) { |2092|2092| return ( |2093|2093| ent != oldTarget |2094| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2095| |- || (type.specific == oldType.specific | |2094|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2095|+ (type.specific == oldType.specific |2096|2096| && (type.specific != "meat" || oldTemplate == template))) |2097|2097| ); |2098|2098| }, 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 |2092|2092| return ( |2093|2093| ent != oldTarget |2094|2094| && ((type.generic == "treasure" && oldType.generic == "treasure") |2095| |- || (type.specific == oldType.specific |2096| |- && (type.specific != "meat" || oldTemplate == template))) | |2095|+ || (type.specific == oldType.specific && | |2096|+ (type.specific != "meat" || oldTemplate == template))) |2097|2097| ); |2098|2098| }, oldTarget); |2099|2099| 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 |2101|2101| this.PerformGather(nearby, false, false); |2102|2102| return true; |2103|2103| } |2104| |- else |2105| |- { | |2104|+ |2106|2105| // It's probably better in this case, to avoid units getting stuck around a dropsite |2107|2106| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2108|2107| // to order it to GatherNear the resource position. |2123|2122| return true; |2124|2123| } |2125|2124| } |2126| |- } | |2125|+ |2127|2126| return true; |2128|2127| } |2129|2128| 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 |2113|2113| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2114|2114| return true; |2115|2115| } |2116| |- else |2117| |- { | |2116|+ |2118|2117| // we're kind of stuck here. Return resource. |2119|2118| var nearby = this.FindNearestDropsite(oldType.generic); |2120|2119| if (nearby) |2122|2121| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2123|2122| return true; |2124|2123| } |2125| |- } | |2124|+ |2126|2125| } |2127|2126| return true; |2128|2127| } | | [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 |2155|2155| // Also don't switch to a different type of huntable animal |2156|2156| var nearby = this.FindNearbyResource(function(ent, type, template) { |2157|2157| return ( |2158| |- ent != oldTarget |2159| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2158|+ ent != oldTarget && | |2159|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2160|2160| || (type.specific == oldType.specific |2161|2161| && (type.specific != "meat" || oldTemplate == template))) |2162|2162| ); | | [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 |2156|2156| var nearby = this.FindNearbyResource(function(ent, type, template) { |2157|2157| return ( |2158|2158| ent != oldTarget |2159| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2160| |- || (type.specific == oldType.specific | |2159|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2160|+ (type.specific == oldType.specific |2161|2161| && (type.specific != "meat" || oldTemplate == template))) |2162|2162| ); |2163|2163| }); | | [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 |2157|2157| return ( |2158|2158| ent != oldTarget |2159|2159| && ((type.generic == "treasure" && oldType.generic == "treasure") |2160| |- || (type.specific == oldType.specific |2161| |- && (type.specific != "meat" || oldTemplate == template))) | |2160|+ || (type.specific == oldType.specific && | |2161|+ (type.specific != "meat" || oldTemplate == template))) |2162|2162| ); |2163|2163| }); |2164|2164| if (nearby) | | [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 |2202|2202| // Also don't switch to a different type of huntable animal |2203|2203| var nearby = this.FindNearbyResource(function(ent, type, template) { |2204|2204| return ( |2205| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2206| |- || (type.specific == resourceType.specific | |2205|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2206|+ (type.specific == resourceType.specific |2207|2207| && (type.specific != "meat" || resourceTemplate == template)) |2208|2208| ); |2209|2209| }); | | [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 |2203|2203| var nearby = this.FindNearbyResource(function(ent, type, template) { |2204|2204| return ( |2205|2205| (type.generic == "treasure" && resourceType.generic == "treasure") |2206| |- || (type.specific == resourceType.specific |2207| |- && (type.specific != "meat" || resourceTemplate == template)) | |2206|+ || (type.specific == resourceType.specific && | |2207|+ (type.specific != "meat" || resourceTemplate == template)) |2208|2208| ); |2209|2209| }); |2210|2210| | | [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 |2319|2319| |2320|2320| var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply); |2321|2321| if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity)) |2322| |- { | |2322|+ |2323|2323| // Check we can still reach and gather from the target |2324|2324| if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget)) |2325|2325| { |2385|2385| return; |2386|2386| } |2387|2387| } |2388| |- } | |2388|+ |2389|2389| |2390|2390| // We're already in range, can't get anywhere near it or the target is exhausted. |2391|2391| | | [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 |2411|2411| // Also don't switch to a different type of huntable animal |2412|2412| var nearby = this.FindNearbyResource(function(ent, type, template) { |2413|2413| return ( |2414| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2415| |- || (type.specific == resourceType.specific | |2414|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2415|+ (type.specific == resourceType.specific |2416|2416| && (type.specific != "meat" || resourceTemplate == template)) |2417|2417| ); |2418|2418| }); | | [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 |2412|2412| var nearby = this.FindNearbyResource(function(ent, type, template) { |2413|2413| return ( |2414|2414| (type.generic == "treasure" && resourceType.generic == "treasure") |2415| |- || (type.specific == resourceType.specific |2416| |- && (type.specific != "meat" || resourceTemplate == template)) | |2415|+ || (type.specific == resourceType.specific && | |2416|+ (type.specific != "meat" || resourceTemplate == template)) |2417|2417| ); |2418|2418| }); |2419|2419| if (nearby) | | [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 |2499|2499| this.StartTimer(prepare, this.healTimers.repeat); |2500|2500| |2501|2501| // If using a non-default prepare time, re-sync the animation when the timer runs. |2502| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2502|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2503|2503| |2504|2504| this.FaceTowardsTarget(this.order.data.target); |2505|2505| }, | | [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 |2714|2714| { |2715|2715| // The building was already finished/fully repaired before we arrived; |2716|2716| // let the ConstructionFinished handler handle this. |2717| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2717|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2718|2718| return true; |2719|2719| } |2720|2720| | | [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 |2714|2714| { |2715|2715| // The building was already finished/fully repaired before we arrived; |2716|2716| // let the ConstructionFinished handler handle this. |2717| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2717|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2718|2718| return true; |2719|2719| } |2720|2720| | | [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 |2754|2754| if (this.MoveToTargetRange(this.repairTarget, IID_Builder)) |2755|2755| this.SetNextState("APPROACHING"); |2756|2756| else if (!this.CheckTargetRange(this.repairTarget, IID_Builder)) |2757| |- this.FinishOrder(); //can't approach and isn't in reach | |2757|+ this.FinishOrder(); // can't approach and isn't in reach |2758|2758| }, |2759|2759| }, |2760|2760| | | [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 |2841|2841| |2842|2842| // Unit was approaching and there's nothing to do now, so switch to walking |2843|2843| if (oldState === "INDIVIDUAL.REPAIR.APPROACHING") |2844| |- { | |2844|+ |2845|2845| // We're already walking to the given point, so add this as a order. |2846|2846| this.WalkToTarget(msg.data.newentity, true); |2847| |- } | |2847|+ |2848|2848| }, |2849|2849| }, |2850|2850| | | [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 |2894|2894| |2895|2895| // Check that we can garrison here |2896|2896| if (this.CanGarrison(target)) |2897| |- { | |2897|+ |2898|2898| // Check that we're in range of the garrison target |2899|2899| if (this.CheckGarrisonRange(target)) |2900|2900| { |2970|2970| return false; |2971|2971| } |2972|2972| } |2973| |- } | |2973|+ |2974|2974| // Garrisoning failed for some reason, so finish the order |2975|2975| this.FinishOrder(); |2976|2976| 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 |3077|3077| "Attacked": function(msg) { |3078|3078| if (this.template.NaturalBehaviour == "skittish" || |3079|3079| this.template.NaturalBehaviour == "passive") |3080| |- { | |3080|+ |3081|3081| this.Flee(msg.data.attacker, false); |3082| |- } | |3082|+ |3083|3083| else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive") |3084|3084| { |3085|3085| 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 |3086|3086| this.Attack(msg.data.attacker, false); |3087|3087| } |3088|3088| else if (this.template.NaturalBehaviour == "domestic") |3089| |- { | |3089|+ |3090|3090| // Never flee, stop what we were doing |3091|3091| this.SetNextState("IDLE"); |3092| |- } | |3092|+ |3093|3093| }, |3094|3094| |3095|3095| "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 |3096|3096| // Move a tile outside the building |3097|3097| var range = 4; |3098|3098| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |3099| |- { | |3099|+ |3100|3100| // We've started walking to the given point |3101|3101| this.SetNextState("WALKING"); |3102| |- } | |3102|+ |3103|3103| else |3104|3104| { |3105|3105| // 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 |3101|3101| this.SetNextState("WALKING"); |3102|3102| } |3103|3103| else |3104| |- { | |3104|+ |3105|3105| // We are already at the target, or can't move at all |3106|3106| this.FinishOrder(); |3107| |- } | |3107|+ |3108|3108| }, |3109|3109| |3110|3110| "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 |3143|3143| } |3144|3144| // Start attacking one of the newly-seen enemy (if any) |3145|3145| else if (this.IsDangerousAnimal()) |3146| |- { | |3146|+ |3147|3147| this.AttackVisibleEntity(msg.data.added); |3148| |- } | |3148|+ |3149|3149| |3150|3150| // TODO: if two units enter our range together, we'll attack the |3151|3151| // 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 |3186|3186| } |3187|3187| // Start attacking one of the newly-seen enemy (if any) |3188|3188| else if (this.template.NaturalBehaviour == "violent") |3189| |- { | |3189|+ |3190|3190| this.AttackVisibleEntity(msg.data.added); |3191| |- } | |3191|+ |3192|3192| }, |3193|3193| |3194|3194| "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 |3203|3203| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3204|3204| |3205|3205| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3206| |- // only used for domestic animals | |3206|+ // only used for domestic animals |3207|3207| }, |3208|3208| }; |3209|3209| | | [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 |3260|3260| |3261|3261| UnitAI.prototype.IsAnimal = function() |3262|3262| { |3263| |- return (this.template.NaturalBehaviour ? true : false); | |3263|+ return (!!this.template.NaturalBehaviour); |3264|3264| }; |3265|3265| |3266|3266| 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 |3298|3298| UnitAI.prototype.GetGarrisonHolder = function() |3299|3299| { |3300|3300| if (this.IsGarrisoned()) |3301| |- { | |3301|+ |3302|3302| for (let order of this.orderQueue) |3303|3303| if (order.type == "Garrison") |3304|3304| return order.data.target; |3305| |- } | |3305|+ |3306|3306| return INVALID_ENTITY; |3307|3307| }; |3308|3308| | | [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 |3376|3376| { |3377|3377| let index = this.GetCurrentState().indexOf("."); |3378|3378| if (index != -1) |3379| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3379|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3380|3380| this.Stop(false); |3381|3381| } |3382|3382| | | [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 |3432|3432| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3433|3433| continue; |3434|3434| if (i == 0) |3435| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3435|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3436|3436| else |3437|3437| this.orderQueue.splice(i, 1); |3438|3438| 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 |3432|3432| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3433|3433| continue; |3434|3434| if (i == 0) |3435| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3435|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3436|3436| else |3437|3437| this.orderQueue.splice(i, 1); |3438|3438| 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 |3516|3516| }; |3517|3517| |3518|3518| |3519| |-//// FSM linkage functions //// | |3519|+// // FSM linkage functions //// |3520|3520| |3521|3521| // Setting the next state to the current state will leave/re-enter the top-most substate. |3522|3522| UnitAI.prototype.SetNextState = function(state) | | [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 |3688|3688| continue; |3689|3689| if (this.orderQueue[i].type == type) |3690|3690| continue; |3691| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3691|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3692|3692| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3693|3693| return; |3694|3694| } | | [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 |3688|3688| continue; |3689|3689| if (this.orderQueue[i].type == type) |3690|3690| continue; |3691| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3691|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3692|3692| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3693|3693| return; |3694|3694| } | | [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 |3702|3702| { |3703|3703| // Remember the previous work orders to be able to go back to them later if required |3704|3704| if (data && data.force) |3705| |- { | |3705|+ |3706|3706| if (this.IsFormationController()) |3707|3707| this.CallMemberFunction("UpdateWorkOrders", [type]); |3708|3708| else |3709|3709| this.UpdateWorkOrders(type); |3710| |- } | |3710|+ |3711|3711| |3712|3712| let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null; |3713|3713| | | [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 |3779|3779| { |3780|3780| var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |3781|3781| if (cmpUnitAI) |3782| |- { | |3782|+ |3783|3783| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3784|3784| { |3785|3785| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3788|3788| return; |3789|3789| } |3790|3790| } |3791| |- } | |3791|+ |3792|3792| } |3793|3793| |3794|3794| // 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 |3781|3781| if (cmpUnitAI) |3782|3782| { |3783|3783| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3784| |- { | |3784|+ |3785|3785| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3786|3786| { |3787|3787| this.workOrders = cmpUnitAI.orderQueue.slice(i); |3788|3788| return; |3789|3789| } |3790| |- } | |3790|+ |3791|3791| } |3792|3792| } |3793|3793| | | [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 |3793|3793| |3794|3794| // If nothing found, take the unit orders |3795|3795| for (var i = 0; i < this.orderQueue.length; ++i) |3796| |- { | |3796|+ |3797|3797| if (isWorkType(this.orderQueue[i].type)) |3798|3798| { |3799|3799| this.workOrders = this.orderQueue.slice(i); |3800|3800| return; |3801|3801| } |3802| |- } | |3802|+ |3803|3803| }; |3804|3804| |3805|3805| 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 |3859|3859| if (data.timerRepeat === undefined) |3860|3860| this.timer = undefined; |3861|3861| |3862| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3862|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3863|3863| }; |3864|3864| |3865|3865| /** | | [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 |3859|3859| if (data.timerRepeat === undefined) |3860|3860| this.timer = undefined; |3861|3861| |3862| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3862|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3863|3863| }; |3864|3864| |3865|3865| /** | | [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 |3894|3894| this.timer = undefined; |3895|3895| }; |3896|3896| |3897| |-//// Message handlers ///// | |3897|+// // Message handlers ///// |3898|3898| |3899|3899| UnitAI.prototype.OnMotionChanged = function(msg) |3900|3900| { | | [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| UnitAI.prototype.OnMotionChanged = function(msg) |3900|3900| { |3901|3901| if (msg.starting && !msg.error) |3902| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3902|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg}); |3903|3903| else if (!msg.starting || msg.error) |3904|3904| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |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| UnitAI.prototype.OnMotionChanged = function(msg) |3900|3900| { |3901|3901| if (msg.starting && !msg.error) |3902| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3902|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg }); |3903|3903| else if (!msg.starting || msg.error) |3904|3904| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3905|3905| }; | | [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 |3901|3901| if (msg.starting && !msg.error) |3902|3902| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3903|3903| else if (!msg.starting || msg.error) |3904| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3904|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg}); |3905|3905| }; |3906|3906| |3907|3907| 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 |3901|3901| if (msg.starting && !msg.error) |3902|3902| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3903|3903| else if (!msg.starting || msg.error) |3904| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3904|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg }); |3905|3905| }; |3906|3906| |3907|3907| 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 |3909|3909| // TODO: This is a bit inefficient since every unit listens to every |3910|3910| // construction message - ideally we could scope it to only the one we're building |3911|3911| |3912| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3912|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3913|3913| }; |3914|3914| |3915|3915| 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 |3909|3909| // TODO: This is a bit inefficient since every unit listens to every |3910|3910| // construction message - ideally we could scope it to only the one we're building |3911|3911| |3912| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3912|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3913|3913| }; |3914|3914| |3915|3915| 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 |3934|3934| |3935|3935| UnitAI.prototype.OnAttacked = function(msg) |3936|3936| { |3937| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3937|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3938|3938| }; |3939|3939| |3940|3940| 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 |3934|3934| |3935|3935| UnitAI.prototype.OnAttacked = function(msg) |3936|3936| { |3937| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3937|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3938|3938| }; |3939|3939| |3940|3940| 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 |3939|3939| |3940|3940| UnitAI.prototype.OnGuardedAttacked = function(msg) |3941|3941| { |3942| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3942|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3943|3943| }; |3944|3944| |3945|3945| 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 |3939|3939| |3940|3940| UnitAI.prototype.OnGuardedAttacked = function(msg) |3941|3941| { |3942| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3942|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3943|3943| }; |3944|3944| |3945|3945| 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 |3944|3944| |3945|3945| UnitAI.prototype.OnHealthChanged = function(msg) |3946|3946| { |3947| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3947|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3948|3948| }; |3949|3949| |3950|3950| 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 |3944|3944| |3945|3945| UnitAI.prototype.OnHealthChanged = function(msg) |3946|3946| { |3947| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3947|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3948|3948| }; |3949|3949| |3950|3950| 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 |3950|3950| UnitAI.prototype.OnRangeUpdate = function(msg) |3951|3951| { |3952|3952| if (msg.tag == this.losRangeQuery) |3953| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3953|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3954|3954| else if (msg.tag == this.losHealRangeQuery) |3955|3955| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3956|3956| }; | | [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 |3950|3950| UnitAI.prototype.OnRangeUpdate = function(msg) |3951|3951| { |3952|3952| if (msg.tag == this.losRangeQuery) |3953| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3953|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3954|3954| else if (msg.tag == this.losHealRangeQuery) |3955|3955| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3956|3956| }; | | [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 |3952|3952| if (msg.tag == this.losRangeQuery) |3953|3953| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3954|3954| else if (msg.tag == this.losHealRangeQuery) |3955| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3955|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3956|3956| }; |3957|3957| |3958|3958| 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 |3952|3952| if (msg.tag == this.losRangeQuery) |3953|3953| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3954|3954| else if (msg.tag == this.losHealRangeQuery) |3955| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3955|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3956|3956| }; |3957|3957| |3958|3958| 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 |3957|3957| |3958|3958| UnitAI.prototype.OnPackFinished = function(msg) |3959|3959| { |3960| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3960|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3961|3961| }; |3962|3962| |3963|3963| //// 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 |3957|3957| |3958|3958| UnitAI.prototype.OnPackFinished = function(msg) |3959|3959| { |3960| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3960|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3961|3961| }; |3962|3962| |3963|3963| //// 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 |3960|3960| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3961|3961| }; |3962|3962| |3963| |-//// Helper functions to be called by the FSM //// | |3963|+// // Helper functions to be called by the FSM //// |3964|3964| |3965|3965| UnitAI.prototype.GetWalkSpeed = function() |3966|3966| { | | [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 |4062|4062| if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER) |4063|4063| return undefined; |4064|4064| |4065| |- let cmpPosition = Engine.QueryInterface(this.entity, IID_Position) | |4065|+ let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |4066|4066| if (!cmpPosition || !cmpPosition.IsInWorld()) |4067|4067| return undefined; |4068|4068| | | [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 |4147|4147| PlaySound(name, member); |4148|4148| } |4149|4149| else |4150| |- { | |4150|+ |4151|4151| // Otherwise use our own sounds |4152|4152| PlaySound(name, this.entity); |4153| |- } | |4153|+ |4154|4154| }; |4155|4155| |4156|4156| /* | | [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 |4316|4316| else |4317|4317| // return false? Or hope you come close enough? |4318|4318| var parabolicMaxRange = 0; |4319| |- //return false; | |4319|+ // return false; |4320|4320| |4321|4321| // the parabole changes while walking, take something in the middle |4322|4322| 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 |4381|4381| if (this.IsFormationMember()) |4382|4382| { |4383|4383| var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |4384| |- if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() |4385| |- && cmpFormationUnitAI.order.data.target == target) | |4384|+ if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() && | |4385|+ cmpFormationUnitAI.order.data.target == target) |4386|4386| return true; |4387|4387| } |4388|4388| | | [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 |4549|4549| UnitAI.prototype.AttackEntityInZone = function(ents) |4550|4550| { |4551|4551| var target = ents.find(target => |4552| |- this.CanAttack(target) |4553| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4552|+ this.CanAttack(target) && | |4553|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4554|4554| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4555|4555| ); |4556|4556| 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 |4550|4550| { |4551|4551| var target = ents.find(target => |4552|4552| this.CanAttack(target) |4553| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4554| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4553|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4554|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4555|4555| ); |4556|4556| if (!target) |4557|4557| 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 |4614|4614| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4615|4615| if (this.isGuardOf) |4616|4616| { |4617| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4617|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4618|4618| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4619|4619| if (cmpUnitAI && cmpAttack && |4620|4620| 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 |4618|4618| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4619|4619| if (cmpUnitAI && cmpAttack && |4620|4620| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4621| |- return false; | |4621|+ return false; |4622|4622| } |4623|4623| |4624|4624| // 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 |4623|4623| |4624|4624| // Stop if we're in hold-ground mode and it's too far from the holding point |4625|4625| if (this.GetStance().respondHoldGround) |4626| |- { | |4626|+ |4627|4627| if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type)) |4628|4628| return true; |4629| |- } | |4629|+ |4630|4630| |4631|4631| // Stop if it's left our vision range, unless we're especially persistent |4632|4632| 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 |4630|4630| |4631|4631| // Stop if it's left our vision range, unless we're especially persistent |4632|4632| if (!this.GetStance().respondChaseBeyondVision) |4633| |- { | |4633|+ |4634|4634| if (!this.CheckTargetIsInVisionRange(target)) |4635|4635| return true; |4636| |- } | |4636|+ |4637|4637| |4638|4638| // (Note that CCmpUnitMotion will detect if the target is lost in FoW, |4639|4639| // 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 |4656|4656| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4657|4657| if (this.isGuardOf) |4658|4658| { |4659| |- let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4659|+ let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4660|4660| let cmpAttack = Engine.QueryInterface(target, IID_Attack); |4661|4661| if (cmpUnitAI && cmpAttack && |4662|4662| 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 |4669|4669| return false; |4670|4670| }; |4671|4671| |4672| |-//// External interface functions //// | |4672|+// // External interface functions //// |4673|4673| |4674|4674| UnitAI.prototype.SetFormationController = function(ent) |4675|4675| { | | [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 |4679|4679| // of our own formation (or ourself if not in formation) |4680|4680| var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); |4681|4681| if (cmpObstruction) |4682| |- { | |4682|+ |4683|4683| if (ent == INVALID_ENTITY) |4684|4684| cmpObstruction.SetControlGroup(this.entity); |4685|4685| else |4686|4686| cmpObstruction.SetControlGroup(ent); |4687| |- } | |4687|+ |4688|4688| |4689|4689| // If we were removed from a formation, let the FSM switch back to INDIVIDUAL |4690|4690| 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 |4822|4822| // if we already had an old guard order, do nothing if the target is the same |4823|4823| // and the order is running, otherwise remove the previous order |4824|4824| if (this.isGuardOf) |4825| |- { | |4825|+ |4826|4826| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4827|4827| return; |4828|4828| else |4829|4829| this.RemoveGuard(); |4830| |- } | |4830|+ |4831|4831| |4832|4832| this.AddOrder("Guard", { "target": target, "force": false }, queued); |4833|4833| }; | | [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 |4825|4825| { |4826|4826| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4827|4827| return; |4828| |- else |4829| |- this.RemoveGuard(); | |4828|+ this.RemoveGuard(); |4830|4829| } |4831|4830| |4832|4831| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [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 |4996|4996| this.WalkToTarget(target, queued); |4997|4997| return; |4998|4998| } |4999| |- this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued); | |4999|+ this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued); |5000|5000| }; |5001|5001| |5002|5002| /** | | [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 |5145|5145| this.workOrders.length && this.workOrders[0].type == "Trade") |5146|5146| { |5147|5147| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5148| |- if (cmpTrader.HasBothMarkets() && | |5148|+ if (cmpTrader.HasBothMarkets() && |5149|5149| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5150|5150| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5151|5151| { | | [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 |5426|5426| { |5427|5427| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5428|5428| var targetClasses = this.order.data.targetClasses; |5429| |- if (targetClasses.attack && cmpIdentity |5430| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5429|+ if (targetClasses.attack && cmpIdentity && | |5430|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5431|5431| continue; |5432|5432| if (targetClasses.avoid && cmpIdentity |5433|5433| && 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 |5429|5429| if (targetClasses.attack && cmpIdentity |5430|5430| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5431|5431| continue; |5432| |- if (targetClasses.avoid && cmpIdentity |5433| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5432|+ if (targetClasses.avoid && cmpIdentity && | |5433|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5434|5434| continue; |5435|5435| // Only used by the AIs to prevent some choices of targets |5436|5436| 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 |5452|5452| { |5453|5453| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5454|5454| var targetClasses = this.order.data.targetClasses; |5455| |- if (cmpIdentity && targetClasses.attack |5456| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5455|+ if (cmpIdentity && targetClasses.attack && | |5456|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5457|5457| continue; |5458|5458| if (cmpIdentity && targetClasses.avoid |5459|5459| && 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 |5455|5455| if (cmpIdentity && targetClasses.attack |5456|5456| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5457|5457| continue; |5458| |- if (cmpIdentity && targetClasses.avoid |5459| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5458|+ if (cmpIdentity && targetClasses.avoid && | |5459|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5460|5460| continue; |5461|5461| // Only used by the AIs to prevent some choices of targets |5462|5462| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [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 |5598|5598| |5599|5599| UnitAI.prototype.SetHeldPosition = function(x, z) |5600|5600| { |5601| |- this.heldPosition = {"x": x, "z": z}; | |5601|+ this.heldPosition = { "x": x, "z": z}; |5602|5602| }; |5603|5603| |5604|5604| 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 |5598|5598| |5599|5599| UnitAI.prototype.SetHeldPosition = function(x, z) |5600|5600| { |5601| |- this.heldPosition = {"x": x, "z": z}; | |5601|+ this.heldPosition = {"x": x, "z": z }; |5602|5602| }; |5603|5603| |5604|5604| 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 |5625|5625| return false; |5626|5626| }; |5627|5627| |5628| |-//// Helper functions //// | |5628|+// // Helper functions //// |5629|5629| |5630|5630| UnitAI.prototype.CanAttack = function(target) |5631|5631| { | | [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 |5829|5829| return cmpPack && cmpPack.IsPacking(); |5830|5830| }; |5831|5831| |5832| |-//// Formation specific functions //// | |5832|+// // Formation specific functions //// |5833|5833| |5834|5834| UnitAI.prototype.IsAttackingAsFormation = function() |5835|5835| { | | [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 |5834|5834| UnitAI.prototype.IsAttackingAsFormation = function() |5835|5835| { |5836|5836| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5837| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5838| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5837|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5838|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5839|5839| }; |5840|5840| |5841|5841| //// 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 |5838|5838| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5839|5839| }; |5840|5840| |5841| |-//// Animal specific functions //// | |5841|+// // Animal specific functions //// |5842|5842| |5843|5843| UnitAI.prototype.MoveRandomly = function(distance) |5844|5844| { binaries/data/mods/public/simulation/components/UnitAI.js |2401| » » » » » » 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 |3764| » 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 |4536| » 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 |4551| » 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 |4597| » 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 |4620| » » ····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 |5076| » 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 | 365| » » ····&&·(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 |1878| » » » » » » var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2019| » » » » » » &&·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 |2094| » » » » » » » » ·&&·((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 |2095| » » » » » » » » ·||·(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 |2096| » » » » » » » » ·&&·(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 |2119| » » » » » » » » var·nearby·=·this.FindNearestDropsite(oldType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2159| » » » » » » » » &&·((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 |2160| » » » » » » » » ||·(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 |2161| » » » » » » » » &&·(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 |2206| » » » » » » » ||·(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 |2207| » » » » » » » &&·(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 |2223| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2396| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2412| » » » » » var·nearby·=·this.FindNearbyResource(function(ent,·type,·template)·{ | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2415| » » » » » » » ||·(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 |2416| » » » » » » » &&·(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 |2436| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2625| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2820| » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'cmpResourceDropsite' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2896| » » » » » if·(this.CanGarrison(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2899| » » » » » » if·(this.CheckGarrisonRange(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2901| » » » » » » » var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2923| » » » » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2924| » » » » » » » » if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2939| » » » » » » » » » var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2940| » » » » » » » » » var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2967| » » » » » » » if·(this.MoveToTarget(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |3726| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3795| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4065| » let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |4318| » » var·parabolicMaxRange·=·0; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4322| » var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4329| » 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 |4385| » » » &&·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 |4553| » » &&·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 |4554| » » &&·(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 |5076| » var·lastPos·=·undefined; | | [NORMAL] JSHintBear: | | It's not necessary to initialize 'lastPos' to 'undefined'. binaries/data/mods/public/simulation/components/UnitAI.js |5430| » » » » » » &&·!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 |5433| » » » » » » &&·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 |5446| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5447| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5453| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5454| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5456| » » » » &&·!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 |5459| » » » » &&·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 |5534| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5537| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5542| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5545| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5545| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [MAJOR] JSHintBear: | | Too many errors. (92% scanned). Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/differential/1365/display/redirect
Comment Actions Tweak some more things. Will probably commit as-is as I have about 15 other revisions coming up on this code. Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... source/tools/atlas/GameInterface/ActorViewer.cpp | 213| » void·UpdatePropListRecursive(CModelAbstract*·model); | | [MAJOR] CPPCheckBear (syntaxError): | | Invalid number of character '{' when these macros are defined: 'MESSAGESSETUP_NOTFIRST'. Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 34| 34| | 35| 35| | 36| 36| AddMock(SYSTEM_ENTITY, IID_Timer, { | 37| |- SetInterval: function() { }, | | 37|+ "SetInterval": function() { }, | 38| 38| SetTimeout: function() { }, | 39| 39| }); | 40| 40| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 35| 35| | 36| 36| AddMock(SYSTEM_ENTITY, IID_Timer, { | 37| 37| SetInterval: function() { }, | 38| |- SetTimeout: function() { }, | | 38|+ "SetTimeout": function() { }, | 39| 39| }); | 40| 40| | 41| 41| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 39| 39| }); | 40| 40| | 41| 41| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 42| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 42|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 42| 42| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 43| 43| return 1; | 44| 44| }, | 45| |- EnableActiveQuery: function(id) { }, | | 45|+ "EnableActiveQuery": function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 46|+ "ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| return 1; | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 46|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| }, | 45| 45| EnableActiveQuery: function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| |- DisableActiveQuery: function(id) { }, | | 47|+ "DisableActiveQuery": function(id) { }, | 48| 48| GetEntityFlagMask: function(identifier) { }, | 49| 49| }); | 50| 50| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 45| 45| EnableActiveQuery: function(id) { }, | 46| 46| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 47| 47| DisableActiveQuery: function(id) { }, | 48| |- GetEntityFlagMask: function(identifier) { }, | | 48|+ "GetEntityFlagMask": function(identifier) { }, | 49| 49| }); | 50| 50| | 51| 51| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 49| 49| }); | 50| 50| | 51| 51| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 52| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 52|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 53| 53| }); | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 53| 53| }); | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 56| |- GetPlayerByID: function(id) { return playerEntity; }, | | 56|+ "GetPlayerByID": function(id) { return playerEntity; }, | 57| 57| GetNumPlayers: function() { return 2; }, | 58| 58| }); | 59| 59| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 54| 54| | 55| 55| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 56| 56| GetPlayerByID: function(id) { return playerEntity; }, | 57| |- GetNumPlayers: function() { return 2; }, | | 57|+ "GetNumPlayers": function() { return 2; }, | 58| 58| }); | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 58| 58| }); | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | 61| |- IsAlly: function() { return false; }, | | 61|+ "IsAlly": function() { return false; }, | 62| 62| IsEnemy: function() { return true; }, | 63| 63| GetEnemies: function() { return []; }, | 64| 64| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 59| 59| | 60| 60| AddMock(playerEntity, IID_Player, { | 61| 61| IsAlly: function() { return false; }, | 62| |- IsEnemy: function() { return true; }, | | 62|+ "IsEnemy": function() { return true; }, | 63| 63| GetEnemies: function() { return []; }, | 64| 64| }); | 65| 65| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 60| 60| AddMock(playerEntity, IID_Player, { | 61| 61| IsAlly: function() { return false; }, | 62| 62| IsEnemy: function() { return true; }, | 63| |- GetEnemies: function() { return []; }, | | 63|+ "GetEnemies": function() { return []; }, | 64| 64| }); | 65| 65| | 66| 66| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 67| 67| var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 68| 68| | 69| 69| AddMock(unit, IID_Identity, { | 70| |- GetClassesList: function() { return []; }, | | 70|+ "GetClassesList": function() { return []; }, | 71| 71| }); | 72| 72| | 73| 73| AddMock(unit, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 71| 71| }); | 72| 72| | 73| 73| AddMock(unit, IID_Ownership, { | 74| |- GetOwner: function() { return 1; }, | | 74|+ "GetOwner": function() { return 1; }, | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | 78| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 78|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 76| 76| | 77| 77| AddMock(unit, IID_Position, { | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| |- GetPosition: function() { return new Vector3D(); }, | | 79|+ "GetPosition": function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 77| 77| AddMock(unit, IID_Position, { | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| |- GetPosition2D: function() { return new Vector2D(); }, | | 80|+ "GetPosition2D": function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | 83| 83| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 78| 78| GetTurretParent: function() { return INVALID_ENTITY; }, | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| |- GetRotation: function() { return { "y": 0 }; }, | | 81|+ "GetRotation": function() { return { "y": 0 }; }, | 82| 82| IsInWorld: function() { return true; }, | 83| 83| }); | 84| 84| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 79| 79| GetPosition: function() { return new Vector3D(); }, | 80| 80| GetPosition2D: function() { return new Vector2D(); }, | 81| 81| GetRotation: function() { return { "y": 0 }; }, | 82| |- IsInWorld: function() { return true; }, | | 82|+ "IsInWorld": function() { return true; }, | 83| 83| }); | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 83| 83| }); | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| |- GetWalkSpeed: function() { return 1; }, | | 86|+ "GetWalkSpeed": function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 84| 84| | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| |- MoveToFormationOffset: function(target, x, z) { }, | | 87|+ "MoveToFormationOffset": function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 85| 85| AddMock(unit, IID_UnitMotion, { | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| |- IsInTargetRange: function(target, min, max) { return true; }, | | 88|+ "IsInTargetRange": function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 86| 86| GetWalkSpeed: function() { return 1; }, | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| |- MoveToTargetRange: function(target, min, max) { }, | | 89|+ "MoveToTargetRange": function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | 92| 92| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 87| 87| MoveToFormationOffset: function(target, x, z) { }, | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| |- StopMoving: function() { }, | | 90|+ "StopMoving": function() { }, | 91| 91| GetPassabilityClassName: function() { return "default"; }, | 92| 92| }); | 93| 93| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 88| 88| IsInTargetRange: function(target, min, max) { return true; }, | 89| 89| MoveToTargetRange: function(target, min, max) { }, | 90| 90| StopMoving: function() { }, | 91| |- GetPassabilityClassName: function() { return "default"; }, | | 91|+ "GetPassabilityClassName": function() { return "default"; }, | 92| 92| }); | 93| 93| | 94| 94| AddMock(unit, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 92| 92| }); | 93| 93| | 94| 94| AddMock(unit, IID_Vision, { | 95| |- GetRange: function() { return 10; }, | | 95|+ "GetRange": function() { return 10; }, | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 99|+ "GetRange": function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 99|+ GetRange: function() { return { "max": 10, "min": 0 }; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 100|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 97| 97| | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 100|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 98| 98| AddMock(unit, IID_Attack, { | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 101|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 99| 99| GetRange: function() { return { "max": 10, "min": 0}; }, | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| |- GetPreference: function(t) { return 0; }, | | 102|+ "GetPreference": function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 103|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | 106| 106| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| GetBestAttackAgainst: function(t) { return "melee"; }, | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| |- CanAttack: function(v) { return true; }, | | 104|+ "CanAttack": function(v) { return true; }, | 105| 105| CompareEntitiesByPreference: function(a, b) { return 0; }, | 106| 106| }); | 107| 107| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 102| 102| GetPreference: function(t) { return 0; }, | 103| 103| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 104| 104| CanAttack: function(v) { return true; }, | 105| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 105|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 106| 106| }); | 107| 107| | 108| 108| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 113| 113| if (mode == 1) | 114| 114| { | 115| 115| AddMock(enemy, IID_Health, { | 116| |- GetHitpoints: function() { return 10; }, | | 116|+ "GetHitpoints": function() { return 10; }, | 117| 117| }); | 118| 118| AddMock(enemy, IID_UnitAI, { | 119| 119| IsAnimal: function() { return false; } | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAnimal' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 116| 116| GetHitpoints: function() { return 10; }, | 117| 117| }); | 118| 118| AddMock(enemy, IID_UnitAI, { | 119| |- IsAnimal: function() { return false; } | | 119|+ "IsAnimal": function() { return false; } | 120| 120| }); | 121| 121| } | 122| 122| else if (mode == 2) | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 121| 121| } | 122| 122| else if (mode == 2) | 123| 123| AddMock(enemy, IID_Health, { | 124| |- GetHitpoints: function() { return 0; }, | | 124|+ "GetHitpoints": function() { return 0; }, | 125| 125| }); | 126| 126| | 127| 127| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 124| 124| GetHitpoints: function() { return 0; }, | 125| 125| }); | 126| 126| | 127| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 127|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 124| 124| GetHitpoints: function() { return 0; }, | 125| 125| }); | 126| 126| | 127| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 127|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 128| 128| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | 131| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 131|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 129| 129| | 130| 130| AddMock(controller, IID_Position, { | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 132|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 130| 130| AddMock(controller, IID_Position, { | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 133|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 131| 131| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 134|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | 137| 137| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 132| 132| GetTurretParent: function() { return INVALID_ENTITY; }, | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| |- GetRotation: function() { return { "y": 0 }; }, | | 135|+ "GetRotation": function() { return { "y": 0 }; }, | 136| 136| IsInWorld: function() { return true; }, | 137| 137| }); | 138| 138| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 133| 133| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 134| 134| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 135| 135| GetRotation: function() { return { "y": 0 }; }, | 136| |- IsInWorld: function() { return true; }, | | 136|+ "IsInWorld": function() { return true; }, | 137| 137| }); | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 137| 137| }); | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| |- GetWalkSpeed: function() { return 1; }, | | 140|+ "GetWalkSpeed": function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeedMultiplier' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 138| 138| | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| |- SetSpeedMultiplier: function(speed) { }, | | 141|+ "SetSpeedMultiplier": function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 139| 139| AddMock(controller, IID_UnitMotion, { | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 142|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 143| 143| GetPassabilityClassName: function() { return "default"; }, | 144| 144| }); | 145| 145| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 140| 140| GetWalkSpeed: function() { return 1; }, | 141| 141| SetSpeedMultiplier: function(speed) { }, | 142| 142| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 143| |- GetPassabilityClassName: function() { return "default"; }, | | 143|+ "GetPassabilityClassName": function() { return "default"; }, | 144| 144| }); | 145| 145| | 146| 146| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 181| 181| var unitAIs = []; | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| |- SetInterval: function() { }, | | 184|+ "SetInterval": function() { }, | 185| 185| SetTimeout: function() { }, | 186| 186| }); | 187| 187| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 182| 182| | 183| 183| AddMock(SYSTEM_ENTITY, IID_Timer, { | 184| 184| SetInterval: function() { }, | 185| |- SetTimeout: function() { }, | | 185|+ "SetTimeout": function() { }, | 186| 186| }); | 187| 187| | 188| 188| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 187| 187| | 188| 188| | 189| 189| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 190| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 190|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 190| 190| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 191| 191| return 1; | 192| 192| }, | 193| |- EnableActiveQuery: function(id) { }, | | 193|+ "EnableActiveQuery": function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 191| 191| return 1; | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| |- ResetActiveQuery: function(id) { return [enemy]; }, | | 194|+ "ResetActiveQuery": function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 192| 192| }, | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| |- DisableActiveQuery: function(id) { }, | | 195|+ "DisableActiveQuery": function(id) { }, | 196| 196| GetEntityFlagMask: function(identifier) { }, | 197| 197| }); | 198| 198| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 193| 193| EnableActiveQuery: function(id) { }, | 194| 194| ResetActiveQuery: function(id) { return [enemy]; }, | 195| 195| DisableActiveQuery: function(id) { }, | 196| |- GetEntityFlagMask: function(identifier) { }, | | 196|+ "GetEntityFlagMask": function(identifier) { }, | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 197| 197| }); | 198| 198| | 199| 199| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 200| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 200|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 201| 201| }); | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| |- GetPlayerByID: function(id) { return playerEntity; }, | | 204|+ "GetPlayerByID": function(id) { return playerEntity; }, | 205| 205| GetNumPlayers: function() { return 2; }, | 206| 206| }); | 207| 207| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 202| 202| | 203| 203| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 204| 204| GetPlayerByID: function(id) { return playerEntity; }, | 205| |- GetNumPlayers: function() { return 2; }, | | 205|+ "GetNumPlayers": function() { return 2; }, | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 206| 206| }); | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| |- IsAlly: function() { return false; }, | | 209|+ "IsAlly": function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 207| 207| | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| |- IsEnemy: function() { return true; }, | | 210|+ "IsEnemy": function() { return true; }, | 211| 211| GetEnemies: function() { return []; }, | 212| 212| }); | 213| 213| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 208| 208| AddMock(playerEntity, IID_Player, { | 209| 209| IsAlly: function() { return false; }, | 210| 210| IsEnemy: function() { return true; }, | 211| |- GetEnemies: function() { return []; }, | | 211|+ "GetEnemies": function() { return []; }, | 212| 212| }); | 213| 213| | 214| 214| // create units | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 219| 219| var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 220| 220| | 221| 221| AddMock(unit + i, IID_Identity, { | 222| |- GetClassesList: function() { return []; }, | | 222|+ "GetClassesList": function() { return []; }, | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 223| 223| }); | 224| 224| | 225| 225| AddMock(unit + i, IID_Ownership, { | 226| |- GetOwner: function() { return 1; }, | | 226|+ "GetOwner": function() { return 1; }, | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 227| 227| }); | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 230|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 228| 228| | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| |- GetPosition: function() { return new Vector3D(); }, | | 231|+ "GetPosition": function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 229| 229| AddMock(unit + i, IID_Position, { | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| |- GetPosition2D: function() { return new Vector2D(); }, | | 232|+ "GetPosition2D": function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| 230| GetTurretParent: function() { return INVALID_ENTITY; }, | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| |- GetRotation: function() { return { "y": 0 }; }, | | 233|+ "GetRotation": function() { return { "y": 0 }; }, | 234| 234| IsInWorld: function() { return true; }, | 235| 235| }); | 236| 236| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 231| 231| GetPosition: function() { return new Vector3D(); }, | 232| 232| GetPosition2D: function() { return new Vector2D(); }, | 233| 233| GetRotation: function() { return { "y": 0 }; }, | 234| |- IsInWorld: function() { return true; }, | | 234|+ "IsInWorld": function() { return true; }, | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 235| 235| }); | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| |- GetWalkSpeed: function() { return 1; }, | | 238|+ "GetWalkSpeed": function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToFormationOffset' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 236| 236| | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| |- MoveToFormationOffset: function(target, x, z) { }, | | 239|+ "MoveToFormationOffset": function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 237| 237| AddMock(unit + i, IID_UnitMotion, { | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| |- IsInTargetRange: function(target, min, max) { return true; }, | | 240|+ "IsInTargetRange": function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 238| 238| GetWalkSpeed: function() { return 1; }, | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| |- MoveToTargetRange: function(target, min, max) { }, | | 241|+ "MoveToTargetRange": function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 239| 239| MoveToFormationOffset: function(target, x, z) { }, | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| |- StopMoving: function() { }, | | 242|+ "StopMoving": function() { }, | 243| 243| GetPassabilityClassName: function() { return "default"; }, | 244| 244| }); | 245| 245| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 240| 240| IsInTargetRange: function(target, min, max) { return true; }, | 241| 241| MoveToTargetRange: function(target, min, max) { }, | 242| 242| StopMoving: function() { }, | 243| |- GetPassabilityClassName: function() { return "default"; }, | | 243|+ "GetPassabilityClassName": function() { return "default"; }, | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 244| 244| }); | 245| 245| | 246| 246| AddMock(unit + i, IID_Vision, { | 247| |- GetRange: function() { return 10; }, | | 247|+ "GetRange": function() { return 10; }, | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return { "max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 248| 248| }); | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 251|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 249| 249| | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 252|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 250| 250| AddMock(unit + i, IID_Attack, { | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 253|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 251| 251| GetRange: function() { return {"max":10, "min": 0}; }, | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 254|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 252| 252| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| |- CanAttack: function(v) { return true; }, | | 255|+ "CanAttack": function(v) { return true; }, | 256| 256| CompareEntitiesByPreference: function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 253| 253| GetBestAttackAgainst: function(t) { return "melee"; }, | 254| 254| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 255| 255| CanAttack: function(v) { return true; }, | 256| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 256|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 257| 257| }); | 258| 258| | 259| 259| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 265| 265| | 266| 266| // create enemy | 267| 267| AddMock(enemy, IID_Health, { | 268| |- GetHitpoints: function() { return 40; }, | | 268|+ "GetHitpoints": function() { return 40; }, | 269| 269| }); | 270| 270| | 271| 271| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 268| 268| GetHitpoints: function() { return 40; }, | 269| 269| }); | 270| 270| | 271| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 271|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 272| 272| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 275|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 273| 273| | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 276|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 274| 274| AddMock(controller, IID_Position, { | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 277|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 275| 275| GetTurretParent: function() { return INVALID_ENTITY; }, | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 278|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 276| 276| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| |- GetRotation: function() { return { "y": 0 }; }, | | 279|+ "GetRotation": function() { return { "y": 0 }; }, | 280| 280| IsInWorld: function() { return true; }, | 281| 281| }); | 282| 282| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 277| 277| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 278| 278| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 279| 279| GetRotation: function() { return { "y": 0 }; }, | 280| |- IsInWorld: function() { return true; }, | | 280|+ "IsInWorld": function() { return true; }, | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetWalkSpeed' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 281| 281| }); | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| |- GetWalkSpeed: function() { return 1; }, | | 284|+ "GetWalkSpeed": function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetSpeedMultiplier' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 282| 282| | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| |- SetSpeedMultiplier: function(speed) { }, | | 285|+ "SetSpeedMultiplier": function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'MoveToPointRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 283| 283| AddMock(controller, IID_UnitMotion, { | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| |- MoveToPointRange: function(x, z, minRange, maxRange) { }, | | 286|+ "MoveToPointRange": function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInTargetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 284| 284| GetWalkSpeed: function() { return 1; }, | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| |- IsInTargetRange: function(target, min, max) { return true; }, | | 287|+ "IsInTargetRange": function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | 290| 290| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'StopMoving' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 285| 285| SetSpeedMultiplier: function(speed) { }, | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| |- StopMoving: function() { }, | | 288|+ "StopMoving": function() { }, | 289| 289| GetPassabilityClassName: function() { return "default"; }, | 290| 290| }); | 291| 291| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPassabilityClassName' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 286| 286| MoveToPointRange: function(x, z, minRange, maxRange) { }, | 287| 287| IsInTargetRange: function(target, min, max) { return true; }, | 288| 288| StopMoving: function() { }, | 289| |- GetPassabilityClassName: function() { return "default"; }, | | 289|+ "GetPassabilityClassName": function() { return "default"; }, | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return { "max":10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 290| 290| }); | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 293|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 294| 294| CanAttackAsFormation: function() { return false; }, | 295| 295| }); | 296| 296| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttackAsFormation' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 291| 291| | 292| 292| AddMock(controller, IID_Attack, { | 293| 293| GetRange: function() { return {"max":10, "min": 0}; }, | 294| |- CanAttackAsFormation: function() { return false; }, | | 294|+ "CanAttackAsFormation": function() { return false; }, | 295| 295| }); | 296| 296| | 297| 297| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 303| 303| for (var ent of unitAIs) | 304| 304| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 305| 305| | 306| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 306|+ controllerAI.MoveIntoFormation({ "name": "Circle"}); | 307| 307| | 308| 308| // let all units be in position | 309| 309| for (var ent of unitAIs) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 303| 303| for (var ent of unitAIs) | 304| 304| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 305| 305| | 306| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 306|+ controllerAI.MoveIntoFormation({"name": "Circle" }); | 307| 307| | 308| 308| // let all units be in position | 309| 309| for (var ent of unitAIs) binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| » » ResetActiveQuery:·function(id)·{·if·(mode·==·0)·return·[];·else·return·[enemy];·}, | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Closing curly brace appears on the same line as the subsequent block. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 215| » for·(var·i·=·0;·i·<·unitCount;·i++)·{ | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Opening curly brace appears on the same line as controlling statement. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 309| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 312| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 304| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 313| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 126| 126| this.formationMembersWithAura = []; // Members with a formation aura | 127| 127| this.width = 0; | 128| 128| this.depth = 0; | 129| |- this.oldOrientation = {"sin": 0, "cos": 0}; | | 129|+ this.oldOrientation = { "sin": 0, "cos": 0}; | 130| 130| this.twinFormations = []; | 131| 131| // distance from which two twin formations will merge into one. | 132| 132| this.formationSeparation = 0; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 126| 126| this.formationMembersWithAura = []; // Members with a formation aura | 127| 127| this.width = 0; | 128| 128| this.depth = 0; | 129| |- this.oldOrientation = {"sin": 0, "cos": 0}; | | 129|+ this.oldOrientation = {"sin": 0, "cos": 0 }; | 130| 130| this.twinFormations = []; | 131| 131| // distance from which two twin formations will merge into one. | 132| 132| this.formationSeparation = 0; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 144| 144| | 145| 145| Formation.prototype.GetSize = function() | 146| 146| { | 147| |- return {"width": this.width, "depth": this.depth}; | | 147|+ return { "width": this.width, "depth": this.depth}; | 148| 148| }; | 149| 149| | 150| 150| Formation.prototype.GetSpeedMultiplier = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 144| 144| | 145| 145| Formation.prototype.GetSize = function() | 146| 146| { | 147| |- return {"width": this.width, "depth": this.depth}; | | 147|+ return {"width": this.width, "depth": this.depth }; | 148| 148| }; | 149| 149| | 150| 150| Formation.prototype.GetSpeedMultiplier = function() | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return { "width":1, "depth": 1}; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'width'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return {"width": 1, "depth": 1}; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 563| 563| footprints.push(cmpFootprint.GetShape()); | 564| 564| } | 565| 565| if (!footprints.length) | 566| |- return {"width":1, "depth": 1}; | | 566|+ return {"width":1, "depth": 1 }; | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 565| 565| if (!footprints.length) | 566| 566| return {"width":1, "depth": 1}; | 567| 567| | 568| |- var r = {"width": 0, "depth": 0}; | | 568|+ var r = { "width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | 570| 570| { | 571| 571| if (shape.type == "circle") | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 565| 565| if (!footprints.length) | 566| 566| return {"width":1, "depth": 1}; | 567| 567| | 568| |- var r = {"width": 0, "depth": 0}; | | 568|+ var r = {"width": 0, "depth": 0 }; | 569| 569| for (var shape of footprints) | 570| 570| { | 571| 571| if (shape.type == "circle") | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for-of'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 567| 567| | 568| 568| var r = {"width": 0, "depth": 0}; | 569| 569| for (var shape of footprints) | 570| |- { | | 570|+ | 571| 571| if (shape.type == "circle") | 572| 572| { | 573| 573| r.width += shape.radius * 2; | 578| 578| r.width += shape.width; | 579| 579| r.depth += shape.depth; | 580| 580| } | 581| |- } | | 581|+ | 582| 582| r.width /= footprints.length; | 583| 583| r.depth /= footprints.length; | 584| 584| return r; | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 591| 591| separation.depth *= this.separationMultiplier.depth; | 592| 592| | 593| 593| if (this.columnar) | 594| |- var sortingClasses = ["Cavalry","Infantry"]; | | 594|+ var sortingClasses = ["Cavalry", "Infantry"]; | 595| 595| else | 596| 596| var sortingClasses = this.sortingClasses.slice(); | 597| 597| sortingClasses.push("Unknown"); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 608| 608| var classes = cmpIdentity.GetClassesList(); | 609| 609| var done = false; | 610| 610| for (var c = 0; c < sortingClasses.length; ++c) | 611| |- { | | 611|+ | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| 614| types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | 618| |- } | | 618|+ | 619| 619| if (!done) | 620| 620| types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | 621| 621| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 611| 611| { | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| |- types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | | 614|+ types[sortingClasses[c]].push({ "ent": active[i], "pos": positions[i]}); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 611| 611| { | 612| 612| if (classes.indexOf(sortingClasses[c]) > -1) | 613| 613| { | 614| |- types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i]}); | | 614|+ types[sortingClasses[c]].push({"ent": active[i], "pos": positions[i] }); | 615| 615| done = true; | 616| 616| break; | 617| 617| } | | [NORMAL] ESLintBear (dot-notation): | | ["Unknown"] is better written in dot notation. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types.Unknown.push({"ent": active[i], "pos": positions[i]}); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types["Unknown"].push({ "ent": active[i], "pos": positions[i]}); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 617| 617| } | 618| 618| } | 619| 619| if (!done) | 620| |- types["Unknown"].push({"ent": active[i], "pos": positions[i]}); | | 620|+ types["Unknown"].push({"ent": active[i], "pos": positions[i] }); | 621| 621| } | 622| 622| | 623| 623| var count = active.length; | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 635| 635| if (this.columnar) | 636| 636| { | 637| 637| shape = "square"; | 638| |- cols = Math.min(count,3); | | 638|+ cols = Math.min(count, 3); | 639| 639| shiftRows = false; | 640| 640| centerGap = 0; | 641| 641| sortingOrder = null; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 689| 689| n -= r%2; | 690| 690| } | 691| 691| else if (shape == "triangle") | 692| |- { | | 692|+ | 693| 693| if (shiftRows) | 694| 694| var n = r + 1; | 695| 695| else | 696| 696| var n = r * 2 + 1; | 697| |- } | | 697|+ | 698| 698| if (!shiftRows && n > left) | 699| 699| n = left; | 700| 700| for (var c = 0; c < n && left > 0; ++c) | | [NORMAL] ESLintBear (space-before-function-paren): | | Unexpected space before function parentheses. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 730| 730| // calculating offset distances without a zero average makes no sense, as the formation | 731| 731| // will jump to a different position any time | 732| 732| var avgoffset = Vector2D.average(offsets); | 733| |- offsets.forEach(function (o) {o.sub(avgoffset);}); | | 733|+ offsets.forEach(function(o) {o.sub(avgoffset);}); | 734| 734| | 735| 735| // sort the available places in certain ways | 736| 736| // the places first in the list will contain the heaviest units as defined by the order | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = { "row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'column'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column": offsets[closestOffsetId].column}; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 789| 789| closestOffsetId = i; | 790| 790| } | 791| 791| } | 792| |- this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column}; | | 792|+ this.memberPositions[entPos.ent] = {"row": offsets[closestOffsetId].row, "column":offsets[closestOffsetId].column }; | 793| 793| return closestOffsetId; | 794| 794| }; | 795| 795| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos) | 800| 800| { | 801| 801| var offsetPositions = []; | 802| |- var {sin, cos} = this.GetEstimatedOrientation(pos); | | 802|+ var { sin, cos} = this.GetEstimatedOrientation(pos); | 803| 803| // calculate the world positions | 804| 804| for (var o of offsets) | 805| 805| offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin)); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 799| 799| Formation.prototype.GetRealOffsetPositions = function(offsets, pos) | 800| 800| { | 801| 801| var offsetPositions = []; | 802| |- var {sin, cos} = this.GetEstimatedOrientation(pos); | | 802|+ var {sin, cos } = this.GetEstimatedOrientation(pos); | 803| 803| // calculate the world positions | 804| 804| for (var o of offsets) | 805| 805| offsetPositions.push(new Vector2D(pos.x + o.y * sin + o.x * cos, pos.y + o.y * cos - o.x * sin)); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos) | 817| 817| { | 818| 818| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); | 819| |- var r = {"sin": 0, "cos": 1}; | | 819|+ var r = { "sin": 0, "cos": 1}; | 820| 820| var unitAIState = cmpUnitAI.GetCurrentState(); | 821| 821| if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING") | 822| 822| { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 816| 816| Formation.prototype.GetEstimatedOrientation = function(pos) | 817| 817| { | 818| 818| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); | 819| |- var r = {"sin": 0, "cos": 1}; | | 819|+ var r = {"sin": 0, "cos": 1 }; | 820| 820| var unitAIState = cmpUnitAI.GetCurrentState(); | 821| 821| if (unitAIState == "FORMATIONCONTROLLER.WALKING" || unitAIState == "FORMATIONCONTROLLER.COMBAT.APPROACHING") | 822| 822| { | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Formation.js | 898| 898| cmpOtherFormation.RemoveMembers(otherMembers); | 899| 899| this.AddMembers(otherMembers); | 900| 900| Engine.DestroyEntity(this.twinFormations[i]); | 901| |- this.twinFormations.splice(i,1); | | 901|+ this.twinFormations.splice(i, 1); | 902| 902| } | 903| 903| // Switch between column and box if necessary | 904| 904| var cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI); binaries/data/mods/public/simulation/components/Formation.js | 335| » for·(var·ent·of·this.formationMembersWithAura) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 422| » for·(var·ent·of·this.formationMembersWithAura) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 468| » var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position); | | [NORMAL] JSHintBear: | | 'cmpPosition' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 509| » » var·cmpUnitAI·=·Engine.QueryInterface(offset.ent,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'cmpUnitAI' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 544| » var·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position); | | [NORMAL] JSHintBear: | | 'cmpPosition' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 596| » » var·sortingClasses·=·this.sortingClasses.slice(); | | [NORMAL] JSHintBear: | | 'sortingClasses' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 605| » for·(var·i·in·active) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 620| » » » types["Unknown"].push({"ent":·active[i],·"pos":·positions[i]}); | | [NORMAL] JSHintBear: | | ['Unknown'] is better written in dot notation. binaries/data/mods/public/simulation/components/Formation.js | 660| » » for·(var·i·=·0;·i·<·count;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 694| » » » » » var·n·=·r·+·1; | | [NORMAL] JSHintBear: | | 'n' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 696| » » » » » var·n·=·r·*·2·+·1; | | [NORMAL] JSHintBear: | | 'n' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 700| » » » for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c) | | [NORMAL] JSHintBear: | | 'c' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 707| » » » » » var·x·=·side·*·Math.ceil(c/2)·*·separation.width; | | [NORMAL] JSHintBear: | | 'x' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 710| » » » » » if·(x·==·0)·//·don't·use·the·center·position·with·a·center·gap | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 712| » » » » » x·+=·side·*·centerGap·/·2; | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 718| » » » » offsets.push(new·Vector2D(x·+·r1,·z·+·r2)); | | [NORMAL] JSHintBear: | | 'x' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 698| » » » if·(!shiftRows·&&·n·>·left) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 699| » » » » n·=·left; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 700| » » » for·(var·c·=·0;·c·<·n·&&·left·>·0;·++c) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 704| » » » » if·(n%2·==·0) | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 714| » » » » var·column·=·Math.ceil(n/2)·+·Math.ceil(c/2)·*·side; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 724| » » » this.maxColumnsUsed[r]·=·n; | | [NORMAL] JSHintBear: | | 'n' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 753| » for·(var·i·=·sortingClasses.length;·i;·--i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/Formation.js | 597| » sortingClasses.push("Unknown"); | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 602| » for·(var·i·=·0;·i·<·sortingClasses.length;·++i) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 603| » » types[sortingClasses[i]]·=·[]; | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 610| » » for·(var·c·=·0;·c·<·sortingClasses.length;·++c) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 612| » » » if·(classes.indexOf(sortingClasses[c])·>·-1) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 614| » » » » types[sortingClasses[c]].push({"ent":·active[i],·"pos":·positions[i]}); | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 753| » for·(var·i·=·sortingClasses.length;·i;·--i) | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 755| » » var·t·=·types[sortingClasses[i-1]]; | | [NORMAL] JSHintBear: | | 'sortingClasses' used out of scope. binaries/data/mods/public/simulation/components/Formation.js | 860| » var·cmpUnitMotion·=·Engine.QueryInterface(this.entity,·IID_UnitMotion); | | [NORMAL] JSHintBear: | | 'cmpUnitMotion' is already defined. | | [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 (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 (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 (quote-props): | | Unquoted property 'GetPassabilityClass' found. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | 8| 8| let height = 5; | 9| 9| | 10| 10| AddMock(SYSTEM_ENTITY, IID_Pathfinder, { | 11| |- GetPassabilityClass: (name) => 1 << 8 | | 11|+ "GetPassabilityClass": (name) => 1 << 8 | 12| 12| }); | 13| 13| | 14| 14| let cmpUnitMotionFlying = ConstructComponent(entity, "UnitMotionFlying", { binaries/data/mods/public/simulation/components/tests/test_UnitMotionFlying.js | 45| » "SetHeightFixed":·(y)·=>·height·=·y, | | [NORMAL] ESLintBear (no-return-assign): | | Arrow function should not return assignment. | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 74| 74| var newangle = angle; | 75| 75| var canTurn = true; | 76| 76| if (this.landing) | 77| |- { | | 77|+ | 78| 78| if (this.speed > 0 && this.onGround) | 79| 79| { | 80| 80| if (pos.y <= cmpWaterManager.GetWaterLevel(pos.x, pos.z) && this.template.DiesInWater == "true") | 153| 153| this.waterDeath = true; | 154| 154| } | 155| 155| } | 156| |- } | | 156|+ | 157| 157| else | 158| 158| { | 159| 159| // If we haven't reached max speed yet then we're still on the ground; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 93| 93| pos.y = Math.max(ground, pos.y - turnLength * this.template.ClimbRate); | 94| 94| } | 95| 95| else if (this.speed == 0 && this.onGround) | 96| |- { | | 96|+ | 97| 97| if (this.waterDeath && cmpHealth) | 98| 98| cmpHealth.Kill(); | 99| 99| else | 128| 128| newangle += Math.PI; | 129| 129| } | 130| 130| } | 131| |- } | | 131|+ | 132| 132| else | 133| 133| { | 134| 134| // Final Approach | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 101| 101| this.pitch = 0; | 102| 102| // We've stopped. | 103| 103| if (cmpGarrisonHolder) | 104| |- cmpGarrisonHolder.AllowGarrisoning(true,"UnitMotionFlying"); | | 104|+ cmpGarrisonHolder.AllowGarrisoning(true, "UnitMotionFlying"); | 105| 105| canTurn = false; | 106| 106| this.hasTarget = false; | 107| 107| this.landing = false; | | [NORMAL] ESLintBear (space-unary-ops): | | Unexpected space after unary operator '-'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 138| 138| var targetHeight = ground; | 139| 139| // Steep, then gradual descent. | 140| 140| if ((pos.y - targetHeight) / this.template.FlyingHeight > 1 / SHORT_FINAL) | 141| |- this.pitch = - Math.PI / 18; | | 141|+ this.pitch = -Math.PI / 18; | 142| 142| else | 143| 143| this.pitch = Math.PI / 18; | 144| 144| var descentRate = ((pos.y - targetHeight) / this.template.FlyingHeight * this.template.ClimbRate + SHORT_FINAL) * SHORT_FINAL; | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 155| 155| } | 156| 156| } | 157| 157| else | 158| |- { | | 158|+ | 159| 159| // If we haven't reached max speed yet then we're still on the ground; | 160| 160| // otherwise we're taking off or flying | 161| 161| // this.onGround in case of a go-around after landing (but not fully stopped) | 195| 195| this.pitch = -1 * this.pitch; | 196| 196| } | 197| 197| } | 198| |- } | | 198|+ | 199| 199| | 200| 200| // If we're in range of the target then tell people that we've reached it | 201| 201| // (TODO: quantisation breaks this) | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 163| 163| if (this.speed < this.template.TakeoffSpeed && this.onGround) | 164| 164| { | 165| 165| if (cmpGarrisonHolder) | 166| |- cmpGarrisonHolder.AllowGarrisoning(false,"UnitMotionFlying"); | | 166|+ cmpGarrisonHolder.AllowGarrisoning(false, "UnitMotionFlying"); | 167| 167| this.pitch = 0; | 168| 168| // Accelerate forwards | 169| 169| this.speed = Math.min(this.template.MaxSpeed, this.speed + turnLength * this.template.AccelRate); | | [NORMAL] ESLintBear (space-unary-ops): | | Unexpected space after unary operator '-'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 230| 230| if (newangle - angle > Math.PI / 18) | 231| 231| this.roll = Math.PI / 9; | 232| 232| else if (newangle - angle < -Math.PI / 18) | 233| |- this.roll = - Math.PI / 9; | | 233|+ this.roll = -Math.PI / 9; | 234| 234| else | 235| 235| this.roll = newangle - angle; | 236| 236| } | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 322| 322| UnitMotionFlying.prototype.GetSpeedMultiplier = function() | 323| 323| { | 324| 324| return this.GetCurrentSpeed() / this.GetWalkSpeed(); | 325| |-} | | 325|+}; | 326| 326| | 327| 327| UnitMotionFlying.prototype.GetPassabilityClassName = function() | 328| 328| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 346| 346| | 347| 347| UnitMotionFlying.prototype.StopMoving = function() | 348| 348| { | 349| |- //Invert | | 349|+ // Invert | 350| 350| if (!this.waterDeath) | 351| 351| this.landing = !this.landing; | 352| 352| binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 182| » » » var·targetHeight·=·ground·+·(+this.template.FlyingHeight); | | [NORMAL] JSHintBear: | | 'targetHeight' is already defined. binaries/data/mods/public/simulation/components/UnitMotionFlying.js | 325| } | | [NORMAL] JSHintBear: | | Missing semicolon. | | [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 | 228| 228| // Move a tile outside the building | 229| 229| let range = 4; | 230| 230| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) | 231| |- { | | 231|+ | 232| 232| // We've started walking to the given point | 233| 233| this.SetNextState("INDIVIDUAL.WALKING"); | 234| |- } | | 234|+ | 235| 235| else | 236| 236| { | 237| 237| // 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 | 233| 233| this.SetNextState("INDIVIDUAL.WALKING"); | 234| 234| } | 235| 235| else | 236| |- { | | 236|+ | 237| 237| // We are already at the target, or can't move at all | 238| 238| this.FinishOrder(); | 239| |- } | | 239|+ | 240| 240| }, | 241| 241| | 242| 242| // 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 | 335| 335| | 336| 336| var ok = this.MoveToTarget(this.order.data.target); | 337| 337| if (ok) | 338| |- { | | 338|+ | 339| 339| // We've started walking to the given point | 340| 340| if (this.IsAnimal()) | 341| 341| this.SetNextState("ANIMAL.WALKING"); | 342| 342| else | 343| 343| this.SetNextState("INDIVIDUAL.WALKING"); | 344| |- } | | 344|+ | 345| 345| else | 346| 346| { | 347| 347| // 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 | 363| 363| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 364| 364| if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 365| 365| && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 366| |- { | | 366|+ | 367| 367| // we were already on the shoreline, and have not moved since | 368| 368| if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50) | 369| 369| needToMove = false; | 370| |- } | | 370|+ | 371| 371| | 372| 372| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 373| 373| // 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 | 361| 361| // Check if we need to move TODO implement a better way to know if we are on the shoreline | 362| 362| var needToMove = true; | 363| 363| var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); | 364| |- if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) | 365| |- && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | | 364|+ if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) && | | 365|+ (this.lastShorelinePosition.z == cmpPosition.GetPosition().z)) | 366| 366| { | 367| 367| // we were already on the shoreline, and have not moved since | 368| 368| 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 | 372| 372| // TODO: what if the units are on a cliff ? the ship will go below the cliff | 373| 373| // and the units won't be able to garrison. Should go to the nearest (accessible) shore | 374| 374| if (needToMove && this.MoveToTarget(this.order.data.target)) | 375| |- { | | 375|+ | 376| 376| this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING"); | 377| |- } | | 377|+ | 378| 378| else | 379| 379| { | 380| 380| // 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 | 401| 401| var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance); | 402| 402| var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); | 403| 403| if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1)) | 404| |- { | | 404|+ | 405| 405| // We've started fleeing from the given target | 406| 406| if (this.IsAnimal()) | 407| 407| this.SetNextState("ANIMAL.FLEEING"); | 408| 408| else | 409| 409| this.SetNextState("INDIVIDUAL.FLEEING"); | 410| |- } | | 410|+ | 411| 411| else | 412| 412| { | 413| 413| // We are already at the target, or can't move at all | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 448| 448| } | 449| 449| | 450| 450| if (this.order.data.attackType == this.oldAttackType) | 451| |- { | | 451|+ | 452| 452| if (this.IsAnimal()) | 453| 453| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 454| 454| else | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| |- } | | 456|+ | 457| 457| else | 458| 458| { | 459| 459| if (this.IsAnimal()) | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 455| 455| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 456| 456| } | 457| 457| else | 458| |- { | | 458|+ | 459| 459| if (this.IsAnimal()) | 460| 460| this.SetNextState("ANIMAL.COMBAT.ATTACKING"); | 461| 461| else | 462| 462| this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING"); | 463| |- } | | 463|+ | 464| 464| return; | 465| 465| } | 466| 466| | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'else'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/UnitAI.js | 580| 580| this.PushOrderFront("Walk", this.order.data.lastPos); | 581| 581| } | 582| 582| else | 583| |- { | | 583|+ | 584| 584| // We couldn't move there, or the target moved away | 585| 585| this.FinishOrder(); | 586| |- } | | 586|+ | 587| 587| return; | 588| 588| } | 589| 589| | | [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 | 593| 593| | 594| 594| // Try to move within range | 595| 595| if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer)) | 596| |- { | | 596|+ | 597| 597| // We've started walking to the given point | 598| 598| this.SetNextState("INDIVIDUAL.GATHER.APPROACHING"); | 599| |- } | | 599|+ | 600| 600| else | 601| 601| { | 602| 602| // 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 | 670| 670| "Order.Repair": function(msg) { | 671| 671| // Try to move within range | 672| 672| if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) | 673| |- { | | 673|+ | 674| 674| // We've started walking to the given point | 675| 675| this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING"); | 676| |- } | | 676|+ | 677| 677| else | 678| 678| { | 679| 679| // 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 | 706| 706| } | 707| 707| | 708| 708| if (this.MoveToGarrisonRange(this.order.data.target)) | 709| |- { | | 709|+ | 710| 710| this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING"); | 711| |- } | | 711|+ | 712| 712| else | 713| 713| { | 714| 714| // 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 | 834| 834| if (!this.CheckTargetAttackRange(target, target)) | 835| 835| { | 836| 836| if (this.TargetIsAlive(target) && this.CheckTargetVisible(target)) | 837| |- { | | 837|+ | 838| 838| if (this.MoveToTargetAttackRange(target, target)) | 839| 839| { | 840| 840| this.SetNextState("COMBAT.APPROACHING"); | 841| 841| return; | 842| 842| } | 843| |- } | | 843|+ | 844| 844| this.FinishOrder(); | 845| 845| return; | 846| 846| } | | [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 | 859| 859| } | 860| 860| // Check if we are already in range, otherwise walk there | 861| 861| if (!this.CheckGarrisonRange(msg.data.target)) | 862| |- { | | 862|+ | 863| 863| if (!this.CheckTargetVisible(msg.data.target)) | 864| 864| { | 865| 865| this.FinishOrder(); | 874| 874| return; | 875| 875| } | 876| 876| } | 877| |- } | | 877|+ | 878| 878| | 879| 879| this.SetNextState("GARRISON.GARRISONING"); | 880| 880| }, | | [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 | 866| 866| return; | 867| 867| } | 868| 868| else | 869| |- { | | 869|+ | 870| 870| // Out of range; move there in formation | 871| 871| if (this.MoveToGarrisonRange(msg.data.target)) | 872| 872| { | 873| 873| this.SetNextState("GARRISON.APPROACHING"); | 874| 874| return; | 875| 875| } | 876| |- } | | 876|+ | 877| 877| } | 878| 878| | 879| 879| 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 | 865| 865| this.FinishOrder(); | 866| 866| return; | 867| 867| } | 868| |- else | 869| |- { | | 868|+ | 870| 869| // Out of range; move there in formation | 871| 870| if (this.MoveToGarrisonRange(msg.data.target)) | 872| 871| { | 873| 872| this.SetNextState("GARRISON.APPROACHING"); | 874| 873| return; | 875| 874| } | 876| |- } | | 875|+ | 877| 876| } | 878| 877| | 879| 878| 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 | 892| 892| this.PushOrderFront("Walk", msg.data.lastPos); | 893| 893| } | 894| 894| else | 895| |- { | | 895|+ | 896| 896| // We couldn't move there, or the target moved away | 897| 897| this.FinishOrder(); | 898| |- } | | 898|+ | 899| 899| return; | 900| 900| } | 901| 901| | | [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 |1113|1113| }, |1114|1114| }, |1115|1115| |1116| |- "GARRISON":{ | |1116|+ "GARRISON": { |1117|1117| "enter": function() { |1118|1118| // If the garrisonholder should pickup, warn it so it can take needed action |1119|1119| 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 |1297|1297| // If the controller handled an order but some members rejected it, |1298|1298| // they will have no orders and be in the FORMATIONMEMBER.IDLE state. |1299|1299| if (this.orderQueue.length) |1300| |- { | |1300|+ |1301|1301| // We're leaving the formation, so stop our FormationWalk order |1302|1302| if (this.FinishOrder()) |1303|1303| return; |1304| |- } | |1304|+ |1305|1305| |1306|1306| // No orders left, we're an individual now |1307|1307| 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 |1325|1325| // Move a tile outside the building |1326|1326| let range = 4; |1327|1327| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |1328| |- { | |1328|+ |1329|1329| // We've started walking to the given point |1330|1330| this.SetNextState("WALKINGTOPOINT"); |1331| |- } | |1331|+ |1332|1332| else |1333|1333| { |1334|1334| // 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 |1330|1330| this.SetNextState("WALKINGTOPOINT"); |1331|1331| } |1332|1332| else |1333| |- { | |1333|+ |1334|1334| // We are already at the target, or can't move at all |1335|1335| this.FinishOrder(); |1336| |- } | |1336|+ |1337|1337| }, |1338|1338| |1339|1339| | | [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 |1531|1531| |1532|1532| "LosRangeUpdate": function(msg) { |1533|1533| if (this.GetStance().targetVisibleEnemies) |1534| |- { | |1534|+ |1535|1535| // Start attacking one of the newly-seen enemy (if any) |1536|1536| this.AttackEntitiesByPreference(msg.data.added); |1537| |- } | |1537|+ |1538|1538| }, |1539|1539| |1540|1540| "LosHealRangeUpdate": 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 |1717|1717| // if nothing better to do, check if the guarded needs to be healed or repaired |1718|1718| var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health); |1719|1719| if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints())) |1720| |- { | |1720|+ |1721|1721| if (this.CanHeal(this.isGuardOf)) |1722|1722| this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false }); |1723|1723| else if (this.CanRepair(this.isGuardOf)) |1724|1724| this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false }); |1725| |- } | |1725|+ |1726|1726| } |1727|1727| }, |1728|1728| | | [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 |1802|1802| "MoveCompleted": function() { |1803|1803| |1804|1804| if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1805| |- { | |1805|+ |1806|1806| // If the unit needs to unpack, do so |1807|1807| if (this.CanUnpack()) |1808|1808| { |1811|1811| } |1812|1812| else |1813|1813| this.SetNextState("ATTACKING"); |1814| |- } | |1814|+ |1815|1815| else |1816|1816| { |1817|1817| 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 |1809|1809| this.PushOrderFront("Unpack", { "force": true }); |1810|1810| return; |1811|1811| } |1812| |- else |1813| |- this.SetNextState("ATTACKING"); | |1812|+ this.SetNextState("ATTACKING"); |1814|1813| } |1815|1814| else |1816|1815| { | | [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 |1813|1813| this.SetNextState("ATTACKING"); |1814|1814| } |1815|1815| else |1816| |- { | |1816|+ |1817|1817| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1818|1818| { |1819|1819| this.SetNextState("APPROACHING"); |1823|1823| // Give up |1824|1824| this.FinishOrder(); |1825|1825| } |1826| |- } | |1826|+ |1827|1827| }, |1828|1828| }, |1829|1829| | | [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 |1815|1815| else |1816|1816| { |1817|1817| if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType)) |1818| |- { | |1818|+ |1819|1819| this.SetNextState("APPROACHING"); |1820| |- } | |1820|+ |1821|1821| else |1822|1822| { |1823|1823| // 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 |1819|1819| this.SetNextState("APPROACHING"); |1820|1820| } |1821|1821| else |1822| |- { | |1822|+ |1823|1823| // Give up |1824|1824| this.FinishOrder(); |1825| |- } | |1825|+ |1826|1826| } |1827|1827| }, |1828|1828| }, | | [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 |1840|1840| } |1841|1841| // Check the target is still alive and attackable |1842|1842| if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType)) |1843| |- { | |1843|+ |1844|1844| // Can't reach it - try to chase after it |1845|1845| if (this.ShouldChaseTargetedEntity(target, this.order.data.force)) |1846|1846| { |1855|1855| return; |1856|1856| } |1857|1857| } |1858| |- } | |1858|+ |1859|1859| |1860|1860| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |1861|1861| this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType); | | [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 |1886|1886| // TODO: we should probably only bother syncing projectile attacks, not melee |1887|1887| |1888|1888| // If using a non-default prepare time, re-sync the animation when the timer runs. |1889| |- this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false; | |1889|+ this.resyncAnimation = (prepare != this.attackTimers.prepare); |1890|1890| |1891|1891| this.FaceTowardsTarget(this.order.data.target); |1892|1892| | | [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 |2015|2015| |2016|2016| "Attacked": function(msg) { |2017|2017| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2018| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2019| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2018|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2019|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2020|2020| this.RespondToTargetedEntities([msg.data.attacker]); |2021|2021| }, |2022|2022| }, | | [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 |2029|2029| this.SelectAnimation("move"); |2030|2030| var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI); |2031|2031| if (cmpUnitAI && cmpUnitAI.IsFleeing()) |2032| |- { | |2032|+ |2033|2033| // Run after a fleeing target |2034|2034| this.SetSpeedMultiplier(this.GetRunMultiplier()); |2035| |- } | |2035|+ |2036|2036| this.StartTimer(1000, 1000); |2037|2037| }, |2038|2038| | | [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 |2090|2090| // Also don't switch to a different type of huntable animal |2091|2091| var nearby = this.FindNearbyResource(function(ent, type, template) { |2092|2092| return ( |2093| |- ent != oldTarget |2094| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2093|+ ent != oldTarget && | |2094|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2095|2095| || (type.specific == oldType.specific |2096|2096| && (type.specific != "meat" || oldTemplate == template))) |2097|2097| ); | | [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 |2091|2091| var nearby = this.FindNearbyResource(function(ent, type, template) { |2092|2092| return ( |2093|2093| ent != oldTarget |2094| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2095| |- || (type.specific == oldType.specific | |2094|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2095|+ (type.specific == oldType.specific |2096|2096| && (type.specific != "meat" || oldTemplate == template))) |2097|2097| ); |2098|2098| }, 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 |2092|2092| return ( |2093|2093| ent != oldTarget |2094|2094| && ((type.generic == "treasure" && oldType.generic == "treasure") |2095| |- || (type.specific == oldType.specific |2096| |- && (type.specific != "meat" || oldTemplate == template))) | |2095|+ || (type.specific == oldType.specific && | |2096|+ (type.specific != "meat" || oldTemplate == template))) |2097|2097| ); |2098|2098| }, oldTarget); |2099|2099| 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 |2101|2101| this.PerformGather(nearby, false, false); |2102|2102| return true; |2103|2103| } |2104| |- else |2105| |- { | |2104|+ |2106|2105| // It's probably better in this case, to avoid units getting stuck around a dropsite |2107|2106| // in a "Target is far away, full, nearby are no good resources, return to dropsite" loop |2108|2107| // to order it to GatherNear the resource position. |2123|2122| return true; |2124|2123| } |2125|2124| } |2126| |- } | |2125|+ |2127|2126| return true; |2128|2127| } |2129|2128| 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 |2113|2113| this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate); |2114|2114| return true; |2115|2115| } |2116| |- else |2117| |- { | |2116|+ |2118|2117| // we're kind of stuck here. Return resource. |2119|2118| var nearby = this.FindNearestDropsite(oldType.generic); |2120|2119| if (nearby) |2122|2121| this.PushOrderFront("ReturnResource", { "target": nearby, "force": false }); |2123|2122| return true; |2124|2123| } |2125| |- } | |2124|+ |2126|2125| } |2127|2126| return true; |2128|2127| } | | [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 |2155|2155| // Also don't switch to a different type of huntable animal |2156|2156| var nearby = this.FindNearbyResource(function(ent, type, template) { |2157|2157| return ( |2158| |- ent != oldTarget |2159| |- && ((type.generic == "treasure" && oldType.generic == "treasure") | |2158|+ ent != oldTarget && | |2159|+ ((type.generic == "treasure" && oldType.generic == "treasure") |2160|2160| || (type.specific == oldType.specific |2161|2161| && (type.specific != "meat" || oldTemplate == template))) |2162|2162| ); | | [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 |2156|2156| var nearby = this.FindNearbyResource(function(ent, type, template) { |2157|2157| return ( |2158|2158| ent != oldTarget |2159| |- && ((type.generic == "treasure" && oldType.generic == "treasure") |2160| |- || (type.specific == oldType.specific | |2159|+ && ((type.generic == "treasure" && oldType.generic == "treasure") || | |2160|+ (type.specific == oldType.specific |2161|2161| && (type.specific != "meat" || oldTemplate == template))) |2162|2162| ); |2163|2163| }); | | [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 |2157|2157| return ( |2158|2158| ent != oldTarget |2159|2159| && ((type.generic == "treasure" && oldType.generic == "treasure") |2160| |- || (type.specific == oldType.specific |2161| |- && (type.specific != "meat" || oldTemplate == template))) | |2160|+ || (type.specific == oldType.specific && | |2161|+ (type.specific != "meat" || oldTemplate == template))) |2162|2162| ); |2163|2163| }); |2164|2164| if (nearby) | | [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 |2202|2202| // Also don't switch to a different type of huntable animal |2203|2203| var nearby = this.FindNearbyResource(function(ent, type, template) { |2204|2204| return ( |2205| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2206| |- || (type.specific == resourceType.specific | |2205|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2206|+ (type.specific == resourceType.specific |2207|2207| && (type.specific != "meat" || resourceTemplate == template)) |2208|2208| ); |2209|2209| }); | | [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 |2203|2203| var nearby = this.FindNearbyResource(function(ent, type, template) { |2204|2204| return ( |2205|2205| (type.generic == "treasure" && resourceType.generic == "treasure") |2206| |- || (type.specific == resourceType.specific |2207| |- && (type.specific != "meat" || resourceTemplate == template)) | |2206|+ || (type.specific == resourceType.specific && | |2207|+ (type.specific != "meat" || resourceTemplate == template)) |2208|2208| ); |2209|2209| }); |2210|2210| | | [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 |2319|2319| |2320|2320| var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply); |2321|2321| if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity)) |2322| |- { | |2322|+ |2323|2323| // Check we can still reach and gather from the target |2324|2324| if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget)) |2325|2325| { |2385|2385| return; |2386|2386| } |2387|2387| } |2388| |- } | |2388|+ |2389|2389| |2390|2390| // We're already in range, can't get anywhere near it or the target is exhausted. |2391|2391| | | [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 |2411|2411| // Also don't switch to a different type of huntable animal |2412|2412| var nearby = this.FindNearbyResource(function(ent, type, template) { |2413|2413| return ( |2414| |- (type.generic == "treasure" && resourceType.generic == "treasure") |2415| |- || (type.specific == resourceType.specific | |2414|+ (type.generic == "treasure" && resourceType.generic == "treasure") || | |2415|+ (type.specific == resourceType.specific |2416|2416| && (type.specific != "meat" || resourceTemplate == template)) |2417|2417| ); |2418|2418| }); | | [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 |2412|2412| var nearby = this.FindNearbyResource(function(ent, type, template) { |2413|2413| return ( |2414|2414| (type.generic == "treasure" && resourceType.generic == "treasure") |2415| |- || (type.specific == resourceType.specific |2416| |- && (type.specific != "meat" || resourceTemplate == template)) | |2415|+ || (type.specific == resourceType.specific && | |2416|+ (type.specific != "meat" || resourceTemplate == template)) |2417|2417| ); |2418|2418| }); |2419|2419| if (nearby) | | [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 |2499|2499| this.StartTimer(prepare, this.healTimers.repeat); |2500|2500| |2501|2501| // If using a non-default prepare time, re-sync the animation when the timer runs. |2502| |- this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false; | |2502|+ this.resyncAnimation = (prepare != this.healTimers.prepare); |2503|2503| |2504|2504| this.FaceTowardsTarget(this.order.data.target); |2505|2505| }, | | [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 |2714|2714| { |2715|2715| // The building was already finished/fully repaired before we arrived; |2716|2716| // let the ConstructionFinished handler handle this. |2717| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2717|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2718|2718| return true; |2719|2719| } |2720|2720| | | [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 |2714|2714| { |2715|2715| // The building was already finished/fully repaired before we arrived; |2716|2716| // let the ConstructionFinished handler handle this. |2717| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2717|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2718|2718| return true; |2719|2719| } |2720|2720| | | [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 |2754|2754| if (this.MoveToTargetRange(this.repairTarget, IID_Builder)) |2755|2755| this.SetNextState("APPROACHING"); |2756|2756| else if (!this.CheckTargetRange(this.repairTarget, IID_Builder)) |2757| |- this.FinishOrder(); //can't approach and isn't in reach | |2757|+ this.FinishOrder(); // can't approach and isn't in reach |2758|2758| }, |2759|2759| }, |2760|2760| | | [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 |2841|2841| |2842|2842| // Unit was approaching and there's nothing to do now, so switch to walking |2843|2843| if (oldState === "INDIVIDUAL.REPAIR.APPROACHING") |2844| |- { | |2844|+ |2845|2845| // We're already walking to the given point, so add this as a order. |2846|2846| this.WalkToTarget(msg.data.newentity, true); |2847| |- } | |2847|+ |2848|2848| }, |2849|2849| }, |2850|2850| | | [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 |2894|2894| |2895|2895| // Check that we can garrison here |2896|2896| if (this.CanGarrison(target)) |2897| |- { | |2897|+ |2898|2898| // Check that we're in range of the garrison target |2899|2899| if (this.CheckGarrisonRange(target)) |2900|2900| { |2970|2970| return false; |2971|2971| } |2972|2972| } |2973| |- } | |2973|+ |2974|2974| // Garrisoning failed for some reason, so finish the order |2975|2975| this.FinishOrder(); |2976|2976| 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 |3077|3077| "Attacked": function(msg) { |3078|3078| if (this.template.NaturalBehaviour == "skittish" || |3079|3079| this.template.NaturalBehaviour == "passive") |3080| |- { | |3080|+ |3081|3081| this.Flee(msg.data.attacker, false); |3082| |- } | |3082|+ |3083|3083| else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive") |3084|3084| { |3085|3085| 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 |3086|3086| this.Attack(msg.data.attacker, false); |3087|3087| } |3088|3088| else if (this.template.NaturalBehaviour == "domestic") |3089| |- { | |3089|+ |3090|3090| // Never flee, stop what we were doing |3091|3091| this.SetNextState("IDLE"); |3092| |- } | |3092|+ |3093|3093| }, |3094|3094| |3095|3095| "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 |3096|3096| // Move a tile outside the building |3097|3097| var range = 4; |3098|3098| if (this.MoveToTargetRangeExplicit(msg.data.target, range, range)) |3099| |- { | |3099|+ |3100|3100| // We've started walking to the given point |3101|3101| this.SetNextState("WALKING"); |3102| |- } | |3102|+ |3103|3103| else |3104|3104| { |3105|3105| // 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 |3101|3101| this.SetNextState("WALKING"); |3102|3102| } |3103|3103| else |3104| |- { | |3104|+ |3105|3105| // We are already at the target, or can't move at all |3106|3106| this.FinishOrder(); |3107| |- } | |3107|+ |3108|3108| }, |3109|3109| |3110|3110| "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 |3143|3143| } |3144|3144| // Start attacking one of the newly-seen enemy (if any) |3145|3145| else if (this.IsDangerousAnimal()) |3146| |- { | |3146|+ |3147|3147| this.AttackVisibleEntity(msg.data.added); |3148| |- } | |3148|+ |3149|3149| |3150|3150| // TODO: if two units enter our range together, we'll attack the |3151|3151| // 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 |3186|3186| } |3187|3187| // Start attacking one of the newly-seen enemy (if any) |3188|3188| else if (this.template.NaturalBehaviour == "violent") |3189| |- { | |3189|+ |3190|3190| this.AttackVisibleEntity(msg.data.added); |3191| |- } | |3191|+ |3192|3192| }, |3193|3193| |3194|3194| "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 |3203|3203| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3204|3204| |3205|3205| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3206| |- // only used for domestic animals | |3206|+ // only used for domestic animals |3207|3207| }, |3208|3208| }; |3209|3209| | | [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 |3260|3260| |3261|3261| UnitAI.prototype.IsAnimal = function() |3262|3262| { |3263| |- return (this.template.NaturalBehaviour ? true : false); | |3263|+ return (!!this.template.NaturalBehaviour); |3264|3264| }; |3265|3265| |3266|3266| 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 |3298|3298| UnitAI.prototype.GetGarrisonHolder = function() |3299|3299| { |3300|3300| if (this.IsGarrisoned()) |3301| |- { | |3301|+ |3302|3302| for (let order of this.orderQueue) |3303|3303| if (order.type == "Garrison") |3304|3304| return order.data.target; |3305| |- } | |3305|+ |3306|3306| return INVALID_ENTITY; |3307|3307| }; |3308|3308| | | [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 |3376|3376| { |3377|3377| let index = this.GetCurrentState().indexOf("."); |3378|3378| if (index != -1) |3379| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3379|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3380|3380| this.Stop(false); |3381|3381| } |3382|3382| | | [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 |3432|3432| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3433|3433| continue; |3434|3434| if (i == 0) |3435| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3435|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3436|3436| else |3437|3437| this.orderQueue.splice(i, 1); |3438|3438| 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 |3432|3432| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3433|3433| continue; |3434|3434| if (i == 0) |3435| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3435|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3436|3436| else |3437|3437| this.orderQueue.splice(i, 1); |3438|3438| 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 |3516|3516| }; |3517|3517| |3518|3518| |3519| |-//// FSM linkage functions //// | |3519|+// // FSM linkage functions //// |3520|3520| |3521|3521| // Setting the next state to the current state will leave/re-enter the top-most substate. |3522|3522| UnitAI.prototype.SetNextState = function(state) | | [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 |3688|3688| continue; |3689|3689| if (this.orderQueue[i].type == type) |3690|3690| continue; |3691| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3691|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3692|3692| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3693|3693| return; |3694|3694| } | | [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 |3688|3688| continue; |3689|3689| if (this.orderQueue[i].type == type) |3690|3690| continue; |3691| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3691|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3692|3692| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3693|3693| return; |3694|3694| } | | [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 |3702|3702| { |3703|3703| // Remember the previous work orders to be able to go back to them later if required |3704|3704| if (data && data.force) |3705| |- { | |3705|+ |3706|3706| if (this.IsFormationController()) |3707|3707| this.CallMemberFunction("UpdateWorkOrders", [type]); |3708|3708| else |3709|3709| this.UpdateWorkOrders(type); |3710| |- } | |3710|+ |3711|3711| |3712|3712| let garrisonHolder = this.IsGarrisoned() && type != "Ungarrison" ? this.GetGarrisonHolder() : null; |3713|3713| | | [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 |3779|3779| { |3780|3780| var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |3781|3781| if (cmpUnitAI) |3782| |- { | |3782|+ |3783|3783| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3784|3784| { |3785|3785| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3788|3788| return; |3789|3789| } |3790|3790| } |3791| |- } | |3791|+ |3792|3792| } |3793|3793| |3794|3794| // 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 |3781|3781| if (cmpUnitAI) |3782|3782| { |3783|3783| for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i) |3784| |- { | |3784|+ |3785|3785| if (isWorkType(cmpUnitAI.orderQueue[i].type)) |3786|3786| { |3787|3787| this.workOrders = cmpUnitAI.orderQueue.slice(i); |3788|3788| return; |3789|3789| } |3790| |- } | |3790|+ |3791|3791| } |3792|3792| } |3793|3793| | | [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 |3793|3793| |3794|3794| // If nothing found, take the unit orders |3795|3795| for (var i = 0; i < this.orderQueue.length; ++i) |3796| |- { | |3796|+ |3797|3797| if (isWorkType(this.orderQueue[i].type)) |3798|3798| { |3799|3799| this.workOrders = this.orderQueue.slice(i); |3800|3800| return; |3801|3801| } |3802| |- } | |3802|+ |3803|3803| }; |3804|3804| |3805|3805| 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 |3859|3859| if (data.timerRepeat === undefined) |3860|3860| this.timer = undefined; |3861|3861| |3862| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3862|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3863|3863| }; |3864|3864| |3865|3865| /** | | [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 |3859|3859| if (data.timerRepeat === undefined) |3860|3860| this.timer = undefined; |3861|3861| |3862| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3862|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3863|3863| }; |3864|3864| |3865|3865| /** | | [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 |3894|3894| this.timer = undefined; |3895|3895| }; |3896|3896| |3897| |-//// Message handlers ///// | |3897|+// // Message handlers ///// |3898|3898| |3899|3899| UnitAI.prototype.OnMotionChanged = function(msg) |3900|3900| { | | [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| UnitAI.prototype.OnMotionChanged = function(msg) |3900|3900| { |3901|3901| if (msg.starting && !msg.error) |3902| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3902|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveStarted", "data": msg}); |3903|3903| else if (!msg.starting || msg.error) |3904|3904| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |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| UnitAI.prototype.OnMotionChanged = function(msg) |3900|3900| { |3901|3901| if (msg.starting && !msg.error) |3902| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); | |3902|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg }); |3903|3903| else if (!msg.starting || msg.error) |3904|3904| this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); |3905|3905| }; | | [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 |3901|3901| if (msg.starting && !msg.error) |3902|3902| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3903|3903| else if (!msg.starting || msg.error) |3904| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3904|+ this.UnitFsm.ProcessMessage(this, { "type": "MoveCompleted", "data": msg}); |3905|3905| }; |3906|3906| |3907|3907| 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 |3901|3901| if (msg.starting && !msg.error) |3902|3902| this.UnitFsm.ProcessMessage(this, {"type": "MoveStarted", "data": msg}); |3903|3903| else if (!msg.starting || msg.error) |3904| |- this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg}); | |3904|+ this.UnitFsm.ProcessMessage(this, {"type": "MoveCompleted", "data": msg }); |3905|3905| }; |3906|3906| |3907|3907| 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 |3909|3909| // TODO: This is a bit inefficient since every unit listens to every |3910|3910| // construction message - ideally we could scope it to only the one we're building |3911|3911| |3912| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3912|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3913|3913| }; |3914|3914| |3915|3915| 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 |3909|3909| // TODO: This is a bit inefficient since every unit listens to every |3910|3910| // construction message - ideally we could scope it to only the one we're building |3911|3911| |3912| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3912|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3913|3913| }; |3914|3914| |3915|3915| 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 |3934|3934| |3935|3935| UnitAI.prototype.OnAttacked = function(msg) |3936|3936| { |3937| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3937|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3938|3938| }; |3939|3939| |3940|3940| 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 |3934|3934| |3935|3935| UnitAI.prototype.OnAttacked = function(msg) |3936|3936| { |3937| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3937|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3938|3938| }; |3939|3939| |3940|3940| 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 |3939|3939| |3940|3940| UnitAI.prototype.OnGuardedAttacked = function(msg) |3941|3941| { |3942| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3942|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3943|3943| }; |3944|3944| |3945|3945| 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 |3939|3939| |3940|3940| UnitAI.prototype.OnGuardedAttacked = function(msg) |3941|3941| { |3942| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3942|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3943|3943| }; |3944|3944| |3945|3945| 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 |3944|3944| |3945|3945| UnitAI.prototype.OnHealthChanged = function(msg) |3946|3946| { |3947| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3947|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3948|3948| }; |3949|3949| |3950|3950| 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 |3944|3944| |3945|3945| UnitAI.prototype.OnHealthChanged = function(msg) |3946|3946| { |3947| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3947|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3948|3948| }; |3949|3949| |3950|3950| 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 |3950|3950| UnitAI.prototype.OnRangeUpdate = function(msg) |3951|3951| { |3952|3952| if (msg.tag == this.losRangeQuery) |3953| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3953|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3954|3954| else if (msg.tag == this.losHealRangeQuery) |3955|3955| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3956|3956| }; | | [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 |3950|3950| UnitAI.prototype.OnRangeUpdate = function(msg) |3951|3951| { |3952|3952| if (msg.tag == this.losRangeQuery) |3953| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3953|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3954|3954| else if (msg.tag == this.losHealRangeQuery) |3955|3955| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3956|3956| }; | | [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 |3952|3952| if (msg.tag == this.losRangeQuery) |3953|3953| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3954|3954| else if (msg.tag == this.losHealRangeQuery) |3955| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3955|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3956|3956| }; |3957|3957| |3958|3958| 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 |3952|3952| if (msg.tag == this.losRangeQuery) |3953|3953| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3954|3954| else if (msg.tag == this.losHealRangeQuery) |3955| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3955|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3956|3956| }; |3957|3957| |3958|3958| 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 |3957|3957| |3958|3958| UnitAI.prototype.OnPackFinished = function(msg) |3959|3959| { |3960| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3960|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3961|3961| }; |3962|3962| |3963|3963| //// 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 |3957|3957| |3958|3958| UnitAI.prototype.OnPackFinished = function(msg) |3959|3959| { |3960| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3960|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3961|3961| }; |3962|3962| |3963|3963| //// 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 |3960|3960| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3961|3961| }; |3962|3962| |3963| |-//// Helper functions to be called by the FSM //// | |3963|+// // Helper functions to be called by the FSM //// |3964|3964| |3965|3965| UnitAI.prototype.GetWalkSpeed = function() |3966|3966| { | | [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 |4062|4062| if (!cmpOwnership || cmpOwnership.GetOwner() == INVALID_PLAYER) |4063|4063| return undefined; |4064|4064| |4065| |- let cmpPosition = Engine.QueryInterface(this.entity, IID_Position) | |4065|+ let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); |4066|4066| if (!cmpPosition || !cmpPosition.IsInWorld()) |4067|4067| return undefined; |4068|4068| | | [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 |4147|4147| PlaySound(name, member); |4148|4148| } |4149|4149| else |4150| |- { | |4150|+ |4151|4151| // Otherwise use our own sounds |4152|4152| PlaySound(name, this.entity); |4153| |- } | |4153|+ |4154|4154| }; |4155|4155| |4156|4156| /* | | [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 |4316|4316| else |4317|4317| // return false? Or hope you come close enough? |4318|4318| var parabolicMaxRange = 0; |4319| |- //return false; | |4319|+ // return false; |4320|4320| |4321|4321| // the parabole changes while walking, take something in the middle |4322|4322| 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 |4381|4381| if (this.IsFormationMember()) |4382|4382| { |4383|4383| var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI); |4384| |- if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() |4385| |- && cmpFormationUnitAI.order.data.target == target) | |4384|+ if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() && | |4385|+ cmpFormationUnitAI.order.data.target == target) |4386|4386| return true; |4387|4387| } |4388|4388| | | [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 |4549|4549| UnitAI.prototype.AttackEntityInZone = function(ents) |4550|4550| { |4551|4551| var target = ents.find(target => |4552| |- this.CanAttack(target) |4553| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4552|+ this.CanAttack(target) && | |4553|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4554|4554| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4555|4555| ); |4556|4556| 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 |4550|4550| { |4551|4551| var target = ents.find(target => |4552|4552| this.CanAttack(target) |4553| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4554| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4553|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4554|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4555|4555| ); |4556|4556| if (!target) |4557|4557| 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 |4614|4614| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4615|4615| if (this.isGuardOf) |4616|4616| { |4617| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4617|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4618|4618| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4619|4619| if (cmpUnitAI && cmpAttack && |4620|4620| 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 |4618|4618| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4619|4619| if (cmpUnitAI && cmpAttack && |4620|4620| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4621| |- return false; | |4621|+ return false; |4622|4622| } |4623|4623| |4624|4624| // 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 |4623|4623| |4624|4624| // Stop if we're in hold-ground mode and it's too far from the holding point |4625|4625| if (this.GetStance().respondHoldGround) |4626| |- { | |4626|+ |4627|4627| if (!this.CheckTargetDistanceFromHeldPosition(target, iid, type)) |4628|4628| return true; |4629| |- } | |4629|+ |4630|4630| |4631|4631| // Stop if it's left our vision range, unless we're especially persistent |4632|4632| 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 |4630|4630| |4631|4631| // Stop if it's left our vision range, unless we're especially persistent |4632|4632| if (!this.GetStance().respondChaseBeyondVision) |4633| |- { | |4633|+ |4634|4634| if (!this.CheckTargetIsInVisionRange(target)) |4635|4635| return true; |4636| |- } | |4636|+ |4637|4637| |4638|4638| // (Note that CCmpUnitMotion will detect if the target is lost in FoW, |4639|4639| // 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 |4656|4656| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4657|4657| if (this.isGuardOf) |4658|4658| { |4659| |- let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4659|+ let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4660|4660| let cmpAttack = Engine.QueryInterface(target, IID_Attack); |4661|4661| if (cmpUnitAI && cmpAttack && |4662|4662| 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 |4669|4669| return false; |4670|4670| }; |4671|4671| |4672| |-//// External interface functions //// | |4672|+// // External interface functions //// |4673|4673| |4674|4674| UnitAI.prototype.SetFormationController = function(ent) |4675|4675| { | | [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 |4679|4679| // of our own formation (or ourself if not in formation) |4680|4680| var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); |4681|4681| if (cmpObstruction) |4682| |- { | |4682|+ |4683|4683| if (ent == INVALID_ENTITY) |4684|4684| cmpObstruction.SetControlGroup(this.entity); |4685|4685| else |4686|4686| cmpObstruction.SetControlGroup(ent); |4687| |- } | |4687|+ |4688|4688| |4689|4689| // If we were removed from a formation, let the FSM switch back to INDIVIDUAL |4690|4690| 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 |4822|4822| // if we already had an old guard order, do nothing if the target is the same |4823|4823| // and the order is running, otherwise remove the previous order |4824|4824| if (this.isGuardOf) |4825| |- { | |4825|+ |4826|4826| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4827|4827| return; |4828|4828| else |4829|4829| this.RemoveGuard(); |4830| |- } | |4830|+ |4831|4831| |4832|4832| this.AddOrder("Guard", { "target": target, "force": false }, queued); |4833|4833| }; | | [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 |4825|4825| { |4826|4826| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4827|4827| return; |4828| |- else |4829| |- this.RemoveGuard(); | |4828|+ this.RemoveGuard(); |4830|4829| } |4831|4830| |4832|4831| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [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 |4996|4996| this.WalkToTarget(target, queued); |4997|4997| return; |4998|4998| } |4999| |- this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture}, queued); | |4999|+ this.AddOrder("Attack", { "target": target, "force": true, "allowCapture": allowCapture }, queued); |5000|5000| }; |5001|5001| |5002|5002| /** | | [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 |5145|5145| this.workOrders.length && this.workOrders[0].type == "Trade") |5146|5146| { |5147|5147| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5148| |- if (cmpTrader.HasBothMarkets() && | |5148|+ if (cmpTrader.HasBothMarkets() && |5149|5149| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5150|5150| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5151|5151| { | | [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 |5426|5426| { |5427|5427| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5428|5428| var targetClasses = this.order.data.targetClasses; |5429| |- if (targetClasses.attack && cmpIdentity |5430| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5429|+ if (targetClasses.attack && cmpIdentity && | |5430|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5431|5431| continue; |5432|5432| if (targetClasses.avoid && cmpIdentity |5433|5433| && 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 |5429|5429| if (targetClasses.attack && cmpIdentity |5430|5430| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5431|5431| continue; |5432| |- if (targetClasses.avoid && cmpIdentity |5433| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5432|+ if (targetClasses.avoid && cmpIdentity && | |5433|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5434|5434| continue; |5435|5435| // Only used by the AIs to prevent some choices of targets |5436|5436| 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 |5452|5452| { |5453|5453| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5454|5454| var targetClasses = this.order.data.targetClasses; |5455| |- if (cmpIdentity && targetClasses.attack |5456| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5455|+ if (cmpIdentity && targetClasses.attack && | |5456|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5457|5457| continue; |5458|5458| if (cmpIdentity && targetClasses.avoid |5459|5459| && 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 |5455|5455| if (cmpIdentity && targetClasses.attack |5456|5456| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5457|5457| continue; |5458| |- if (cmpIdentity && targetClasses.avoid |5459| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5458|+ if (cmpIdentity && targetClasses.avoid && | |5459|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5460|5460| continue; |5461|5461| // Only used by the AIs to prevent some choices of targets |5462|5462| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [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 |5598|5598| |5599|5599| UnitAI.prototype.SetHeldPosition = function(x, z) |5600|5600| { |5601| |- this.heldPosition = {"x": x, "z": z}; | |5601|+ this.heldPosition = { "x": x, "z": z}; |5602|5602| }; |5603|5603| |5604|5604| 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 |5598|5598| |5599|5599| UnitAI.prototype.SetHeldPosition = function(x, z) |5600|5600| { |5601| |- this.heldPosition = {"x": x, "z": z}; | |5601|+ this.heldPosition = {"x": x, "z": z }; |5602|5602| }; |5603|5603| |5604|5604| 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 |5625|5625| return false; |5626|5626| }; |5627|5627| |5628| |-//// Helper functions //// | |5628|+// // Helper functions //// |5629|5629| |5630|5630| UnitAI.prototype.CanAttack = function(target) |5631|5631| { | | [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 |5829|5829| return cmpPack && cmpPack.IsPacking(); |5830|5830| }; |5831|5831| |5832| |-//// Formation specific functions //// | |5832|+// // Formation specific functions //// |5833|5833| |5834|5834| UnitAI.prototype.IsAttackingAsFormation = function() |5835|5835| { | | [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 |5834|5834| UnitAI.prototype.IsAttackingAsFormation = function() |5835|5835| { |5836|5836| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5837| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5838| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5837|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5838|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5839|5839| }; |5840|5840| |5841|5841| //// 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 |5838|5838| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5839|5839| }; |5840|5840| |5841| |-//// Animal specific functions //// | |5841|+// // Animal specific functions //// |5842|5842| |5843|5843| UnitAI.prototype.MoveRandomly = function(distance) |5844|5844| { binaries/data/mods/public/simulation/components/UnitAI.js |2401| » » » » » » 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 |3764| » 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 |4536| » 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 |4551| » 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 |4597| » 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 |4620| » » ····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 |5076| » 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 | 365| » » ····&&·(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 |1878| » » » » » » var·cmpFormation·=·Engine.QueryInterface(this.formationController,·IID_Formation); | | [NORMAL] JSHintBear: | | 'cmpFormation' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2019| » » » » » » &&·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 |2094| » » » » » » » » ·&&·((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 |2095| » » » » » » » » ·||·(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 |2096| » » » » » » » » ·&&·(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 |2119| » » » » » » » » var·nearby·=·this.FindNearestDropsite(oldType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2159| » » » » » » » » &&·((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 |2160| » » » » » » » » ||·(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 |2161| » » » » » » » » &&·(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 |2206| » » » » » » » ||·(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 |2207| » » » » » » » &&·(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 |2223| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2396| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2412| » » » » » var·nearby·=·this.FindNearbyResource(function(ent,·type,·template)·{ | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2415| » » » » » » » ||·(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 |2416| » » » » » » » &&·(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 |2436| » » » » » var·nearby·=·this.FindNearestDropsite(resourceType.generic); | | [NORMAL] JSHintBear: | | 'nearby' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2625| » » » » » var·cmpResourceGatherer·=·Engine.QueryInterface(this.entity,·IID_ResourceGatherer); | | [NORMAL] JSHintBear: | | 'cmpResourceGatherer' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2820| » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(msg.data.newentity,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'cmpResourceDropsite' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |2896| » » » » » if·(this.CanGarrison(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2899| » » » » » » if·(this.CheckGarrisonRange(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2901| » » » » » » » var·cmpGarrisonHolder·=·Engine.QueryInterface(target,·IID_GarrisonHolder); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2923| » » » » » » » » var·cmpResourceDropsite·=·Engine.QueryInterface(target,·IID_ResourceDropsite); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2924| » » » » » » » » if·(cmpResourceDropsite·&&·this.CanReturnResource(target,·true)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2939| » » » » » » » » » var·cmpHolderPosition·=·Engine.QueryInterface(target,·IID_Position); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2940| » » » » » » » » » var·cmpHolderUnitAI·=·Engine.QueryInterface(target,·IID_UnitAI); | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |2967| » » » » » » » if·(this.MoveToTarget(target)) | | [NORMAL] JSHintBear: | | 'target' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |3726| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3795| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4065| » let·cmpPosition·=·Engine.QueryInterface(this.entity,·IID_Position) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |4318| » » var·parabolicMaxRange·=·0; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4322| » var·guessedMaxRange·=·(range.max·+·parabolicMaxRange)/2; | | [NORMAL] JSHintBear: | | 'parabolicMaxRange' used out of scope. binaries/data/mods/public/simulation/components/UnitAI.js |4329| » 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 |4385| » » » &&·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 |4553| » » &&·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 |4554| » » &&·(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 |5076| » var·lastPos·=·undefined; | | [NORMAL] JSHintBear: | | It's not necessary to initialize 'lastPos' to 'undefined'. binaries/data/mods/public/simulation/components/UnitAI.js |5430| » » » » » » &&·!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 |5433| » » » » » » &&·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 |5446| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5447| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5453| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5454| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5456| » » » » &&·!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 |5459| » » » » &&·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 |5534| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5537| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5542| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5545| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5545| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [MAJOR] JSHintBear: | | Too many errors. (92% scanned). Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/differential/1377/display/redirect
|