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
Dragging - Code cleanup #9271
Dragging - Code cleanup #9271
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have merge conflicts with #9225. Gonna try and finish that first.
["ACE3 Common", QGVAR(drag), LLSTRING(DragKeybind), { | ||
private _player = ACE_player; | ||
|
||
if (!alive _player) exitWith {false}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!alive _player) exitWith {false}; | |
if !(alive _player) exitWith {false}; |
Edit: Disregard, see below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the opposite of the ACE Coding Guidelines (although I know both are used in the code) inconsistently
https://ace3.acemod.org/wiki/development/coding-guidelines.html#55-brackets-around-code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My rule of thumb is: If it's one statement that is easily readable (such as the above), I add it inside the brackets.
But then we have lines such as these. I'm not sure how to interpret the ACE guidelines here - are these fine or should these types of statements be corrected?
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not of fan of ==/!=
instead of isEqualTo/isNotEqualTo
in conditions and PFHs, though.
* | ||
* Public: No | ||
*/ | ||
|
||
//IGNORE_PRIVATE_WARNING ["_thisArgs", "_thisID"]; // From CBA_fnc_addBISEventHandler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sqf_linter will use these hints to reduce false positives
tool hasn't been updated in a long time so it's not that useful
but going forward there really isn't any reason to remove these lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I add them back?
The reason is readability for me. I can change it though, it's not a problem. |
That's why |
Never claimed it to be...? |
probably won't be an issue, but iet also handles nulls a little differently
|
I'm just a fan of saving nanoseconds in things that run every frame. |
Understandable. Any further opinions on the matter? |
|
|
When merged this pull request will:
IMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}
.