Formation variants for members are not set correctly once they move because their ranks changes but variants do not get updated.
Details
Details
- Reviewers
- None
- Commits
- rP23233: Set correct animation variant for formation member when starts to move
:)
Diff Detail
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- /ps/trunk
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 10293 Build 17525: Vulcan Build Jenkins Build 17524: Vulcan Build (Windows) Jenkins Build 17523: arc lint + arc unit
Event Timeline
Comment Actions
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/749/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 (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 | 762| 762| this.FinishOrder(); | 763| 763| return; | 764| 764| } | 765| |- else | 766| |- { | | 765|+ | 767| 766| this.SetNextState("GARRISON.APPROACHING"); | 768| 767| return; | 769| |- } | | 768|+ | 770| 769| } | 771| 770| | 772| 771| 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 |1030|1030| }, |1031|1031| }, |1032|1032| |1033| |- "GARRISON":{ | |1033|+ "GARRISON": { |1034|1034| "enter": function() { |1035|1035| // If the garrisonholder should pickup, warn it so it can take needed action |1036|1036| var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder); | | [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 |1991|1991| |1992|1992| "Attacked": function(msg) { |1993|1993| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |1994| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |1995| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |1994|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |1995|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |1996|1996| this.RespondToTargetedEntities([msg.data.attacker]); |1997|1997| }, |1998|1998| }, | | [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 |2719|2719| { |2720|2720| // The building was already finished/fully repaired before we arrived; |2721|2721| // let the ConstructionFinished handler handle this. |2722| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2722|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2723|2723| return true; |2724|2724| } |2725|2725| | | [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 |2719|2719| { |2720|2720| // The building was already finished/fully repaired before we arrived; |2721|2721| // let the ConstructionFinished handler handle this. |2722| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2722|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2723|2723| return true; |2724|2724| } |2725|2725| | | [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 |3232|3232| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3233|3233| |3234|3234| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3235| |- // only used for domestic animals | |3235|+ // only used for domestic animals |3236|3236| }, |3237|3237| }; |3238|3238| | | [NORMAL] ESLintBear (no-unneeded-ternary): | | Unnecessary use of boolean literals in conditional expression. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |3289|3289| |3290|3290| UnitAI.prototype.IsAnimal = function() |3291|3291| { |3292| |- return (this.template.NaturalBehaviour ? true : false); | |3292|+ return (!!this.template.NaturalBehaviour); |3293|3293| }; |3294|3294| |3295|3295| UnitAI.prototype.IsDangerousAnimal = function() | | [NORMAL] ESLintBear (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 |3405|3405| { |3406|3406| let index = this.GetCurrentState().indexOf("."); |3407|3407| if (index != -1) |3408| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3408|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3409|3409| this.Stop(false); |3410|3410| } |3411|3411| | | [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 |3461|3461| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3462|3462| continue; |3463|3463| if (i == 0) |3464| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3464|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3465|3465| else |3466|3466| this.orderQueue.splice(i, 1); |3467|3467| 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 |3461|3461| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3462|3462| continue; |3463|3463| if (i == 0) |3464| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3464|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3465|3465| else |3466|3466| this.orderQueue.splice(i, 1); |3467|3467| 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 |3545|3545| }; |3546|3546| |3547|3547| |3548| |-//// FSM linkage functions //// | |3548|+// // FSM linkage functions //// |3549|3549| |3550|3550| // Setting the next state to the current state will leave/re-enter the top-most substate. |3551|3551| 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 |3715|3715| continue; |3716|3716| if (this.orderQueue[i].type == type) |3717|3717| continue; |3718| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3718|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3719|3719| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3720|3720| return; |3721|3721| } | | [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 |3715|3715| continue; |3716|3716| if (this.orderQueue[i].type == type) |3717|3717| continue; |3718| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3718|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3719|3719| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3720|3720| return; |3721|3721| } | | [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 |3886|3886| if (data.timerRepeat === undefined) |3887|3887| this.timer = undefined; |3888|3888| |3889| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3889|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |3890|3890| }; |3891|3891| |3892|3892| /** | | [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 |3886|3886| if (data.timerRepeat === undefined) |3887|3887| this.timer = undefined; |3888|3888| |3889| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |3889|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |3890|3890| }; |3891|3891| |3892|3892| /** | | [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 |3931|3931| // TODO: This is a bit inefficient since every unit listens to every |3932|3932| // construction message - ideally we could scope it to only the one we're building |3933|3933| |3934| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3934|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |3935|3935| }; |3936|3936| |3937|3937| 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 |3931|3931| // TODO: This is a bit inefficient since every unit listens to every |3932|3932| // construction message - ideally we could scope it to only the one we're building |3933|3933| |3934| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |3934|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |3935|3935| }; |3936|3936| |3937|3937| 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 |3956|3956| |3957|3957| UnitAI.prototype.OnAttacked = function(msg) |3958|3958| { |3959| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3959|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |3960|3960| }; |3961|3961| |3962|3962| 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 |3956|3956| |3957|3957| UnitAI.prototype.OnAttacked = function(msg) |3958|3958| { |3959| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |3959|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |3960|3960| }; |3961|3961| |3962|3962| 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 |3961|3961| |3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg) |3963|3963| { |3964| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3964|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |3965|3965| }; |3966|3966| |3967|3967| 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 |3961|3961| |3962|3962| UnitAI.prototype.OnGuardedAttacked = function(msg) |3963|3963| { |3964| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |3964|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |3965|3965| }; |3966|3966| |3967|3967| 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 |3966|3966| |3967|3967| UnitAI.prototype.OnHealthChanged = function(msg) |3968|3968| { |3969| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3969|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |3970|3970| }; |3971|3971| |3972|3972| 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 |3966|3966| |3967|3967| UnitAI.prototype.OnHealthChanged = function(msg) |3968|3968| { |3969| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |3969|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |3970|3970| }; |3971|3971| |3972|3972| 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 |3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg) |3973|3973| { |3974|3974| if (msg.tag == this.losRangeQuery) |3975| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3975|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |3976|3976| else if (msg.tag == this.losHealRangeQuery) |3977|3977| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3978|3978| }; | | [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 |3972|3972| UnitAI.prototype.OnRangeUpdate = function(msg) |3973|3973| { |3974|3974| if (msg.tag == this.losRangeQuery) |3975| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |3975|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |3976|3976| else if (msg.tag == this.losHealRangeQuery) |3977|3977| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |3978|3978| }; | | [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 |3974|3974| if (msg.tag == this.losRangeQuery) |3975|3975| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3976|3976| else if (msg.tag == this.losHealRangeQuery) |3977| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3977|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |3978|3978| }; |3979|3979| |3980|3980| 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 |3974|3974| if (msg.tag == this.losRangeQuery) |3975|3975| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |3976|3976| else if (msg.tag == this.losHealRangeQuery) |3977| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |3977|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |3978|3978| }; |3979|3979| |3980|3980| 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 |3979|3979| |3980|3980| UnitAI.prototype.OnPackFinished = function(msg) |3981|3981| { |3982| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3982|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |3983|3983| }; |3984|3984| |3985|3985| //// 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 |3979|3979| |3980|3980| UnitAI.prototype.OnPackFinished = function(msg) |3981|3981| { |3982| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |3982|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |3983|3983| }; |3984|3984| |3985|3985| //// 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 |3982|3982| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |3983|3983| }; |3984|3984| |3985| |-//// Helper functions to be called by the FSM //// | |3985|+// // Helper functions to be called by the FSM //// |3986|3986| |3987|3987| UnitAI.prototype.GetWalkSpeed = function() |3988|3988| { | | [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 |4650|4650| UnitAI.prototype.AttackEntityInZone = function(ents) |4651|4651| { |4652|4652| var target = ents.find(target => |4653| |- this.CanAttack(target) |4654| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4653|+ this.CanAttack(target) && | |4654|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4655|4655| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4656|4656| ); |4657|4657| 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 |4651|4651| { |4652|4652| var target = ents.find(target => |4653|4653| this.CanAttack(target) |4654| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4655| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4654|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4655|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4656|4656| ); |4657|4657| if (!target) |4658|4658| 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 |4715|4715| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |4716|4716| if (this.isGuardOf) |4717|4717| { |4718| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4718|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4719|4719| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4720|4720| if (cmpUnitAI && cmpAttack && |4721|4721| 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 |4719|4719| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |4720|4720| if (cmpUnitAI && cmpAttack && |4721|4721| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |4722| |- return false; | |4722|+ return false; |4723|4723| } |4724|4724| |4725|4725| // 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 |4757|4757| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |4758|4758| if (this.isGuardOf) |4759|4759| { |4760| |- let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |4760|+ let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |4761|4761| let cmpAttack = Engine.QueryInterface(target, IID_Attack); |4762|4762| if (cmpUnitAI && cmpAttack && |4763|4763| 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 |4770|4770| return false; |4771|4771| }; |4772|4772| |4773| |-//// External interface functions //// | |4773|+// // External interface functions //// |4774|4774| |4775|4775| UnitAI.prototype.SetFormationController = function(ent) |4776|4776| { | | [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 |4926|4926| { |4927|4927| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |4928|4928| return; |4929| |- else |4930| |- this.RemoveGuard(); | |4929|+ this.RemoveGuard(); |4931|4930| } |4932|4931| |4933|4932| 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 |5258|5258| this.workOrders.length && this.workOrders[0].type == "Trade") |5259|5259| { |5260|5260| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5261| |- if (cmpTrader.HasBothMarkets() && | |5261|+ if (cmpTrader.HasBothMarkets() && |5262|5262| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5263|5263| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5264|5264| { | | [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 |5539|5539| { |5540|5540| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5541|5541| var targetClasses = this.order.data.targetClasses; |5542| |- if (targetClasses.attack && cmpIdentity |5543| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5542|+ if (targetClasses.attack && cmpIdentity && | |5543|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5544|5544| continue; |5545|5545| if (targetClasses.avoid && cmpIdentity |5546|5546| && 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 |5542|5542| if (targetClasses.attack && cmpIdentity |5543|5543| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5544|5544| continue; |5545| |- if (targetClasses.avoid && cmpIdentity |5546| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5545|+ if (targetClasses.avoid && cmpIdentity && | |5546|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5547|5547| continue; |5548|5548| // Only used by the AIs to prevent some choices of targets |5549|5549| 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 |5565|5565| { |5566|5566| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5567|5567| var targetClasses = this.order.data.targetClasses; |5568| |- if (cmpIdentity && targetClasses.attack |5569| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5568|+ if (cmpIdentity && targetClasses.attack && | |5569|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5570|5570| continue; |5571|5571| if (cmpIdentity && targetClasses.avoid |5572|5572| && 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 |5568|5568| if (cmpIdentity && targetClasses.attack |5569|5569| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5570|5570| continue; |5571| |- if (cmpIdentity && targetClasses.avoid |5572| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5571|+ if (cmpIdentity && targetClasses.avoid && | |5572|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5573|5573| continue; |5574|5574| // Only used by the AIs to prevent some choices of targets |5575|5575| 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 |5725|5725| |5726|5726| UnitAI.prototype.SetHeldPosition = function(x, z) |5727|5727| { |5728| |- this.heldPosition = {"x": x, "z": z}; | |5728|+ this.heldPosition = { "x": x, "z": z}; |5729|5729| }; |5730|5730| |5731|5731| 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 |5725|5725| |5726|5726| UnitAI.prototype.SetHeldPosition = function(x, z) |5727|5727| { |5728| |- this.heldPosition = {"x": x, "z": z}; | |5728|+ this.heldPosition = {"x": x, "z": z }; |5729|5729| }; |5730|5730| |5731|5731| 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 |5752|5752| return false; |5753|5753| }; |5754|5754| |5755| |-//// Helper functions //// | |5755|+// // Helper functions //// |5756|5756| |5757|5757| UnitAI.prototype.CanAttack = function(target) |5758|5758| { | | [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 |5956|5956| return cmpPack && cmpPack.IsPacking(); |5957|5957| }; |5958|5958| |5959| |-//// Formation specific functions //// | |5959|+// // Formation specific functions //// |5960|5960| |5961|5961| UnitAI.prototype.IsAttackingAsFormation = function() |5962|5962| { | | [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 |5961|5961| UnitAI.prototype.IsAttackingAsFormation = function() |5962|5962| { |5963|5963| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |5964| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |5965| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |5964|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |5965|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5966|5966| }; |5967|5967| |5968|5968| //// 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 |5965|5965| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |5966|5966| }; |5967|5967| |5968| |-//// Animal specific functions //// | |5968|+// // Animal specific functions //// |5969|5969| |5970|5970| UnitAI.prototype.MoveRandomly = function(distance) |5971|5971| { binaries/data/mods/public/simulation/components/UnitAI.js | 331| » » » return·true; | | [NORMAL] ESLintBear (consistent-return): | | Method 'Order.WalkToTarget' expected no return value. binaries/data/mods/public/simulation/components/UnitAI.js | 917| » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js | 942| » » » "enter":·function(msg)·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js | 992| » » » » » return·true; | | [NORMAL] ESLintBear (consistent-return): | | Method 'enter' expected no return value. binaries/data/mods/public/simulation/components/UnitAI.js |1055| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1091| » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1123| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1283| » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1345| » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1527| » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1549| » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1581| » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1735| » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1785| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |1863| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |2040| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |2156| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |2431| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |2464| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |2570| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |2636| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |2675| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |2886| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |3067| » » » » "enter":·function()·{ | | [NORMAL] ESLintBear (consistent-return): | | Expected to return a value at the end of method 'enter'. binaries/data/mods/public/simulation/components/UnitAI.js |3791| » 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 |4637| » 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 |4652| » 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 |4698| » 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 |4721| » » ····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 |1995| » » » » » » &&·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 |3753| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |3822| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4654| » » &&·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 |4655| » » &&·(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 |5543| » » » » » » &&·!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 |5546| » » » » » » &&·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 |5559| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5560| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5566| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5567| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5569| » » » » &&·!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 |5572| » » » » &&·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 |5647| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5650| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5655| » » var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid); | | [NORMAL] JSHintBear: | | 'cmpRanged' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5658| » » var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5659| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5669| » » var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision); | | [NORMAL] JSHintBear: | | 'cmpVision' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5672| » » var·range·=·cmpVision.GetRange(); | | [NORMAL] JSHintBear: | | 'range' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5965| » » &&·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/1265/display/redirect