Following rP22029 I dwelled in the fogging code. Some confusion could have been avoided by some comments.
Also early-exit the loop to avoid doing un-necessary js->c++ transitions.
Differential D1737
Slight cleanup of fogging OnDestroy and some comments wraitii on Jan 6 2019, 11:54 AM. Authored by
Details
Following rP22029 I dwelled in the fogging code. Some confusion could have been avoided by some comments. Also early-exit the loop to avoid doing un-necessary js->c++ transitions. Code review.
Diff Detail
Event TimelineComment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Mirage.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Mirage.js | 73| 73| this.classesList = clone(cmpIdentity.GetClassesList()); | 74| 74| }; | 75| 75| | 76| |-Mirage.prototype.GetClassesList = function() { return this.classesList }; | | 76|+Mirage.prototype.GetClassesList = function() { return this.classesList; }; | 77| 77| | 78| 78| // Foundation data | 79| 79| binaries/data/mods/public/simulation/components/Mirage.js | 76| Mirage.prototype.GetClassesList·=·function()·{·return·this.classesList·}; | | [NORMAL] JSHintBear: | | Missing semicolon. Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/differential/933/
Comment Actions Successful build - Chance fights ever on the side of the prudent. Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Mirage.js | |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/simulation/components/Mirage.js | 73| 73| this.classesList = clone(cmpIdentity.GetClassesList()); | 74| 74| }; | 75| 75| | 76| |-Mirage.prototype.GetClassesList = function() { return this.classesList }; | | 76|+Mirage.prototype.GetClassesList = function() { return this.classesList; }; | 77| 77| | 78| 78| // Foundation data | 79| 79| binaries/data/mods/public/simulation/components/Mirage.js | 76| Mirage.prototype.GetClassesList·=·function()·{·return·this.classesList·}; | | [NORMAL] JSHintBear: | | Missing semicolon. Executing section cli... Link to build: https://jenkins.wildfiregames.com/job/differential/940/
Comment Actions Thanks for performing the changes and sorry for not going back on this immediately. I agree with the merging of the functions, because we indeed often use OwnershipChanged for gameplay stuff whereas Destroy is seen as a rather low-level message. Additionally it's always better to associate miraging code with ownership concepts. I'm accepting but I would be happy if you'd use the opportunity to add the semicolon detected by the linter when you commit. Comment Actions comment I had laying around:
Comment Actions @bb Could you create a ticket for that? It sounds like we should indeed take a look at this and make the use of OwnershipChanged over Destroy consistent, and put explicit comments where one is needed over the other. ? |