Fix oversights from rP23856, namely:
- Re-alphabetise wall templates.
- Inactivate obstruction when occupying a turret.
Differential D2896
Fix oversights from rP23856. Freagarach on Jul 20 2020, 1:27 PM. Authored by
Details
Fix oversights from rP23856, namely:
Check that everything was moved correctly.
Diff Detail
Event TimelineComment Actions While at it, could you rename <Archer1>, <Archer2>, etc. to <One>, <Two>, etc.? They're not necessarily archers. Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2723/display/redirect Comment Actions While I understand your request I would like this fix to be concise ^^ Comment Actions Successful build - Chance fights ever on the side of the prudent. Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2724/display/redirect Comment Actions I am not fan of this just to make it alphabetical. This will destroy blame and it will be harder to track when important changes were made. 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 | 794| 794| this.FinishOrder(); | 795| 795| return; | 796| 796| } | 797| |- else | 798| |- { | | 797|+ | 799| 798| this.SetNextState("GARRISON.APPROACHING"); | 800| 799| return; | 801| |- } | | 800|+ | 802| 801| } | 803| 802| | 804| 803| 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 |1058|1058| }, |1059|1059| }, |1060|1060| |1061| |- "GARRISON":{ | |1061|+ "GARRISON": { |1062|1062| "APPROACHING": { |1063|1063| "enter": function() { |1064|1064| 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 |2060|2060| |2061|2061| "Attacked": function(msg) { |2062|2062| // If we are capturing and are attacked by something that we would not capture, attack that entity instead |2063| |- if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) |2064| |- && this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") | |2063|+ if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) && | |2064|+ this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture") |2065|2065| this.RespondToTargetedEntities([msg.data.attacker]); |2066|2066| }, |2067|2067| }, | | [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 |2219|2219| "MovementUpdate": function(msg) { |2220|2220| // If it looks like the path is failing, and we are close enough (3 tiles) from wanted range |2221|2221| // stop anyways. This avoids pathing for an unreachable goal and reduces lag considerably. |2222| |- if (msg.likelyFailure || | |2222|+ if (msg.likelyFailure || |2223|2223| msg.obstructed && this.RelaxedMaxRangeCheck(this.order.data, this.order.data.max + this.DefaultRelaxedMaxRange) || |2224|2224| !msg.obstructed && this.CheckRange(this.order.data)) |2225|2225| this.FinishOrder(); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 7 tabs but found 6. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js |2522|2522| |2523|2523| return type.specific == resourceType.specific && |2524|2524| (type.specific != "meat" || resourceTemplate == template); |2525| |- }); | |2525|+ }); |2526|2526| |2527|2527| if (nearbyResource) |2528|2528| { | | [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 |2854|2854| { |2855|2855| // The building was already finished/fully repaired before we arrived; |2856|2856| // let the ConstructionFinished handler handle this. |2857| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2857|+ this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget}); |2858|2858| return true; |2859|2859| } |2860|2860| | | [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 |2854|2854| { |2855|2855| // The building was already finished/fully repaired before we arrived; |2856|2856| // let the ConstructionFinished handler handle this. |2857| |- this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget}); | |2857|+ this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget }); |2858|2858| return true; |2859|2859| } |2860|2860| | | [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 |3144|3144| this.StopTimer(); |3145|3145| this.ResetAnimation(); |3146|3146| if (this.formationAnimationVariant) |3147| |- this.SetAnimationVariant(this.formationAnimationVariant) | |3147|+ this.SetAnimationVariant(this.formationAnimationVariant); |3148|3148| else |3149|3149| this.SetDefaultAnimationVariant(); |3150|3150| 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 |3370|3370| "COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals |3371|3371| |3372|3372| "WALKING": "INDIVIDUAL.WALKING", // reuse the same walking behaviour for animals |3373| |- // only used for domestic animals | |3373|+ // only used for domestic animals |3374|3374| |3375|3375| // Reuse the same garrison behaviour for animals. |3376|3376| "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 |3420|3420| |3421|3421| UnitAI.prototype.IsAnimal = function() |3422|3422| { |3423| |- return (this.template.NaturalBehaviour ? true : false); | |3423|+ return (!!this.template.NaturalBehaviour); |3424|3424| }; |3425|3425| |3426|3426| 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 |3560|3560| { |3561|3561| let index = this.GetCurrentState().indexOf("."); |3562|3562| if (index != -1) |3563| |- this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index)); | |3563|+ this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index)); |3564|3564| this.Stop(false); |3565|3565| } |3566|3566| | | [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 |3616|3616| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3617|3617| continue; |3618|3618| if (i == 0) |3619| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3619|+ this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg}); |3620|3620| else |3621|3621| this.orderQueue.splice(i, 1); |3622|3622| 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 |3616|3616| if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity) |3617|3617| continue; |3618|3618| if (i == 0) |3619| |- this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg}); | |3619|+ this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg }); |3620|3620| else |3621|3621| this.orderQueue.splice(i, 1); |3622|3622| 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 |3703|3703| }; |3704|3704| |3705|3705| |3706| |-//// FSM linkage functions //// | |3706|+// // FSM linkage functions //// |3707|3707| |3708|3708| // Setting the next state to the current state will leave/re-enter the top-most substate. |3709|3709| 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 |3876|3876| continue; |3877|3877| if (this.orderQueue[i].type == type) |3878|3878| continue; |3879| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3879|+ this.orderQueue.splice(i, 0, { "type": type, "data": data}); |3880|3880| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3881|3881| return; |3882|3882| } | | [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 |3876|3876| continue; |3877|3877| if (this.orderQueue[i].type == type) |3878|3878| continue; |3879| |- this.orderQueue.splice(i, 0, {"type": type, "data": data}); | |3879|+ this.orderQueue.splice(i, 0, {"type": type, "data": data }); |3880|3880| Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() }); |3881|3881| return; |3882|3882| } | | [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 |4117|4117| if (data.timerRepeat === undefined) |4118|4118| this.timer = undefined; |4119|4119| |4120| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |4120|+ this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness}); |4121|4121| }; |4122|4122| |4123|4123| /** | | [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 |4117|4117| if (data.timerRepeat === undefined) |4118|4118| this.timer = undefined; |4119|4119| |4120| |- this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness}); | |4120|+ this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness }); |4121|4121| }; |4122|4122| |4123|4123| /** | | [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 |4162|4162| // TODO: This is a bit inefficient since every unit listens to every |4163|4163| // construction message - ideally we could scope it to only the one we're building |4164|4164| |4165| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |4165|+ this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg}); |4166|4166| }; |4167|4167| |4168|4168| 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 |4162|4162| // TODO: This is a bit inefficient since every unit listens to every |4163|4163| // construction message - ideally we could scope it to only the one we're building |4164|4164| |4165| |- this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg}); | |4165|+ this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg }); |4166|4166| }; |4167|4167| |4168|4168| 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 |4201|4201| if (msg.fromStatusEffect) |4202|4202| return; |4203|4203| |4204| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |4204|+ this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg}); |4205|4205| }; |4206|4206| |4207|4207| 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 |4201|4201| if (msg.fromStatusEffect) |4202|4202| return; |4203|4203| |4204| |- this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg}); | |4204|+ this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg }); |4205|4205| }; |4206|4206| |4207|4207| 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 |4206|4206| |4207|4207| UnitAI.prototype.OnGuardedAttacked = function(msg) |4208|4208| { |4209| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |4209|+ this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data}); |4210|4210| }; |4211|4211| |4212|4212| 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 |4206|4206| |4207|4207| UnitAI.prototype.OnGuardedAttacked = function(msg) |4208|4208| { |4209| |- this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data}); | |4209|+ this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data }); |4210|4210| }; |4211|4211| |4212|4212| 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 |4211|4211| |4212|4212| UnitAI.prototype.OnHealthChanged = function(msg) |4213|4213| { |4214| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |4214|+ this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to}); |4215|4215| }; |4216|4216| |4217|4217| 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 |4211|4211| |4212|4212| UnitAI.prototype.OnHealthChanged = function(msg) |4213|4213| { |4214| |- this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to}); | |4214|+ this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to }); |4215|4215| }; |4216|4216| |4217|4217| 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 |4217|4217| UnitAI.prototype.OnRangeUpdate = function(msg) |4218|4218| { |4219|4219| if (msg.tag == this.losRangeQuery) |4220| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |4220|+ this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg}); |4221|4221| else if (msg.tag == this.losHealRangeQuery) |4222|4222| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |4223|4223| }; | | [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 |4217|4217| UnitAI.prototype.OnRangeUpdate = function(msg) |4218|4218| { |4219|4219| if (msg.tag == this.losRangeQuery) |4220| |- this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); | |4220|+ this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg }); |4221|4221| else if (msg.tag == this.losHealRangeQuery) |4222|4222| this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); |4223|4223| }; | | [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 |4219|4219| if (msg.tag == this.losRangeQuery) |4220|4220| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |4221|4221| else if (msg.tag == this.losHealRangeQuery) |4222| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |4222|+ this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg}); |4223|4223| }; |4224|4224| |4225|4225| 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 |4219|4219| if (msg.tag == this.losRangeQuery) |4220|4220| this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg}); |4221|4221| else if (msg.tag == this.losHealRangeQuery) |4222| |- this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg}); | |4222|+ this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg }); |4223|4223| }; |4224|4224| |4225|4225| 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 |4224|4224| |4225|4225| UnitAI.prototype.OnPackFinished = function(msg) |4226|4226| { |4227| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |4227|+ this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed}); |4228|4228| }; |4229|4229| |4230|4230| //// 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 |4224|4224| |4225|4225| UnitAI.prototype.OnPackFinished = function(msg) |4226|4226| { |4227| |- this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); | |4227|+ this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed }); |4228|4228| }; |4229|4229| |4230|4230| //// 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 |4227|4227| this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed}); |4228|4228| }; |4229|4229| |4230| |-//// Helper functions to be called by the FSM //// | |4230|+// // Helper functions to be called by the FSM //// |4231|4231| |4232|4232| UnitAI.prototype.GetWalkSpeed = function() |4233|4233| { | | [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 |4957|4957| UnitAI.prototype.AttackEntityInZone = function(ents) |4958|4958| { |4959|4959| var target = ents.find(target => |4960| |- this.CanAttack(target) |4961| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) | |4960|+ this.CanAttack(target) && | |4961|+ this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4962|4962| && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4963|4963| ); |4964|4964| 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 |4958|4958| { |4959|4959| var target = ents.find(target => |4960|4960| this.CanAttack(target) |4961| |- && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) |4962| |- && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) | |4961|+ && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) && | |4962|+ (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target)) |4963|4963| ); |4964|4964| if (!target) |4965|4965| 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 |5024|5024| // If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker |5025|5025| if (this.isGuardOf) |5026|5026| { |5027| |- var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |5027|+ var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |5028|5028| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |5029|5029| if (cmpUnitAI && cmpAttack && |5030|5030| 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 |5028|5028| var cmpAttack = Engine.QueryInterface(target, IID_Attack); |5029|5029| if (cmpUnitAI && cmpAttack && |5030|5030| cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type))) |5031| |- return false; | |5031|+ return false; |5032|5032| } |5033|5033| |5034|5034| // 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 |5066|5066| // If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker |5067|5067| if (this.isGuardOf) |5068|5068| { |5069| |- let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); | |5069|+ let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI); |5070|5070| let cmpAttack = Engine.QueryInterface(target, IID_Attack); |5071|5071| if (cmpUnitAI && cmpAttack && |5072|5072| 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 |5079|5079| return false; |5080|5080| }; |5081|5081| |5082| |-//// External interface functions //// | |5082|+// // External interface functions //// |5083|5083| |5084|5084| UnitAI.prototype.SetFormationController = function(ent) |5085|5085| { | | [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 |5235|5235| { |5236|5236| if (this.isGuardOf == target && this.order && this.order.type == "Guard") |5237|5237| return; |5238| |- else |5239| |- this.RemoveGuard(); | |5238|+ this.RemoveGuard(); |5240|5239| } |5241|5240| |5242|5241| this.AddOrder("Guard", { "target": target, "force": false }, queued); | | [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 |5569|5569| |5570|5570| if (this.IsFormationController()) |5571|5571| this.CallMemberFunction("CancelSetupTradeRoute", [target]); |5572| |-} | |5572|+}; |5573|5573| /** |5574|5574| * Adds trade order to the queue. Either walk to the first market, or |5575|5575| * start a new route. Not forced, so it can be interrupted by attacks. | | [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 |5590|5590| this.workOrders.length && this.workOrders[0].type == "Trade") |5591|5591| { |5592|5592| let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader); |5593| |- if (cmpTrader.HasBothMarkets() && | |5593|+ if (cmpTrader.HasBothMarkets() && |5594|5594| (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source || |5595|5595| cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target)) |5596|5596| { | | [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 |5871|5871| { |5872|5872| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5873|5873| var targetClasses = this.order.data.targetClasses; |5874| |- if (targetClasses.attack && cmpIdentity |5875| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5874|+ if (targetClasses.attack && cmpIdentity && | |5875|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5876|5876| continue; |5877|5877| if (targetClasses.avoid && cmpIdentity |5878|5878| && 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 |5874|5874| if (targetClasses.attack && cmpIdentity |5875|5875| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5876|5876| continue; |5877| |- if (targetClasses.avoid && cmpIdentity |5878| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5877|+ if (targetClasses.avoid && cmpIdentity && | |5878|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5879|5879| continue; |5880|5880| // Only used by the AIs to prevent some choices of targets |5881|5881| 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 |5897|5897| { |5898|5898| var cmpIdentity = Engine.QueryInterface(targ, IID_Identity); |5899|5899| var targetClasses = this.order.data.targetClasses; |5900| |- if (cmpIdentity && targetClasses.attack |5901| |- && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) | |5900|+ if (cmpIdentity && targetClasses.attack && | |5901|+ !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5902|5902| continue; |5903|5903| if (cmpIdentity && targetClasses.avoid |5904|5904| && 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 |5900|5900| if (cmpIdentity && targetClasses.attack |5901|5901| && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack)) |5902|5902| continue; |5903| |- if (cmpIdentity && targetClasses.avoid |5904| |- && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) | |5903|+ if (cmpIdentity && targetClasses.avoid && | |5904|+ MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid)) |5905|5905| continue; |5906|5906| // Only used by the AIs to prevent some choices of targets |5907|5907| 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 |6060|6060| |6061|6061| UnitAI.prototype.SetHeldPosition = function(x, z) |6062|6062| { |6063| |- this.heldPosition = {"x": x, "z": z}; | |6063|+ this.heldPosition = { "x": x, "z": z}; |6064|6064| }; |6065|6065| |6066|6066| 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 |6060|6060| |6061|6061| UnitAI.prototype.SetHeldPosition = function(x, z) |6062|6062| { |6063| |- this.heldPosition = {"x": x, "z": z}; | |6063|+ this.heldPosition = {"x": x, "z": z }; |6064|6064| }; |6065|6065| |6066|6066| 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 |6087|6087| return false; |6088|6088| }; |6089|6089| |6090| |-//// Helper functions //// | |6090|+// // Helper functions //// |6091|6091| |6092|6092| /** |6093|6093| * General getter for ranges. | | [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 |6106|6106| return undefined; |6107|6107| |6108|6108| return component.GetRange(type); |6109| |-} | |6109|+}; |6110|6110| |6111|6111| UnitAI.prototype.CanAttack = function(target) |6112|6112| { | | [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 |6282|6282| return cmpPack && cmpPack.IsPacking(); |6283|6283| }; |6284|6284| |6285| |-//// Formation specific functions //// | |6285|+// // Formation specific functions //// |6286|6286| |6287|6287| UnitAI.prototype.IsAttackingAsFormation = function() |6288|6288| { | | [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 |6287|6287| UnitAI.prototype.IsAttackingAsFormation = function() |6288|6288| { |6289|6289| var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack); |6290| |- return cmpAttack && cmpAttack.CanAttackAsFormation() |6291| |- && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; | |6290|+ return cmpAttack && cmpAttack.CanAttackAsFormation() && | |6291|+ this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |6292|6292| }; |6293|6293| |6294|6294| //// 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 |6291|6291| && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING"; |6292|6292| }; |6293|6293| |6294| |-//// Animal specific functions //// | |6294|+// // Animal specific functions //// |6295|6295| |6296|6296| UnitAI.prototype.MoveRandomly = function(distance) |6297|6297| { | | [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 |6342|6342| { |6343|6343| let cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion); |6344|6344| return cmpUnitMotion && cmpUnitMotion.GetFacePointAfterMove(); |6345| |-} | |6345|+}; |6346|6346| |6347|6347| UnitAI.prototype.AttackEntitiesByPreference = function(ents) |6348|6348| { binaries/data/mods/public/simulation/components/UnitAI.js | 345| » » » return·true; | | [NORMAL] ESLintBear (consistent-return): | | Method 'Order.WalkToTarget' expected no return value. binaries/data/mods/public/simulation/components/UnitAI.js |4022| » 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 |4944| » 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 |4959| » 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 |5007| » 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 |5030| » » ····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 |2064| » » » » » » &&·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 |3147| » » » » » this.SetAnimationVariant(this.formationAnimationVariant) | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |3969| » » var·order·=·{·"type":·type,·"data":·data·}; | | [NORMAL] JSHintBear: | | 'order' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4053| » for·(var·i·=·0;·i·<·this.orderQueue.length;·++i) | | [NORMAL] JSHintBear: | | 'i' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |4961| » » &&·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 |4962| » » &&·(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 |5572| } | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |5875| » » » » » » &&·!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 |5878| » » » » » » &&·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 |5891| » var·targets·=·this.GetTargetsFromUnit(); | | [NORMAL] JSHintBear: | | 'targets' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5892| » for·(var·targ·of·targets) | | [NORMAL] JSHintBear: | | 'targ' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5898| » » » var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity); | | [NORMAL] JSHintBear: | | 'cmpIdentity' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5899| » » » var·targetClasses·=·this.order.data.targetClasses; | | [NORMAL] JSHintBear: | | 'targetClasses' is already defined. binaries/data/mods/public/simulation/components/UnitAI.js |5901| » » » » &&·!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 |5904| » » » » &&·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 |6109| } | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/components/UnitAI.js |6291| » » &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING"; | | [NORMAL] JSHintBear: | | Misleading line break before '&&'; readers may interpret this as an expression boundary. binaries/data/mods/public/simulation/components/UnitAI.js |6345| } | | [NORMAL] JSHintBear: | | Missing semicolon. Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2730/display/redirect Comment Actions Thanks, placing units on gates works again: Also, the template changes are complete and correct. Comment Actions Thank you for testing! Comment Actions
|