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

Code Smell: Unnecessary use of global #8

Open
4LT opened this issue Jun 25, 2023 · 1 comment
Open

Code Smell: Unnecessary use of global #8

4LT opened this issue Jun 25, 2023 · 1 comment

Comments

@4LT
Copy link

4LT commented Jun 25, 2023

https://github.com/JosiahJack/Keep/blob/fcdd969dd51204a8efce45a1e51bd2876fdfe04a/keepsrc/projectiles_launch.qc#L1816C8-L1816C8

This seems to be all over the place. newmis is never declared, so it must be declared as a global; however, it gets returned from the function, so there's no point in overwriting a global instead of using a local variable.

@JosiahJack
Copy link
Owner

It's temporarily this way until I can confirm I've quashed all the places where a parent function assumes that newmis contains the just launched projectile. An unfortunate holdover from ancient times but definitely a potential for issues.

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