Do not create range query with no enemies as that triggers warning in range manager.
This situation occurs when player has no enemies so empty list is returned.
Fixing CCmpRangeManager: No owners in query for entity 0 warning
refs rP23012
Differential D2601
Do not create range query with no enemies Silier on Jan 27 2020, 7:43 PM. Authored by
Details
Do not create range query with no enemies as that triggers warning in range manager. Fixing CCmpRangeManager: No owners in query for entity 0 warning refs rP23012 Start game with all allies.
Diff Detail
Event TimelineComment Actions Build failure - The Moirai have given mortals hearts that can endure. Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1667/display/redirect Comment Actions Build failure - The Moirai have given mortals hearts that can endure. Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1149/display/redirect Comment Actions Build failure - The Moirai have given mortals hearts that can endure. Link to build: https://jenkins.wildfiregames.com/job/macos-differential/245/display/redirect Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 35| 35| | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| |- SetInterval: function() { }, | | 38|+ "SetInterval": function() { }, | 39| 39| SetTimeout: function() { }, | 40| 40| }); | 41| 41| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| 38| SetInterval: function() { }, | 39| |- SetTimeout: function() { }, | | 39|+ "SetTimeout": function() { }, | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 43| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 43|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| |- EnableActiveQuery: function(id) { }, | | 46|+ "EnableActiveQuery": function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ "ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| |- DisableActiveQuery: function(id) { }, | | 48|+ "DisableActiveQuery": function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | 51| 51| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| |- GetEntityFlagMask: function(identifier) { }, | | 49|+ "GetEntityFlagMask": function(identifier) { }, | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 53| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 53|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| |- GetPlayerByID: function(id) { return playerEntity; }, | | 57|+ "GetPlayerByID": function(id) { return playerEntity; }, | 58| 58| GetNumPlayers: function() { return 2; }, | 59| 59| }); | 60| 60| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| 57| GetPlayerByID: function(id) { return playerEntity; }, | 58| |- GetNumPlayers: function() { return 2; }, | | 58|+ "GetNumPlayers": function() { return 2; }, | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| |- IsAlly: function() { return false; }, | | 62|+ "IsAlly": function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| 64| GetEnemies: function() { return [2]; }, | 65| 65| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| |- IsEnemy: function() { return true; }, | | 63|+ "IsEnemy": function() { return true; }, | 64| 64| GetEnemies: function() { return [2]; }, | 65| 65| }); | 66| 66| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| |- GetEnemies: function() { return [2]; }, | | 64|+ "GetEnemies": function() { return [2]; }, | 65| 65| }); | 66| 66| | 67| 67| AddMock(SYSTEM_ENTITY, IID_ObstructionManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 71| 71| var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 72| 72| | 73| 73| AddMock(unit, IID_Identity, { | 74| |- GetClassesList: function() { return []; }, | | 74|+ "GetClassesList": function() { return []; }, | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Ownership, { | 78| |- GetOwner: function() { return 1; }, | | 78|+ "GetOwner": function() { return 1; }, | 79| 79| }); | 80| 80| | 81| 81| AddMock(unit, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 79| 79| }); | 80| 80| | 81| 81| AddMock(unit, IID_Position, { | 82| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 82|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 83| 83| GetPosition: function() { return new Vector3D(); }, | 84| 84| GetPosition2D: function() { return new Vector2D(); }, | 85| 85| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 80| 80| | 81| 81| AddMock(unit, IID_Position, { | 82| 82| GetTurretParent: function() { return INVALID_ENTITY; }, | 83| |- GetPosition: function() { return new Vector3D(); }, | | 83|+ "GetPosition": function() { return new Vector3D(); }, | 84| 84| GetPosition2D: function() { return new Vector2D(); }, | 85| 85| GetRotation: function() { return { "y": 0 }; }, | 86| 86| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 81| 81| AddMock(unit, IID_Position, { | 82| 82| GetTurretParent: function() { return INVALID_ENTITY; }, | 83| 83| GetPosition: function() { return new Vector3D(); }, | 84| |- GetPosition2D: function() { return new Vector2D(); }, | | 84|+ "GetPosition2D": function() { return new Vector2D(); }, | 85| 85| GetRotation: function() { return { "y": 0 }; }, | 86| 86| IsInWorld: function() { return true; }, | 87| 87| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 82| 82| GetTurretParent: function() { return INVALID_ENTITY; }, | 83| 83| GetPosition: function() { return new Vector3D(); }, | 84| 84| GetPosition2D: function() { return new Vector2D(); }, | 85| |- GetRotation: function() { return { "y": 0 }; }, | | 85|+ "GetRotation": function() { return { "y": 0 }; }, | 86| 86| IsInWorld: function() { return true; }, | 87| 87| }); | 88| 88| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 83| 83| GetPosition: function() { return new Vector3D(); }, | 84| 84| GetPosition2D: function() { return new Vector2D(); }, | 85| 85| GetRotation: function() { return { "y": 0 }; }, | 86| |- IsInWorld: function() { return true; }, | | 86|+ "IsInWorld": function() { return true; }, | 87| 87| }); | 88| 88| | 89| 89| AddMock(unit, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Vision, { | 99| |- GetRange: function() { return 10; }, | | 99|+ "GetRange": function() { return 10; }, | 100| 100| }); | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| }); | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | 103| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 103|+ "GetRange": function() { return { "max": 10, "min": 0}; }, | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| }); | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | 103| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 103|+ GetRange: function() { return { "max": 10, "min": 0 }; }, | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | 103| 103| GetRange: function() { return { "max": 10, "min": 0}; }, | 104| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 104|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | 103| 103| GetRange: function() { return { "max": 10, "min": 0}; }, | 104| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 104|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 102| 102| AddMock(unit, IID_Attack, { | 103| 103| GetRange: function() { return { "max": 10, "min": 0}; }, | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 105|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| 108| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPreference' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 103| 103| GetRange: function() { return { "max": 10, "min": 0}; }, | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| |- GetPreference: function(t) { return 0; }, | | 106|+ "GetPreference": function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| 108| CanAttack: function(v) { return true; }, | 109| 109| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 107|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| 108| CanAttack: function(v) { return true; }, | 109| 109| CompareEntitiesByPreference: function(a, b) { return 0; }, | 110| 110| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| |- CanAttack: function(v) { return true; }, | | 108|+ "CanAttack": function(v) { return true; }, | 109| 109| CompareEntitiesByPreference: function(a, b) { return 0; }, | 110| 110| }); | 111| 111| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| 108| CanAttack: function(v) { return true; }, | 109| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 109|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 110| 110| }); | 111| 111| | 112| 112| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 117| 117| if (mode == 1) | 118| 118| { | 119| 119| AddMock(enemy, IID_Health, { | 120| |- GetHitpoints: function() { return 10; }, | | 120|+ "GetHitpoints": function() { return 10; }, | 121| 121| }); | 122| 122| AddMock(enemy, IID_UnitAI, { | 123| 123| IsAnimal: function() { return false; } | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAnimal' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 120| 120| GetHitpoints: function() { return 10; }, | 121| 121| }); | 122| 122| AddMock(enemy, IID_UnitAI, { | 123| |- IsAnimal: function() { return false; } | | 123|+ "IsAnimal": function() { return false; } | 124| 124| }); | 125| 125| } | 126| 126| else if (mode == 2) | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 125| 125| } | 126| 126| else if (mode == 2) | 127| 127| AddMock(enemy, IID_Health, { | 128| |- GetHitpoints: function() { return 0; }, | | 128|+ "GetHitpoints": function() { return 0; }, | 129| 129| }); | 130| 130| | 131| 131| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 128| 128| GetHitpoints: function() { return 0; }, | 129| 129| }); | 130| 130| | 131| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 131|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 132| 132| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 133| 133| | 134| 134| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 128| 128| GetHitpoints: function() { return 0; }, | 129| 129| }); | 130| 130| | 131| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 131|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 132| 132| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 133| 133| | 134| 134| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 132| 132| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 133| 133| | 134| 134| AddMock(controller, IID_Position, { | 135| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 135|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 136| 136| GetTurretParent: function() { return INVALID_ENTITY; }, | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 133| 133| | 134| 134| AddMock(controller, IID_Position, { | 135| 135| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 136| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 136|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 139| 139| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 134| 134| AddMock(controller, IID_Position, { | 135| 135| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 136| 136| GetTurretParent: function() { return INVALID_ENTITY; }, | 137| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 137|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 139| 139| GetRotation: function() { return { "y": 0 }; }, | 140| 140| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 135| 135| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 136| 136| GetTurretParent: function() { return INVALID_ENTITY; }, | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 138|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 139| 139| GetRotation: function() { return { "y": 0 }; }, | 140| 140| IsInWorld: function() { return true; }, | 141| 141| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 136| 136| GetTurretParent: function() { return INVALID_ENTITY; }, | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 139| |- GetRotation: function() { return { "y": 0 }; }, | | 139|+ "GetRotation": function() { return { "y": 0 }; }, | 140| 140| IsInWorld: function() { return true; }, | 141| 141| }); | 142| 142| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 139| 139| GetRotation: function() { return { "y": 0 }; }, | 140| |- IsInWorld: function() { return true; }, | | 140|+ "IsInWorld": function() { return true; }, | 141| 141| }); | 142| 142| | 143| 143| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 188| 188| var unitAIs = []; | 189| 189| | 190| 190| AddMock(SYSTEM_ENTITY, IID_Timer, { | 191| |- SetInterval: function() { }, | | 191|+ "SetInterval": function() { }, | 192| 192| SetTimeout: function() { }, | 193| 193| }); | 194| 194| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 189| 189| | 190| 190| AddMock(SYSTEM_ENTITY, IID_Timer, { | 191| 191| SetInterval: function() { }, | 192| |- SetTimeout: function() { }, | | 192|+ "SetTimeout": function() { }, | 193| 193| }); | 194| 194| | 195| 195| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 194| 194| | 195| 195| | 196| 196| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 197| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 197|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 198| 198| return 1; | 199| 199| }, | 200| 200| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 197| 197| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 198| 198| return 1; | 199| 199| }, | 200| |- EnableActiveQuery: function(id) { }, | | 200|+ "EnableActiveQuery": function(id) { }, | 201| 201| ResetActiveQuery: function(id) { return [enemy]; }, | 202| 202| DisableActiveQuery: function(id) { }, | 203| 203| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 198| 198| return 1; | 199| 199| }, | 200| 200| EnableActiveQuery: function(id) { }, | 201| |- ResetActiveQuery: function(id) { return [enemy]; }, | | 201|+ "ResetActiveQuery": function(id) { return [enemy]; }, | 202| 202| DisableActiveQuery: function(id) { }, | 203| 203| GetEntityFlagMask: function(identifier) { }, | 204| 204| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 199| 199| }, | 200| 200| EnableActiveQuery: function(id) { }, | 201| 201| ResetActiveQuery: function(id) { return [enemy]; }, | 202| |- DisableActiveQuery: function(id) { }, | | 202|+ "DisableActiveQuery": function(id) { }, | 203| 203| GetEntityFlagMask: function(identifier) { }, | 204| 204| }); | 205| 205| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 200| 200| EnableActiveQuery: function(id) { }, | 201| 201| ResetActiveQuery: function(id) { return [enemy]; }, | 202| 202| DisableActiveQuery: function(id) { }, | 203| |- GetEntityFlagMask: function(identifier) { }, | | 203|+ "GetEntityFlagMask": function(identifier) { }, | 204| 204| }); | 205| 205| | 206| 206| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 204| 204| }); | 205| 205| | 206| 206| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 207| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 207|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 208| 208| }); | 209| 209| | 210| 210| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 208| 208| }); | 209| 209| | 210| 210| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 211| |- GetPlayerByID: function(id) { return playerEntity; }, | | 211|+ "GetPlayerByID": function(id) { return playerEntity; }, | 212| 212| GetNumPlayers: function() { return 2; }, | 213| 213| }); | 214| 214| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 209| 209| | 210| 210| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 211| 211| GetPlayerByID: function(id) { return playerEntity; }, | 212| |- GetNumPlayers: function() { return 2; }, | | 212|+ "GetNumPlayers": function() { return 2; }, | 213| 213| }); | 214| 214| | 215| 215| AddMock(SYSTEM_ENTITY, IID_ObstructionManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 217| 217| }); | 218| 218| | 219| 219| AddMock(playerEntity, IID_Player, { | 220| |- IsAlly: function() { return false; }, | | 220|+ "IsAlly": function() { return false; }, | 221| 221| IsEnemy: function() { return true; }, | 222| 222| GetEnemies: function() { return [2]; }, | 223| 223| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 218| 218| | 219| 219| AddMock(playerEntity, IID_Player, { | 220| 220| IsAlly: function() { return false; }, | 221| |- IsEnemy: function() { return true; }, | | 221|+ "IsEnemy": function() { return true; }, | 222| 222| GetEnemies: function() { return [2]; }, | 223| 223| }); | 224| 224| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 219| 219| AddMock(playerEntity, IID_Player, { | 220| 220| IsAlly: function() { return false; }, | 221| 221| IsEnemy: function() { return true; }, | 222| |- GetEnemies: function() { return [2]; }, | | 222|+ "GetEnemies": function() { return [2]; }, | 223| 223| }); | 224| 224| | 225| 225| // create units | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| 230| var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 231| 231| | 232| 232| AddMock(unit + i, IID_Identity, { | 233| |- GetClassesList: function() { return []; }, | | 233|+ "GetClassesList": function() { return []; }, | 234| 234| }); | 235| 235| | 236| 236| AddMock(unit + i, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 234| 234| }); | 235| 235| | 236| 236| AddMock(unit + i, IID_Ownership, { | 237| |- GetOwner: function() { return 1; }, | | 237|+ "GetOwner": function() { return 1; }, | 238| 238| }); | 239| 239| | 240| 240| AddMock(unit + i, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 238| 238| }); | 239| 239| | 240| 240| AddMock(unit + i, IID_Position, { | 241| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 241|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 242| 242| GetPosition: function() { return new Vector3D(); }, | 243| 243| GetPosition2D: function() { return new Vector2D(); }, | 244| 244| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 239| 239| | 240| 240| AddMock(unit + i, IID_Position, { | 241| 241| GetTurretParent: function() { return INVALID_ENTITY; }, | 242| |- GetPosition: function() { return new Vector3D(); }, | | 242|+ "GetPosition": function() { return new Vector3D(); }, | 243| 243| GetPosition2D: function() { return new Vector2D(); }, | 244| 244| GetRotation: function() { return { "y": 0 }; }, | 245| 245| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 240| 240| AddMock(unit + i, IID_Position, { | 241| 241| GetTurretParent: function() { return INVALID_ENTITY; }, | 242| 242| GetPosition: function() { return new Vector3D(); }, | 243| |- GetPosition2D: function() { return new Vector2D(); }, | | 243|+ "GetPosition2D": function() { return new Vector2D(); }, | 244| 244| GetRotation: function() { return { "y": 0 }; }, | 245| 245| IsInWorld: function() { return true; }, | 246| 246| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 241| 241| GetTurretParent: function() { return INVALID_ENTITY; }, | 242| 242| GetPosition: function() { return new Vector3D(); }, | 243| 243| GetPosition2D: function() { return new Vector2D(); }, | 244| |- GetRotation: function() { return { "y": 0 }; }, | | 244|+ "GetRotation": function() { return { "y": 0 }; }, | 245| 245| IsInWorld: function() { return true; }, | 246| 246| }); | 247| 247| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 242| 242| GetPosition: function() { return new Vector3D(); }, | 243| 243| GetPosition2D: function() { return new Vector2D(); }, | 244| 244| GetRotation: function() { return { "y": 0 }; }, | 245| |- IsInWorld: function() { return true; }, | | 245|+ "IsInWorld": function() { return true; }, | 246| 246| }); | 247| 247| | 248| 248| AddMock(unit + i, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 255| 255| }); | 256| 256| | 257| 257| AddMock(unit + i, IID_Vision, { | 258| |- GetRange: function() { return 10; }, | | 258|+ "GetRange": function() { return 10; }, | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 262|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 262|+ GetRange: function() { return { "max":10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 262|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 262|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| 262| GetRange: function() { return {"max":10, "min": 0}; }, | 263| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 263|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| 262| GetRange: function() { return {"max":10, "min": 0}; }, | 263| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 263|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 261| 261| AddMock(unit + i, IID_Attack, { | 262| 262| GetRange: function() { return {"max":10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 264|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | 267| 267| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 262| 262| GetRange: function() { return {"max":10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 265|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | 267| 267| CompareEntitiesByPreference: function(a, b) { return 0; }, | 268| 268| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| |- CanAttack: function(v) { return true; }, | | 266|+ "CanAttack": function(v) { return true; }, | 267| 267| CompareEntitiesByPreference: function(a, b) { return 0; }, | 268| 268| }); | 269| 269| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | 267| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 267|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 268| 268| }); | 269| 269| | 270| 270| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 276| 276| | 277| 277| // create enemy | 278| 278| AddMock(enemy, IID_Health, { | 279| |- GetHitpoints: function() { return 40; }, | | 279|+ "GetHitpoints": function() { return 40; }, | 280| 280| }); | 281| 281| | 282| 282| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 279| 279| GetHitpoints: function() { return 40; }, | 280| 280| }); | 281| 281| | 282| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 282|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 283| 283| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 284| 284| | 285| 285| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 279| 279| GetHitpoints: function() { return 40; }, | 280| 280| }); | 281| 281| | 282| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 282|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 283| 283| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 284| 284| | 285| 285| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 283| 283| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 284| 284| | 285| 285| AddMock(controller, IID_Position, { | 286| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 286|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 287| 287| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 284| 284| | 285| 285| AddMock(controller, IID_Position, { | 286| 286| GetTurretParent: function() { return INVALID_ENTITY; }, | 287| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 287|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 290| 290| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 285| 285| AddMock(controller, IID_Position, { | 286| 286| GetTurretParent: function() { return INVALID_ENTITY; }, | 287| 287| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 288| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 288|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 290| 290| GetRotation: function() { return { "y": 0 }; }, | 291| 291| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 286| 286| GetTurretParent: function() { return INVALID_ENTITY; }, | 287| 287| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 289|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 290| 290| GetRotation: function() { return { "y": 0 }; }, | 291| 291| IsInWorld: function() { return true; }, | 292| 292| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 287| 287| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 290| |- GetRotation: function() { return { "y": 0 }; }, | | 290|+ "GetRotation": function() { return { "y": 0 }; }, | 291| 291| IsInWorld: function() { return true; }, | 292| 292| }); | 293| 293| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 290| 290| GetRotation: function() { return { "y": 0 }; }, | 291| |- IsInWorld: function() { return true; }, | | 291|+ "IsInWorld": function() { return true; }, | 292| 292| }); | 293| 293| | 294| 294| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| }); | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 304|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 305| 305| CanAttackAsFormation: function() { return false; }, | 306| 306| }); | 307| 307| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| }); | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 304|+ GetRange: function() { return { "max":10, "min": 0}; }, | 305| 305| CanAttackAsFormation: function() { return false; }, | 306| 306| }); | 307| 307| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| }); | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 304|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 305| 305| CanAttackAsFormation: function() { return false; }, | 306| 306| }); | 307| 307| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| }); | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 304|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 305| 305| CanAttackAsFormation: function() { return false; }, | 306| 306| }); | 307| 307| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttackAsFormation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| 304| GetRange: function() { return {"max":10, "min": 0}; }, | 305| |- CanAttackAsFormation: function() { return false; }, | | 305|+ "CanAttackAsFormation": function() { return false; }, | 306| 306| }); | 307| 307| | 308| 308| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 314| 314| for (var ent of unitAIs) | 315| 315| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 316| 316| | 317| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 317|+ controllerAI.MoveIntoFormation({ "name": "Circle"}); | 318| 318| | 319| 319| // let all units be in position | 320| 320| for (var ent of unitAIs) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 314| 314| for (var ent of unitAIs) | 315| 315| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 316| 316| | 317| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 317|+ controllerAI.MoveIntoFormation({"name": "Circle" }); | 318| 318| | 319| 319| // let all units be in position | 320| 320| for (var ent of unitAIs) binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 47| » » 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 | 226| » 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 | 320| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 323| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 315| » » 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 | 324| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | 788| 788| this.FinishOrder(); | 789| 789| return; | 790| 790| } | 791| |- else | 792| |- { | | 791|+ | 793| 792| this.SetNextState("GARRISON.APPROACHING"); | 794| 793| return; | 795| |- } | | 794|+ | 796| 795| } | 797| 796| | 798| 797| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'GARRISON'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |1060|1060| }, |1061|1061| }, |1062|1062| |1063| |- "GARRISON":{ | |1063|+ "GARRISON": { |1064|1064| "APPROACHING": { |1065|1065| "enter": function() { |1066|1066| if (!this.MoveToGarrisonRange(this.order.data.target)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |2038|2038| |2039|2039| "Attacked": function(msg) { |2040|2040| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2041| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2042| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2041|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2042|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2043|2043| this.RespondToTargetedEntities([msg.data.attacker]); |2044|2044| }, |2045|2045| }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |2776|2776| { |2777|2777| // The building was already finished/fully repaired before we arrived; |2778|2778| // let the ConstructionFinished handler handle this. |2779| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2779|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2780|2780| return true; |2781|2781| } |2782|2782| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |2776|2776| { |2777|2777| // The building was already finished/fully repaired before we arrived; |2778|2778| // let the ConstructionFinished handler handle this. |2779| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2779|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2780|2780| return true; |2781|2781| } |2782|2782| | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3074|3074| this.StopTimer(); |3075|3075| this.ResetAnimation(); |3076|3076| if (this.formationAnimationVariant) |3077| |- this.SetAnimationVariant(this.formationAnimationVariant) | |3077|+ this.SetAnimationVariant(this.formationAnimationVariant); |3078|3078| else |3079|3079| this.SetDefaultAnimationVariant(); |3080|3080| var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 7. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3300|3300| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3301|3301| |3302|3302| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3303| |- // only used for domestic animals | |3303|+ // only used for domestic animals |3304|3304| |3305|3305| // Reuse the same garrison behaviour for animals. |3306|3306| "GARRISON": "INDIVIDUAL.GARRISON", | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3362|3362| |3363|3363| UnitAI.prototype.IsAnimal = function() |3364|3364| { |3365| |- return (this.template.NaturalBehaviour ? true : false); | |3365|+ return (!!this.template.NaturalBehaviour); |3366|3366| }; |3367|3367| |3368|3368| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3478|3478| { |3479|3479| let index = this.GetCurrentState().indexOf("."); |3480|3480| if (index != -1) |3481| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3481|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3482|3482| this.Stop(false); |3483|3483| } |3484|3484| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3534|3534| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3535|3535| continue; |3536|3536| if (i == 0) |3537| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3537|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3538|3538| else |3539|3539| this.orderQueue.splice(i, 1); |3540|3540| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3534|3534| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3535|3535| continue; |3536|3536| if (i == 0) |3537| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3537|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3538|3538| else |3539|3539| this.orderQueue.splice(i, 1); |3540|3540| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3621|3621| }; |3622|3622| |3623|3623| |3624| |-//// FSM linkage functions //// | |3624|+// // FSM linkage functions //// |3625|3625| |3626|3626| // Setting the next state to the current state will leave/re-enter the top-most substate. |3627|3627| UnitAI.prototype.SetNextState = function(state) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3792|3792| continue; |3793|3793| if (this.orderQueue[i].type == type) |3794|3794| continue; |3795| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3795|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3796|3796| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3797|3797| return; |3798|3798| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3792|3792| continue; |3793|3793| if (this.orderQueue[i].type == type) |3794|3794| continue; |3795| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3795|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3796|3796| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3797|3797| return; |3798|3798| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4034|4034| if (data.timerRepeat === undefined) |4035|4035| this.timer = undefined; |4036|4036| |4037| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |4037|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |4038|4038| }; |4039|4039| |4040|4040| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4034|4034| if (data.timerRepeat === undefined) |4035|4035| this.timer = undefined; |4036|4036| |4037| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |4037|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |4038|4038| }; |4039|4039| |4040|4040| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4079|4079| // TODO: This is a bit inefficient since every unit listens to every |4080|4080| // construction message - ideally we could scope it to only the one we're building |4081|4081| |4082| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |4082|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |4083|4083| }; |4084|4084| |4085|4085| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4079|4079| // TODO: This is a bit inefficient since every unit listens to every |4080|4080| // construction message - ideally we could scope it to only the one we're building |4081|4081| |4082| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |4082|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |4083|4083| }; |4084|4084| |4085|4085| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4110|4110| if (msg.fromStatusEffect) |4111|4111| return; |4112|4112| |4113| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |4113|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |4114|4114| }; |4115|4115| |4116|4116| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4110|4110| if (msg.fromStatusEffect) |4111|4111| return; |4112|4112| |4113| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |4113|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |4114|4114| }; |4115|4115| |4116|4116| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4115|4115| |4116|4116| UnitAI.prototype.OnGuardedAttacked = function(msg) |4117|4117| { |4118| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |4118|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |4119|4119| }; |4120|4120| |4121|4121| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4115|4115| |4116|4116| UnitAI.prototype.OnGuardedAttacked = function(msg) |4117|4117| { |4118| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |4118|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |4119|4119| }; |4120|4120| |4121|4121| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4120|4120| |4121|4121| UnitAI.prototype.OnHealthChanged = function(msg) |4122|4122| { |4123| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |4123|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |4124|4124| }; |4125|4125| |4126|4126| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4120|4120| |4121|4121| UnitAI.prototype.OnHealthChanged = function(msg) |4122|4122| { |4123| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |4123|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |4124|4124| }; |4125|4125| |4126|4126| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4126|4126| UnitAI.prototype.OnRangeUpdate = function(msg) |4127|4127| { |4128|4128| if (msg.tag == this.losRangeQuery) |4129| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |4129|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |4130|4130| else if (msg.tag == this.losHealRangeQuery) |4131|4131| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |4132|4132| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4126|4126| UnitAI.prototype.OnRangeUpdate = function(msg) |4127|4127| { |4128|4128| if (msg.tag == this.losRangeQuery) |4129| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |4129|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |4130|4130| else if (msg.tag == this.losHealRangeQuery) |4131|4131| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |4132|4132| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4128|4128| if (msg.tag == this.losRangeQuery) |4129|4129| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |4130|4130| else if (msg.tag == this.losHealRangeQuery) |4131| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |4131|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |4132|4132| }; |4133|4133| |4134|4134| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4128|4128| if (msg.tag == this.losRangeQuery) |4129|4129| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |4130|4130| else if (msg.tag == this.losHealRangeQuery) |4131| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |4131|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |4132|4132| }; |4133|4133| |4134|4134| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4133|4133| |4134|4134| UnitAI.prototype.OnPackFinished = function(msg) |4135|4135| { |4136| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |4136|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |4137|4137| }; |4138|4138| |4139|4139| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4133|4133| |4134|4134| UnitAI.prototype.OnPackFinished = function(msg) |4135|4135| { |4136| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |4136|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |4137|4137| }; |4138|4138| |4139|4139| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4136|4136| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |4137|4137| }; |4138|4138| |4139| |-//// Helper functions to be called by the FSM //// | |4139|+// // Helper functions to be called by the FSM //// |4140|4140| |4141|4141| UnitAI.prototype.GetWalkSpeed = function() |4142|4142| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4801|4801| UnitAI.prototype.AttackEntityInZone = function(ents) |4802|4802| { |4803|4803| var target = ents.find(target => |4804| |- this.CanAttack(target) |4805| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4804|+ this.CanAttack(target) && | |4805|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4806|4806| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4807|4807| ); |4808|4808| if (!target) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4802|4802| { |4803|4803| var target = ents.find(target => |4804|4804| this.CanAttack(target) |4805| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4806| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4805|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4806|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4807|4807| ); |4808|4808| if (!target) |4809|4809| return false; | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4866|4866| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4867|4867| if (this.isGuardOf) |4868|4868| { |4869| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4869|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4870|4870| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4871|4871| if (cmpUnitAI && cmpAttack && |4872|4872| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (indent): | | Expected indentation of 3 tabs but found 4. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4870|4870| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4871|4871| if (cmpUnitAI && cmpAttack && |4872|4872| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4873| |- return false; | |4873|+ return false; |4874|4874| } |4875|4875| |4876|4876| // Stop if we're in hold-ground mode and it's too far from the holding point | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4908|4908| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4909|4909| if (this.isGuardOf) |4910|4910| { |4911| |- let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4911|+ let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4912|4912| let cmpAttack = Engine.QueryInterface(target, IID_Attack); |4913|4913| if (cmpUnitAI && cmpAttack && |4914|4914| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4921|4921| return false; |4922|4922| }; |4923|4923| |4924| |-//// External interface functions //// | |4924|+// // External interface functions //// |4925|4925| |4926|4926| UnitAI.prototype.SetFormationController = function(ent) |4927|4927| { | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5077|5077| { |5078|5078| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |5079|5079| return; |5080| |- else |5081| |- this.RemoveGuard(); | |5080|+ this.RemoveGuard(); |5082|5081| } |5083|5082| |5084|5083| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [NORMAL] ESLintBear (no-trailing-spaces): | | Trailing spaces not allowed. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5419|5419| this.workOrders.length && this.workOrders[0].type == "Trade") |5420|5420| { |5421|5421| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5422| |- if (cmpTrader.HasBothMarkets() && | |5422|+ if (cmpTrader.HasBothMarkets() && |5423|5423| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5424|5424| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5425|5425| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5700|5700| { |5701|5701| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5702|5702| var targetClasses = this.order.data.targetClasses; |5703| |- if (targetClasses.attack && cmpIdentity |5704| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5703|+ if (targetClasses.attack && cmpIdentity && | |5704|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5705|5705| continue; |5706|5706| if (targetClasses.avoid && cmpIdentity |5707|5707| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5703|5703| if (targetClasses.attack && cmpIdentity |5704|5704| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5705|5705| continue; |5706| |- if (targetClasses.avoid && cmpIdentity |5707| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5706|+ if (targetClasses.avoid && cmpIdentity && | |5707|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5708|5708| continue; |5709|5709| // Only used by the AIs to prevent some choices of targets |5710|5710| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5726|5726| { |5727|5727| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5728|5728| var targetClasses = this.order.data.targetClasses; |5729| |- if (cmpIdentity && targetClasses.attack |5730| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5729|+ if (cmpIdentity && targetClasses.attack && | |5730|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5731|5731| continue; |5732|5732| if (cmpIdentity && targetClasses.avoid |5733|5733| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5729|5729| if (cmpIdentity && targetClasses.attack |5730|5730| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5731|5731| continue; |5732| |- if (cmpIdentity && targetClasses.avoid |5733| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5732|+ if (cmpIdentity && targetClasses.avoid && | |5733|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5734|5734| continue; |5735|5735| // Only used by the AIs to prevent some choices of targets |5736|5736| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5886|5886| |5887|5887| UnitAI.prototype.SetHeldPosition = function(x, z) |5888|5888| { |5889| |- this.heldPosition = {"x": x, "z": z}; | |5889|+ this.heldPosition = { "x": x, "z": z}; |5890|5890| }; |5891|5891| |5892|5892| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5886|5886| |5887|5887| UnitAI.prototype.SetHeldPosition = function(x, z) |5888|5888| { |5889| |- this.heldPosition = {"x": x, "z": z}; | |5889|+ this.heldPosition = {"x": x, "z": z }; |5890|5890| }; |5891|5891| |5892|5892| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5913|5913| return false; |5914|5914| }; |5915|5915| |5916| |-//// Helper functions //// | |5916|+// // Helper functions //// |5917|5917| |5918|5918| UnitAI.prototype.CanAttack = function(target) |5919|5919| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |6111|6111| return cmpPack && cmpPack.IsPacking(); |6112|6112| }; |6113|6113| |6114| |-//// Formation specific functions //// | |6114|+// // Formation specific functions //// |6115|6115| |6116|6116| UnitAI.prototype.IsAttackingAsFormation = function() |6117|6117| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |6116|6116| UnitAI.prototype.IsAttackingAsFormation = function() |6117|6117| { |6118|6118| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |6119| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |6120| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |6119|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |6120|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |6121|6121| }; |6122|6122| |6123|6123| //// Animal specific functions //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |6120|6120| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |6121|6121| }; |6122|6122| |6123| |-//// Animal specific functions //// | |6123|+// // Animal specific functions //// |6124|6124| |6125|6125| UnitAI.prototype.MoveRandomly = function(distance) |6126|6126| { binaries/data/mods/public/simulation/components/UnitAI.js | 338| » » » return·true; | | [NORMAL] ESLintBear (consistent-return): | | Method 'Order.WalkToTarget' expected no return value. binaries/data/mods/public/simulation/components/UnitAI.js |1248| » » » » return·false; | | [NORMAL] ESLintBear (consistent-return): | | Method 'Timer' expected no return value. binaries/data/mods/public/simulation/components/UnitAI.js |3939| » 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 |4788| » 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 |4803| » 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 |4849| » 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 |4872| » » ····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 |2042| » » » » » » &&·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 |3077| » » » » » this.SetAnimationVariant(this.formationAnimationVariant) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |3886| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3970| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4805| » » &&·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 |4806| » » &&·(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 |5704| » » » » » » &&·!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 |5707| » » » » » » &&·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 |5720| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5721| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5727| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5728| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5730| » » » » &&·!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 |5733| » » » » &&·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 |5808| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5811| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5816| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5819| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5820| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5830| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5833| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |6120| » » &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING"; | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1668/display/redirect Comment Actions @Angen I tested your patch again, this error has been fixed, but a warning message appears WARNING: JavaScript warning: simulation/components/UnitAI.js line 1433 reference to undefined property this.order.data.target Comment Actions @elexis Yes, it will appear. I have uploaded the file on the forum and you can see it. https://wildfiregames.com/forum/index.php?/topic/27538-upgrade-error%EF%BC%81/ Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 35| 35| | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| |- SetInterval: function() { }, | | 38|+ "SetInterval": function() { }, | 39| 39| SetTimeout: function() { }, | 40| 40| }); | 41| 41| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 36| 36| | 37| 37| AddMock(SYSTEM_ENTITY, IID_Timer, { | 38| 38| SetInterval: function() { }, | 39| |- SetTimeout: function() { }, | | 39|+ "SetTimeout": function() { }, | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 40| 40| }); | 41| 41| | 42| 42| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 43| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 43|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 43| 43| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 44| 44| return 1; | 45| 45| }, | 46| |- EnableActiveQuery: function(id) { }, | | 46|+ "EnableActiveQuery": function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ "ResetActiveQuery": function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 44| 44| return 1; | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| |- ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | | 47|+ ResetActiveQuery: function(id) { if (mode == 0) return []; return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 45| 45| }, | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| |- DisableActiveQuery: function(id) { }, | | 48|+ "DisableActiveQuery": function(id) { }, | 49| 49| GetEntityFlagMask: function(identifier) { }, | 50| 50| }); | 51| 51| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 46| 46| EnableActiveQuery: function(id) { }, | 47| 47| ResetActiveQuery: function(id) { if (mode == 0) return []; else return [enemy]; }, | 48| 48| DisableActiveQuery: function(id) { }, | 49| |- GetEntityFlagMask: function(identifier) { }, | | 49|+ "GetEntityFlagMask": function(identifier) { }, | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 50| 50| }); | 51| 51| | 52| 52| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 53| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 53|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 54| 54| }); | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| |- GetPlayerByID: function(id) { return playerEntity; }, | | 57|+ "GetPlayerByID": function(id) { return playerEntity; }, | 58| 58| GetNumPlayers: function() { return 2; }, | 59| 59| }); | 60| 60| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 55| 55| | 56| 56| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 57| 57| GetPlayerByID: function(id) { return playerEntity; }, | 58| |- GetNumPlayers: function() { return 2; }, | | 58|+ "GetNumPlayers": function() { return 2; }, | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 59| 59| }); | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| |- IsAlly: function() { return false; }, | | 62|+ "IsAlly": function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| 64| GetEnemies: function() { return [2]; }, | 65| 65| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 60| 60| | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| |- IsEnemy: function() { return true; }, | | 63|+ "IsEnemy": function() { return true; }, | 64| 64| GetEnemies: function() { return [2]; }, | 65| 65| }); | 66| 66| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 61| 61| AddMock(playerEntity, IID_Player, { | 62| 62| IsAlly: function() { return false; }, | 63| 63| IsEnemy: function() { return true; }, | 64| |- GetEnemies: function() { return [2]; }, | | 64|+ "GetEnemies": function() { return [2]; }, | 65| 65| }); | 66| 66| | 67| 67| AddMock(SYSTEM_ENTITY, IID_ObstructionManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 71| 71| var unitAI = ConstructComponent(unit, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 72| 72| | 73| 73| AddMock(unit, IID_Identity, { | 74| |- GetClassesList: function() { return []; }, | | 74|+ "GetClassesList": function() { return []; }, | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 75| 75| }); | 76| 76| | 77| 77| AddMock(unit, IID_Ownership, { | 78| |- GetOwner: function() { return 1; }, | | 78|+ "GetOwner": function() { return 1; }, | 79| 79| }); | 80| 80| | 81| 81| AddMock(unit, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 79| 79| }); | 80| 80| | 81| 81| AddMock(unit, IID_Position, { | 82| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 82|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 83| 83| GetPosition: function() { return new Vector3D(); }, | 84| 84| GetPosition2D: function() { return new Vector2D(); }, | 85| 85| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 80| 80| | 81| 81| AddMock(unit, IID_Position, { | 82| 82| GetTurretParent: function() { return INVALID_ENTITY; }, | 83| |- GetPosition: function() { return new Vector3D(); }, | | 83|+ "GetPosition": function() { return new Vector3D(); }, | 84| 84| GetPosition2D: function() { return new Vector2D(); }, | 85| 85| GetRotation: function() { return { "y": 0 }; }, | 86| 86| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 81| 81| AddMock(unit, IID_Position, { | 82| 82| GetTurretParent: function() { return INVALID_ENTITY; }, | 83| 83| GetPosition: function() { return new Vector3D(); }, | 84| |- GetPosition2D: function() { return new Vector2D(); }, | | 84|+ "GetPosition2D": function() { return new Vector2D(); }, | 85| 85| GetRotation: function() { return { "y": 0 }; }, | 86| 86| IsInWorld: function() { return true; }, | 87| 87| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 82| 82| GetTurretParent: function() { return INVALID_ENTITY; }, | 83| 83| GetPosition: function() { return new Vector3D(); }, | 84| 84| GetPosition2D: function() { return new Vector2D(); }, | 85| |- GetRotation: function() { return { "y": 0 }; }, | | 85|+ "GetRotation": function() { return { "y": 0 }; }, | 86| 86| IsInWorld: function() { return true; }, | 87| 87| }); | 88| 88| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 83| 83| GetPosition: function() { return new Vector3D(); }, | 84| 84| GetPosition2D: function() { return new Vector2D(); }, | 85| 85| GetRotation: function() { return { "y": 0 }; }, | 86| |- IsInWorld: function() { return true; }, | | 86|+ "IsInWorld": function() { return true; }, | 87| 87| }); | 88| 88| | 89| 89| AddMock(unit, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 96| 96| }); | 97| 97| | 98| 98| AddMock(unit, IID_Vision, { | 99| |- GetRange: function() { return 10; }, | | 99|+ "GetRange": function() { return 10; }, | 100| 100| }); | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| }); | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | 103| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 103|+ "GetRange": function() { return { "max": 10, "min": 0}; }, | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 100| 100| }); | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | 103| |- GetRange: function() { return { "max": 10, "min": 0}; }, | | 103|+ GetRange: function() { return { "max": 10, "min": 0 }; }, | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | 103| 103| GetRange: function() { return { "max": 10, "min": 0}; }, | 104| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 104|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 101| 101| | 102| 102| AddMock(unit, IID_Attack, { | 103| 103| GetRange: function() { return { "max": 10, "min": 0}; }, | 104| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 104|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 102| 102| AddMock(unit, IID_Attack, { | 103| 103| GetRange: function() { return { "max": 10, "min": 0}; }, | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 105|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| 108| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPreference' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 103| 103| GetRange: function() { return { "max": 10, "min": 0}; }, | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| |- GetPreference: function(t) { return 0; }, | | 106|+ "GetPreference": function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| 108| CanAttack: function(v) { return true; }, | 109| 109| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 104| 104| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 107|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| 108| CanAttack: function(v) { return true; }, | 109| 109| CompareEntitiesByPreference: function(a, b) { return 0; }, | 110| 110| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 105| 105| GetBestAttackAgainst: function(t) { return "melee"; }, | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| |- CanAttack: function(v) { return true; }, | | 108|+ "CanAttack": function(v) { return true; }, | 109| 109| CompareEntitiesByPreference: function(a, b) { return 0; }, | 110| 110| }); | 111| 111| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 106| 106| GetPreference: function(t) { return 0; }, | 107| 107| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 108| 108| CanAttack: function(v) { return true; }, | 109| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 109|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 110| 110| }); | 111| 111| | 112| 112| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 117| 117| if (mode == 1) | 118| 118| { | 119| 119| AddMock(enemy, IID_Health, { | 120| |- GetHitpoints: function() { return 10; }, | | 120|+ "GetHitpoints": function() { return 10; }, | 121| 121| }); | 122| 122| AddMock(enemy, IID_UnitAI, { | 123| 123| IsAnimal: function() { return false; } | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAnimal' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 120| 120| GetHitpoints: function() { return 10; }, | 121| 121| }); | 122| 122| AddMock(enemy, IID_UnitAI, { | 123| |- IsAnimal: function() { return false; } | | 123|+ "IsAnimal": function() { return false; } | 124| 124| }); | 125| 125| } | 126| 126| else if (mode == 2) | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 125| 125| } | 126| 126| else if (mode == 2) | 127| 127| AddMock(enemy, IID_Health, { | 128| |- GetHitpoints: function() { return 0; }, | | 128|+ "GetHitpoints": function() { return 0; }, | 129| 129| }); | 130| 130| | 131| 131| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 128| 128| GetHitpoints: function() { return 0; }, | 129| 129| }); | 130| 130| | 131| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 131|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 132| 132| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 133| 133| | 134| 134| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 128| 128| GetHitpoints: function() { return 0; }, | 129| 129| }); | 130| 130| | 131| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 131|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 132| 132| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 133| 133| | 134| 134| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 132| 132| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 133| 133| | 134| 134| AddMock(controller, IID_Position, { | 135| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 135|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 136| 136| GetTurretParent: function() { return INVALID_ENTITY; }, | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 133| 133| | 134| 134| AddMock(controller, IID_Position, { | 135| 135| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 136| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 136|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 139| 139| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 134| 134| AddMock(controller, IID_Position, { | 135| 135| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 136| 136| GetTurretParent: function() { return INVALID_ENTITY; }, | 137| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 137|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 139| 139| GetRotation: function() { return { "y": 0 }; }, | 140| 140| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 135| 135| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 136| 136| GetTurretParent: function() { return INVALID_ENTITY; }, | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 138|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 139| 139| GetRotation: function() { return { "y": 0 }; }, | 140| 140| IsInWorld: function() { return true; }, | 141| 141| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 136| 136| GetTurretParent: function() { return INVALID_ENTITY; }, | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 139| |- GetRotation: function() { return { "y": 0 }; }, | | 139|+ "GetRotation": function() { return { "y": 0 }; }, | 140| 140| IsInWorld: function() { return true; }, | 141| 141| }); | 142| 142| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 137| 137| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 138| 138| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 139| 139| GetRotation: function() { return { "y": 0 }; }, | 140| |- IsInWorld: function() { return true; }, | | 140|+ "IsInWorld": function() { return true; }, | 141| 141| }); | 142| 142| | 143| 143| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetInterval' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 188| 188| var unitAIs = []; | 189| 189| | 190| 190| AddMock(SYSTEM_ENTITY, IID_Timer, { | 191| |- SetInterval: function() { }, | | 191|+ "SetInterval": function() { }, | 192| 192| SetTimeout: function() { }, | 193| 193| }); | 194| 194| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'SetTimeout' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 189| 189| | 190| 190| AddMock(SYSTEM_ENTITY, IID_Timer, { | 191| 191| SetInterval: function() { }, | 192| |- SetTimeout: function() { }, | | 192|+ "SetTimeout": function() { }, | 193| 193| }); | 194| 194| | 195| 195| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CreateActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 194| 194| | 195| 195| | 196| 196| AddMock(SYSTEM_ENTITY, IID_RangeManager, { | 197| |- CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | | 197|+ "CreateActiveQuery": function(ent, minRange, maxRange, players, iid, flags) { | 198| 198| return 1; | 199| 199| }, | 200| 200| EnableActiveQuery: function(id) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'EnableActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 197| 197| CreateActiveQuery: function(ent, minRange, maxRange, players, iid, flags) { | 198| 198| return 1; | 199| 199| }, | 200| |- EnableActiveQuery: function(id) { }, | | 200|+ "EnableActiveQuery": function(id) { }, | 201| 201| ResetActiveQuery: function(id) { return [enemy]; }, | 202| 202| DisableActiveQuery: function(id) { }, | 203| 203| GetEntityFlagMask: function(identifier) { }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'ResetActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 198| 198| return 1; | 199| 199| }, | 200| 200| EnableActiveQuery: function(id) { }, | 201| |- ResetActiveQuery: function(id) { return [enemy]; }, | | 201|+ "ResetActiveQuery": function(id) { return [enemy]; }, | 202| 202| DisableActiveQuery: function(id) { }, | 203| 203| GetEntityFlagMask: function(identifier) { }, | 204| 204| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'DisableActiveQuery' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 199| 199| }, | 200| 200| EnableActiveQuery: function(id) { }, | 201| 201| ResetActiveQuery: function(id) { return [enemy]; }, | 202| |- DisableActiveQuery: function(id) { }, | | 202|+ "DisableActiveQuery": function(id) { }, | 203| 203| GetEntityFlagMask: function(identifier) { }, | 204| 204| }); | 205| 205| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEntityFlagMask' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 200| 200| EnableActiveQuery: function(id) { }, | 201| 201| ResetActiveQuery: function(id) { return [enemy]; }, | 202| 202| DisableActiveQuery: function(id) { }, | 203| |- GetEntityFlagMask: function(identifier) { }, | | 203|+ "GetEntityFlagMask": function(identifier) { }, | 204| 204| }); | 205| 205| | 206| 206| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetCurrentTemplateName' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 204| 204| }); | 205| 205| | 206| 206| AddMock(SYSTEM_ENTITY, IID_TemplateManager, { | 207| |- GetCurrentTemplateName: function(ent) { return "special/formations/line_closed"; }, | | 207|+ "GetCurrentTemplateName": function(ent) { return "special/formations/line_closed"; }, | 208| 208| }); | 209| 209| | 210| 210| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPlayerByID' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 208| 208| }); | 209| 209| | 210| 210| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 211| |- GetPlayerByID: function(id) { return playerEntity; }, | | 211|+ "GetPlayerByID": function(id) { return playerEntity; }, | 212| 212| GetNumPlayers: function() { return 2; }, | 213| 213| }); | 214| 214| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetNumPlayers' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 209| 209| | 210| 210| AddMock(SYSTEM_ENTITY, IID_PlayerManager, { | 211| 211| GetPlayerByID: function(id) { return playerEntity; }, | 212| |- GetNumPlayers: function() { return 2; }, | | 212|+ "GetNumPlayers": function() { return 2; }, | 213| 213| }); | 214| 214| | 215| 215| AddMock(SYSTEM_ENTITY, IID_ObstructionManager, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsAlly' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 217| 217| }); | 218| 218| | 219| 219| AddMock(playerEntity, IID_Player, { | 220| |- IsAlly: function() { return false; }, | | 220|+ "IsAlly": function() { return false; }, | 221| 221| IsEnemy: function() { return true; }, | 222| 222| GetEnemies: function() { return [2]; }, | 223| 223| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsEnemy' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 218| 218| | 219| 219| AddMock(playerEntity, IID_Player, { | 220| 220| IsAlly: function() { return false; }, | 221| |- IsEnemy: function() { return true; }, | | 221|+ "IsEnemy": function() { return true; }, | 222| 222| GetEnemies: function() { return [2]; }, | 223| 223| }); | 224| 224| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetEnemies' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 219| 219| AddMock(playerEntity, IID_Player, { | 220| 220| IsAlly: function() { return false; }, | 221| 221| IsEnemy: function() { return true; }, | 222| |- GetEnemies: function() { return [2]; }, | | 222|+ "GetEnemies": function() { return [2]; }, | 223| 223| }); | 224| 224| | 225| 225| // create units | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetClassesList' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 230| 230| var unitAI = ConstructComponent(unit + i, "UnitAI", { "FormationController": "false", "DefaultStance": "aggressive" }); | 231| 231| | 232| 232| AddMock(unit + i, IID_Identity, { | 233| |- GetClassesList: function() { return []; }, | | 233|+ "GetClassesList": function() { return []; }, | 234| 234| }); | 235| 235| | 236| 236| AddMock(unit + i, IID_Ownership, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetOwner' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 234| 234| }); | 235| 235| | 236| 236| AddMock(unit + i, IID_Ownership, { | 237| |- GetOwner: function() { return 1; }, | | 237|+ "GetOwner": function() { return 1; }, | 238| 238| }); | 239| 239| | 240| 240| AddMock(unit + i, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 238| 238| }); | 239| 239| | 240| 240| AddMock(unit + i, IID_Position, { | 241| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 241|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 242| 242| GetPosition: function() { return new Vector3D(); }, | 243| 243| GetPosition2D: function() { return new Vector2D(); }, | 244| 244| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 239| 239| | 240| 240| AddMock(unit + i, IID_Position, { | 241| 241| GetTurretParent: function() { return INVALID_ENTITY; }, | 242| |- GetPosition: function() { return new Vector3D(); }, | | 242|+ "GetPosition": function() { return new Vector3D(); }, | 243| 243| GetPosition2D: function() { return new Vector2D(); }, | 244| 244| GetRotation: function() { return { "y": 0 }; }, | 245| 245| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 240| 240| AddMock(unit + i, IID_Position, { | 241| 241| GetTurretParent: function() { return INVALID_ENTITY; }, | 242| 242| GetPosition: function() { return new Vector3D(); }, | 243| |- GetPosition2D: function() { return new Vector2D(); }, | | 243|+ "GetPosition2D": function() { return new Vector2D(); }, | 244| 244| GetRotation: function() { return { "y": 0 }; }, | 245| 245| IsInWorld: function() { return true; }, | 246| 246| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 241| 241| GetTurretParent: function() { return INVALID_ENTITY; }, | 242| 242| GetPosition: function() { return new Vector3D(); }, | 243| 243| GetPosition2D: function() { return new Vector2D(); }, | 244| |- GetRotation: function() { return { "y": 0 }; }, | | 244|+ "GetRotation": function() { return { "y": 0 }; }, | 245| 245| IsInWorld: function() { return true; }, | 246| 246| }); | 247| 247| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 242| 242| GetPosition: function() { return new Vector3D(); }, | 243| 243| GetPosition2D: function() { return new Vector2D(); }, | 244| 244| GetRotation: function() { return { "y": 0 }; }, | 245| |- IsInWorld: function() { return true; }, | | 245|+ "IsInWorld": function() { return true; }, | 246| 246| }); | 247| 247| | 248| 248| AddMock(unit + i, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 255| 255| }); | 256| 256| | 257| 257| AddMock(unit + i, IID_Vision, { | 258| |- GetRange: function() { return 10; }, | | 258|+ "GetRange": function() { return 10; }, | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 262|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 262|+ GetRange: function() { return { "max":10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 262|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 259| 259| }); | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 262|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetFullAttackRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| 262| GetRange: function() { return {"max":10, "min": 0}; }, | 263| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 263|+ "GetFullAttackRange": function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 260| 260| | 261| 261| AddMock(unit + i, IID_Attack, { | 262| 262| GetRange: function() { return {"max":10, "min": 0}; }, | 263| |- GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | | 263|+ GetFullAttackRange: function() { return { "max": 40, "min": 0 }; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetBestAttackAgainst' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 261| 261| AddMock(unit + i, IID_Attack, { | 262| 262| GetRange: function() { return {"max":10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| |- GetBestAttackAgainst: function(t) { return "melee"; }, | | 264|+ "GetBestAttackAgainst": function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | 267| 267| CompareEntitiesByPreference: function(a, b) { return 0; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTimers' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 262| 262| GetRange: function() { return {"max":10, "min": 0}; }, | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| |- GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | | 265|+ "GetTimers": function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | 267| 267| CompareEntitiesByPreference: function(a, b) { return 0; }, | 268| 268| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttack' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 263| 263| GetFullAttackRange: function() { return { "max": 40, "min": 0}; }, | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| |- CanAttack: function(v) { return true; }, | | 266|+ "CanAttack": function(v) { return true; }, | 267| 267| CompareEntitiesByPreference: function(a, b) { return 0; }, | 268| 268| }); | 269| 269| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CompareEntitiesByPreference' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 264| 264| GetBestAttackAgainst: function(t) { return "melee"; }, | 265| 265| GetTimers: function() { return { "prepare": 500, "repeat": 1000 }; }, | 266| 266| CanAttack: function(v) { return true; }, | 267| |- CompareEntitiesByPreference: function(a, b) { return 0; }, | | 267|+ "CompareEntitiesByPreference": function(a, b) { return 0; }, | 268| 268| }); | 269| 269| | 270| 270| unitAI.OnCreate(); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetHitpoints' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 276| 276| | 277| 277| // create enemy | 278| 278| AddMock(enemy, IID_Health, { | 279| |- GetHitpoints: function() { return 40; }, | | 279|+ "GetHitpoints": function() { return 40; }, | 280| 280| }); | 281| 281| | 282| 282| var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 279| 279| GetHitpoints: function() { return 40; }, | 280| 280| }); | 281| 281| | 282| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 282|+ var controllerFormation = ConstructComponent(controller, "Formation", { "FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | 283| 283| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 284| 284| | 285| 285| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 279| 279| GetHitpoints: function() { return 40; }, | 280| 280| }); | 281| 281| | 282| |- var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0}); | | 282|+ var controllerFormation = ConstructComponent(controller, "Formation", {"FormationName": "Line Closed", "FormationShape": "square", "ShiftRows": "false", "SortingClasses": "", "WidthDepthRatio": 1, "UnitSeparationWidthMultiplier": 1, "UnitSeparationDepthMultiplier": 1, "SpeedMultiplier": 1, "Sloppyness": 0 }); | 283| 283| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 284| 284| | 285| 285| AddMock(controller, IID_Position, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetTurretParent' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 283| 283| var controllerAI = ConstructComponent(controller, "UnitAI", { "FormationController": "true", "DefaultStance": "aggressive" }); | 284| 284| | 285| 285| AddMock(controller, IID_Position, { | 286| |- GetTurretParent: function() { return INVALID_ENTITY; }, | | 286|+ "GetTurretParent": function() { return INVALID_ENTITY; }, | 287| 287| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'JumpTo' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 284| 284| | 285| 285| AddMock(controller, IID_Position, { | 286| 286| GetTurretParent: function() { return INVALID_ENTITY; }, | 287| |- JumpTo: function(x, z) { this.x = x; this.z = z; }, | | 287|+ "JumpTo": function(x, z) { this.x = x; this.z = z; }, | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 290| 290| GetRotation: function() { return { "y": 0 }; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 285| 285| AddMock(controller, IID_Position, { | 286| 286| GetTurretParent: function() { return INVALID_ENTITY; }, | 287| 287| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 288| |- GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | | 288|+ "GetPosition": function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 290| 290| GetRotation: function() { return { "y": 0 }; }, | 291| 291| IsInWorld: function() { return true; }, | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetPosition2D' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 286| 286| GetTurretParent: function() { return INVALID_ENTITY; }, | 287| 287| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| |- GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | | 289|+ "GetPosition2D": function() { return new Vector2D(this.x, this.z); }, | 290| 290| GetRotation: function() { return { "y": 0 }; }, | 291| 291| IsInWorld: function() { return true; }, | 292| 292| }); | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRotation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 287| 287| JumpTo: function(x, z) { this.x = x; this.z = z; }, | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 290| |- GetRotation: function() { return { "y": 0 }; }, | | 290|+ "GetRotation": function() { return { "y": 0 }; }, | 291| 291| IsInWorld: function() { return true; }, | 292| 292| }); | 293| 293| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'IsInWorld' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 288| 288| GetPosition: function() { return new Vector3D(this.x, 0, this.z); }, | 289| 289| GetPosition2D: function() { return new Vector2D(this.x, this.z); }, | 290| 290| GetRotation: function() { return { "y": 0 }; }, | 291| |- IsInWorld: function() { return true; }, | | 291|+ "IsInWorld": function() { return true; }, | 292| 292| }); | 293| 293| | 294| 294| AddMock(controller, IID_UnitMotion, { | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'GetRange' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| }); | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 304|+ "GetRange": function() { return {"max":10, "min": 0}; }, | 305| 305| CanAttackAsFormation: function() { return false; }, | 306| 306| }); | 307| 307| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| }); | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 304|+ GetRange: function() { return { "max":10, "min": 0}; }, | 305| 305| CanAttackAsFormation: function() { return false; }, | 306| 306| }); | 307| 307| | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'max'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| }); | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 304|+ GetRange: function() { return {"max": 10, "min": 0}; }, | 305| 305| CanAttackAsFormation: function() { return false; }, | 306| 306| }); | 307| 307| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 301| 301| }); | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| |- GetRange: function() { return {"max":10, "min": 0}; }, | | 304|+ GetRange: function() { return {"max":10, "min": 0 }; }, | 305| 305| CanAttackAsFormation: function() { return false; }, | 306| 306| }); | 307| 307| | | [NORMAL] ESLintBear (quote-props): | | Unquoted property 'CanAttackAsFormation' found. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 302| 302| | 303| 303| AddMock(controller, IID_Attack, { | 304| 304| GetRange: function() { return {"max":10, "min": 0}; }, | 305| |- CanAttackAsFormation: function() { return false; }, | | 305|+ "CanAttackAsFormation": function() { return false; }, | 306| 306| }); | 307| 307| | 308| 308| controllerAI.OnCreate(); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 314| 314| for (var ent of unitAIs) | 315| 315| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 316| 316| | 317| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 317|+ controllerAI.MoveIntoFormation({ "name": "Circle"}); | 318| 318| | 319| 319| // let all units be in position | 320| 320| for (var ent of unitAIs) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 314| 314| for (var ent of unitAIs) | 315| 315| TS_ASSERT_EQUALS(unitAI.fsmStateName, "INDIVIDUAL.COMBAT.ATTACKING"); | 316| 316| | 317| |- controllerAI.MoveIntoFormation({"name": "Circle"}); | | 317|+ controllerAI.MoveIntoFormation({"name": "Circle" }); | 318| 318| | 319| 319| // let all units be in position | 320| 320| for (var ent of unitAIs) binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 47| » » 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 | 226| » 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 | 320| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 323| » for·(var·ent·of·unitAIs) | | [NORMAL] JSHintBear: | | 'ent' is already defined. binaries/data/mods/public/simulation/components/tests/test_UnitAI.js | 315| » » 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 | 324| » » TS_ASSERT_EQUALS(unitAI.fsmStateName,·"INDIVIDUAL.COMBAT.ATTACKING"); | | [NORMAL] JSHintBear: | | 'unitAI' used out of scope. | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | 788| 788| this.FinishOrder(); | 789| 789| return; | 790| 790| } | 791| |- else | 792| |- { | | 791|+ | 793| 792| this.SetNextState("GARRISON.APPROACHING"); | 794| 793| return; | 795| |- } | | 794|+ | 796| 795| } | 797| 796| | 798| 797| this.SetNextState("GARRISON.GARRISONING"); | | [NORMAL] ESLintBear (key-spacing): | | Missing space before value for key 'GARRISON'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |1060|1060| }, |1061|1061| }, |1062|1062| |1063| |- "GARRISON":{ | |1063|+ "GARRISON": { |1064|1064| "APPROACHING": { |1065|1065| "enter": function() { |1066|1066| if (!this.MoveToGarrisonRange(this.order.data.target)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |2038|2038| |2039|2039| "Attacked": function(msg) { |2040|2040| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2041| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2042| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2041|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2042|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2043|2043| this.RespondToTargetedEntities([msg.data.attacker]); |2044|2044| }, |2045|2045| }, | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |2776|2776| { |2777|2777| // The building was already finished/fully repaired before we arrived; |2778|2778| // let the ConstructionFinished handler handle this. |2779| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2779|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2780|2780| return true; |2781|2781| } |2782|2782| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |2776|2776| { |2777|2777| // The building was already finished/fully repaired before we arrived; |2778|2778| // let the ConstructionFinished handler handle this. |2779| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2779|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2780|2780| return true; |2781|2781| } |2782|2782| | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3074|3074| this.StopTimer(); |3075|3075| this.ResetAnimation(); |3076|3076| if (this.formationAnimationVariant) |3077| |- this.SetAnimationVariant(this.formationAnimationVariant) | |3077|+ this.SetAnimationVariant(this.formationAnimationVariant); |3078|3078| else |3079|3079| this.SetDefaultAnimationVariant(); |3080|3080| var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 7. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3300|3300| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3301|3301| |3302|3302| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3303| |- // only used for domestic animals | |3303|+ // only used for domestic animals |3304|3304| |3305|3305| // Reuse the same garrison behaviour for animals. |3306|3306| "GARRISON": "INDIVIDUAL.GARRISON", | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3362|3362| |3363|3363| UnitAI.prototype.IsAnimal = function() |3364|3364| { |3365| |- return (this.template.NaturalBehaviour ? true : false); | |3365|+ return (!!this.template.NaturalBehaviour); |3366|3366| }; |3367|3367| |3368|3368| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (comma-spacing): | | A space is required after ','. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3478|3478| { |3479|3479| let index = this.GetCurrentState().indexOf("."); |3480|3480| if (index != -1) |3481| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3481|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3482|3482| this.Stop(false); |3483|3483| } |3484|3484| | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3534|3534| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3535|3535| continue; |3536|3536| if (i == 0) |3537| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3537|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3538|3538| else |3539|3539| this.orderQueue.splice(i, 1); |3540|3540| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3534|3534| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3535|3535| continue; |3536|3536| if (i == 0) |3537| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3537|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3538|3538| else |3539|3539| this.orderQueue.splice(i, 1); |3540|3540| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3621|3621| }; |3622|3622| |3623|3623| |3624| |-//// FSM linkage functions //// | |3624|+// // FSM linkage functions //// |3625|3625| |3626|3626| // Setting the next state to the current state will leave/re-enter the top-most substate. |3627|3627| UnitAI.prototype.SetNextState = function(state) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3792|3792| continue; |3793|3793| if (this.orderQueue[i].type == type) |3794|3794| continue; |3795| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3795|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3796|3796| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3797|3797| return; |3798|3798| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3792|3792| continue; |3793|3793| if (this.orderQueue[i].type == type) |3794|3794| continue; |3795| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3795|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3796|3796| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3797|3797| return; |3798|3798| } | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4034|4034| if (data.timerRepeat === undefined) |4035|4035| this.timer = undefined; |4036|4036| |4037| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |4037|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |4038|4038| }; |4039|4039| |4040|4040| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4034|4034| if (data.timerRepeat === undefined) |4035|4035| this.timer = undefined; |4036|4036| |4037| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |4037|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |4038|4038| }; |4039|4039| |4040|4040| /** | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4079|4079| // TODO: This is a bit inefficient since every unit listens to every |4080|4080| // construction message - ideally we could scope it to only the one we're building |4081|4081| |4082| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |4082|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |4083|4083| }; |4084|4084| |4085|4085| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4079|4079| // TODO: This is a bit inefficient since every unit listens to every |4080|4080| // construction message - ideally we could scope it to only the one we're building |4081|4081| |4082| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |4082|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |4083|4083| }; |4084|4084| |4085|4085| UnitAI.prototype.OnGlobalEntityRenamed = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4110|4110| if (msg.fromStatusEffect) |4111|4111| return; |4112|4112| |4113| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |4113|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |4114|4114| }; |4115|4115| |4116|4116| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4110|4110| if (msg.fromStatusEffect) |4111|4111| return; |4112|4112| |4113| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |4113|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |4114|4114| }; |4115|4115| |4116|4116| UnitAI.prototype.OnGuardedAttacked = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4115|4115| |4116|4116| UnitAI.prototype.OnGuardedAttacked = function(msg) |4117|4117| { |4118| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |4118|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |4119|4119| }; |4120|4120| |4121|4121| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4115|4115| |4116|4116| UnitAI.prototype.OnGuardedAttacked = function(msg) |4117|4117| { |4118| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |4118|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |4119|4119| }; |4120|4120| |4121|4121| UnitAI.prototype.OnHealthChanged = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4120|4120| |4121|4121| UnitAI.prototype.OnHealthChanged = function(msg) |4122|4122| { |4123| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |4123|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |4124|4124| }; |4125|4125| |4126|4126| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4120|4120| |4121|4121| UnitAI.prototype.OnHealthChanged = function(msg) |4122|4122| { |4123| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |4123|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |4124|4124| }; |4125|4125| |4126|4126| UnitAI.prototype.OnRangeUpdate = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4126|4126| UnitAI.prototype.OnRangeUpdate = function(msg) |4127|4127| { |4128|4128| if (msg.tag == this.losRangeQuery) |4129| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |4129|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |4130|4130| else if (msg.tag == this.losHealRangeQuery) |4131|4131| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |4132|4132| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4126|4126| UnitAI.prototype.OnRangeUpdate = function(msg) |4127|4127| { |4128|4128| if (msg.tag == this.losRangeQuery) |4129| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |4129|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |4130|4130| else if (msg.tag == this.losHealRangeQuery) |4131|4131| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |4132|4132| }; | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4128|4128| if (msg.tag == this.losRangeQuery) |4129|4129| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |4130|4130| else if (msg.tag == this.losHealRangeQuery) |4131| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |4131|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |4132|4132| }; |4133|4133| |4134|4134| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4128|4128| if (msg.tag == this.losRangeQuery) |4129|4129| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |4130|4130| else if (msg.tag == this.losHealRangeQuery) |4131| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |4131|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |4132|4132| }; |4133|4133| |4134|4134| UnitAI.prototype.OnPackFinished = function(msg) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4133|4133| |4134|4134| UnitAI.prototype.OnPackFinished = function(msg) |4135|4135| { |4136| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |4136|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |4137|4137| }; |4138|4138| |4139|4139| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4133|4133| |4134|4134| UnitAI.prototype.OnPackFinished = function(msg) |4135|4135| { |4136| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |4136|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |4137|4137| }; |4138|4138| |4139|4139| //// Helper functions to be called by the FSM //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4136|4136| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |4137|4137| }; |4138|4138| |4139| |-//// Helper functions to be called by the FSM //// | |4139|+// // Helper functions to be called by the FSM //// |4140|4140| |4141|4141| UnitAI.prototype.GetWalkSpeed = function() |4142|4142| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4801|4801| UnitAI.prototype.AttackEntityInZone = function(ents) |4802|4802| { |4803|4803| var target = ents.find(target => |4804| |- this.CanAttack(target) |4805| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4804|+ this.CanAttack(target) && | |4805|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4806|4806| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4807|4807| ); |4808|4808| if (!target) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4802|4802| { |4803|4803| var target = ents.find(target => |4804|4804| this.CanAttack(target) |4805| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4806| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4805|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4806|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4807|4807| ); |4808|4808| if (!target) |4809|4809| return false; | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4866|4866| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4867|4867| if (this.isGuardOf) |4868|4868| { |4869| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4869|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4870|4870| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4871|4871| if (cmpUnitAI && cmpAttack && |4872|4872| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (indent): | | Expected indentation of 3 tabs but found 4. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4870|4870| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4871|4871| if (cmpUnitAI && cmpAttack && |4872|4872| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4873| |- return false; | |4873|+ return false; |4874|4874| } |4875|4875| |4876|4876| // Stop if we're in hold-ground mode and it's too far from the holding point | | [NORMAL] ESLintBear (no-multi-spaces): | | Multiple spaces found before 'Engine'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4908|4908| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4909|4909| if (this.isGuardOf) |4910|4910| { |4911| |- let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4911|+ let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4912|4912| let cmpAttack = Engine.QueryInterface(target, IID_Attack); |4913|4913| if (cmpUnitAI && cmpAttack && |4914|4914| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |4921|4921| return false; |4922|4922| }; |4923|4923| |4924| |-//// External interface functions //// | |4924|+// // External interface functions //// |4925|4925| |4926|4926| UnitAI.prototype.SetFormationController = function(ent) |4927|4927| { | | [NORMAL] ESLintBear (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5077|5077| { |5078|5078| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |5079|5079| return; |5080| |- else |5081| |- this.RemoveGuard(); | |5080|+ this.RemoveGuard(); |5082|5081| } |5083|5082| |5084|5083| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [NORMAL] ESLintBear (no-trailing-spaces): | | Trailing spaces not allowed. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5419|5419| this.workOrders.length && this.workOrders[0].type == "Trade") |5420|5420| { |5421|5421| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5422| |- if (cmpTrader.HasBothMarkets() && | |5422|+ if (cmpTrader.HasBothMarkets() && |5423|5423| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5424|5424| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5425|5425| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5700|5700| { |5701|5701| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5702|5702| var targetClasses = this.order.data.targetClasses; |5703| |- if (targetClasses.attack && cmpIdentity |5704| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5703|+ if (targetClasses.attack && cmpIdentity && | |5704|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5705|5705| continue; |5706|5706| if (targetClasses.avoid && cmpIdentity |5707|5707| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5703|5703| if (targetClasses.attack && cmpIdentity |5704|5704| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5705|5705| continue; |5706| |- if (targetClasses.avoid && cmpIdentity |5707| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5706|+ if (targetClasses.avoid && cmpIdentity && | |5707|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5708|5708| continue; |5709|5709| // Only used by the AIs to prevent some choices of targets |5710|5710| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5726|5726| { |5727|5727| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5728|5728| var targetClasses = this.order.data.targetClasses; |5729| |- if (cmpIdentity && targetClasses.attack |5730| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5729|+ if (cmpIdentity && targetClasses.attack && | |5730|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5731|5731| continue; |5732|5732| if (cmpIdentity && targetClasses.avoid |5733|5733| && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5729|5729| if (cmpIdentity && targetClasses.attack |5730|5730| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5731|5731| continue; |5732| |- if (cmpIdentity && targetClasses.avoid |5733| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5732|+ if (cmpIdentity && targetClasses.avoid && | |5733|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5734|5734| continue; |5735|5735| // Only used by the AIs to prevent some choices of targets |5736|5736| if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ]) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required after '{'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5886|5886| |5887|5887| UnitAI.prototype.SetHeldPosition = function(x, z) |5888|5888| { |5889| |- this.heldPosition = {"x": x, "z": z}; | |5889|+ this.heldPosition = { "x": x, "z": z}; |5890|5890| }; |5891|5891| |5892|5892| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (object-curly-spacing): | | A space is required before '}'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5886|5886| |5887|5887| UnitAI.prototype.SetHeldPosition = function(x, z) |5888|5888| { |5889| |- this.heldPosition = {"x": x, "z": z}; | |5889|+ this.heldPosition = {"x": x, "z": z }; |5890|5890| }; |5891|5891| |5892|5892| UnitAI.prototype.SetHeldPositionOnEntity = function(entity) | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |5913|5913| return false; |5914|5914| }; |5915|5915| |5916| |-//// Helper functions //// | |5916|+// // Helper functions //// |5917|5917| |5918|5918| UnitAI.prototype.CanAttack = function(target) |5919|5919| { | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |6111|6111| return cmpPack && cmpPack.IsPacking(); |6112|6112| }; |6113|6113| |6114| |-//// Formation specific functions //// | |6114|+// // Formation specific functions //// |6115|6115| |6116|6116| UnitAI.prototype.IsAttackingAsFormation = function() |6117|6117| { | | [NORMAL] ESLintBear (operator-linebreak): | | '&&' should be placed at the end of the line. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |6116|6116| UnitAI.prototype.IsAttackingAsFormation = function() |6117|6117| { |6118|6118| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |6119| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |6120| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |6119|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |6120|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |6121|6121| }; |6122|6122| |6123|6123| //// Animal specific functions //// | | [NORMAL] ESLintBear (spaced-comment): | | Expected space or tab after '//' in comment. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |6120|6120| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |6121|6121| }; |6122|6122| |6123| |-//// Animal specific functions //// | |6123|+// // Animal specific functions //// |6124|6124| |6125|6125| UnitAI.prototype.MoveRandomly = function(distance) |6126|6126| { binaries/data/mods/public/simulation/components/UnitAI.js | 338| » » » return·true; | | [NORMAL] ESLintBear (consistent-return): | | Method 'Order.WalkToTarget' expected no return value. binaries/data/mods/public/simulation/components/UnitAI.js |1248| » » » » return·false; | | [NORMAL] ESLintBear (consistent-return): | | Method 'Timer' expected no return value. binaries/data/mods/public/simulation/components/UnitAI.js |3939| » 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 |4788| » 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 |4803| » 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 |4849| » 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 |4872| » » ····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 |2042| » » » » » » &&·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 |3077| » » » » » this.SetAnimationVariant(this.formationAnimationVariant) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |3886| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3970| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4805| » » &&·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 |4806| » » &&·(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 |5704| » » » » » » &&·!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 |5707| » » » » » » &&·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 |5720| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5721| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5727| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5728| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5730| » » » » &&·!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 |5733| » » » » &&·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 |5808| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5811| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5816| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5819| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5820| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5830| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5833| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |6120| » » &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING"; | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1673/display/redirect Comment Actions These changes are good regardless of a proper/different way of dealing with the two queries in EntitiesNearPoint.
|