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

Conversation

justgo97
Copy link

No description provided.

@justgo97 justgo97 closed this Sep 28, 2018
@justgo97 justgo97 reopened this Sep 28, 2018
@@ -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.

@Arkshine
Copy link
Member

Sounds good now. Thanks!

@Arkshine Arkshine merged commit 4943008 into alliedmodders:master Sep 28, 2018
@justgo97 justgo97 deleted the typo branch September 28, 2018 14:46
Arkshine pushed a commit that referenced this pull request Sep 28, 2018
* Fixed a typo in get_user_flags description

* Remove
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just Bitsum instead of Bitflag sum? Or Bit vector?

Copy link
Author

Choose a reason for hiding this comment

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

Well all other amxmodx.inc natives use Bitflag sum, so for consistency its better to either keep it as it is or change them all. also whats wrong with bitflag ? https://en.wiktionary.org/wiki/bitflag

Copy link
Contributor

@WPMGPRoSToTeMa WPMGPRoSToTeMa Sep 28, 2018

Choose a reason for hiding this comment

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

@justgo97 hm, ok, makes sense to me now.

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

Successfully merging this pull request may close these issues.

3 participants