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

Fixed a typo in get_user_flags description #605

Merged
merged 2 commits into from
Sep 28, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/include/amxmodx.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ native set_user_flags(index, flags = -1, id = 0);
* @param index Client index, 0 to set flags of server
* @param id Flag set id, ranging from 0 to 31
*
* @noreturn
* @return Bitflag sum of client's admin flags, 0 if client is not connected
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove , 0 if client is not connected ; because 0 is only returned when there is an error (not connected), this return value can't be used.

Copy link
Author

@justgo97 justgo97 Sep 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added it for consistency with other natives like get_user_weapons, show_menu...ect

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not explicit return values which can't be used.

If you look at get_user_weapons source code, it errors on an invalid index, but it returns 0 if you are not in-game. The return value can be used.

* @error If the index is not within the range of 0 to MaxClients, an
* error will be thrown.
*/
Expand Down