As mentioned in D1938, TakeDamage should check for cmpHealth before trying to subtract Health.
Details
Details
- Reviewers
- None
- Group Reviewers
Restricted Owners Package (Owns No Changed Paths)
Check that everything works as before.
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 8150 Build 13272: Vulcan Build Jenkins Build 13271: arc lint + arc unit
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 (no-else-return): | | Unnecessary 'else' after 'return'. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Armour.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Armour.js | 56| 56| let cmpHealth = Engine.QueryInterface(this.entity, IID_Health); | 57| 57| if (cmpHealth) | 58| 58| return cmpHealth.Reduce(total); | 59| |- else | 60| |- return { "killed": false, "change": 0 }; | | 59|+ return { "killed": false, "change": 0 }; | 61| 60| }; | 62| 61| | 63| 62| Armour.prototype.GetArmourStrengths = function() Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/differential/1848/display/redirect
binaries/data/mods/public/simulation/components/Armour.js | ||
---|---|---|
60 | I'm not sure it should work because that would obviously be a bug no ? |
binaries/data/mods/public/simulation/components/Armour.js | ||
---|---|---|
60 | I wonder if it would have sense to have armour but no health, so this could warn or error before return. I dont see reason why it would be bug. |
binaries/data/mods/public/simulation/components/Armour.js | ||
---|---|---|
60 | Else could be nuked btw. Cause you return. Well it might give the impression the code is working as expected (no warning) while it isn't |
Comment Actions
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/differential/1870/display/redirect