Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading/Wrong comment: bundle-example-areas ranvier-blade.js #10

Open
ProjectStickman opened this issue Aug 2, 2019 · 2 comments
Open

Comments

@ProjectStickman
Copy link

The comment says

// Have to be careful in weapon scripts. If you have a weapon script that causes damage and
// it listens for the 'hit' event you will have to check to make sure that `damage.source
// !== this` otherwise you could create an infinite loop the weapon's own damage triggering
// its script

yet that's not the case in the code for this weapon that does exactly that. Is it still needed or not?

@shawncplus
Copy link
Member

It's not needed in ranvier-blade.js because the script isn't dealing damage; it's healing so it won't create an infinite loop with the hit event. If the script was listening to the 'heal' event then the comment would apply mutatis mutandis

@shawncplus
Copy link
Member

I think a better place for this comment would be a new weapon and weapon script that actually demonstrated this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants