getCounteredClasses returns NaN as multiplier for counter because of missing slash when building string
Details
Details
- Reviewers
vladislavbelov - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP22401: Fix missing slash in common-api of entity. The mistype was introduced in…
:)
Diff Detail
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'for-of'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js | 33| 33| { | 34| 34| let args = string.split("/"); | 35| 35| for (let arg of args) | 36| |- { | | 36|+ | 37| 37| if (value[arg]) | 38| 38| value = value[arg]; | 39| 39| else | 41| 41| value = undefined; | 42| 42| break; | 43| 43| } | 44| |- } | | 44|+ | 45| 45| this._tpCache.set(string, value); | 46| 46| } | 47| 47| return this._tpCache.get(string); | | [NORMAL] ESLintBear (curly): | | Unnecessary { after 'if' condition. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/ai/common-api/entity.js | 308| 308| return undefined; | 309| 309| | 310| 310| if (this.get("Attack/" + type + "/Bonuses")) | 311| |- { | | 311|+ | 312| 312| for (let b in this.get("Attack/" + type + "/Bonuses")) | 313| 313| { | 314| 314| let bonusClasses = this.get("Attack/" + type + "/Bonuses/" + b + "/Classes"); | 318| 318| if (bcl == againstClass) | 319| 319| return +this.get("Attack/" + type + "/Bonuses/" + b + "/Multiplier"); | 320| 320| } | 321| |- } | | 321|+ | 322| 322| return 1; | 323| 323| }, | 324| 324| binaries/data/mods/public/simulation/ai/common-api/entity.js | 798| » » if·(this.position()·!==·undefined)·{ | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Opening curly brace appears on the same line as controlling statement. binaries/data/mods/public/simulation/ai/common-api/entity.js | 815| » » if·(this.position()·!==·undefined·&&·unitToFleeFrom.position()·!==·undefined)·{ | | [NORMAL] ESLintBear (brace-rules/brace-on-same-line): | | Opening curly brace appears on the same line as controlling statement. binaries/data/mods/public/simulation/ai/common-api/entity.js | 945| }(API3); | | [MAJOR] ESLintBear (no-use-before-define): | | 'API3' was used before it was defined. Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/differential/1758/display/redirect
Comment Actions
@vladislavbelov no steps to reproduce needed it is look and see situation
Without patch it is:
this.get("Attack/Ranged/BonusesClass1/Multiplier")
what is wrong just by looking at it
instead
this.get("Attack/Ranged/Bonuses/Class1/Multiplier")