-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Conversation
plugins/include/amxmodx.inc
Outdated
@@ -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 |
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.
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.
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 added it for consistency with other natives like get_user_weapons, show_menu...ect
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.
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.
Sounds good now. Thanks! |
* 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 |
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.
Maybe just Bitsum
instead of Bitflag sum
? Or Bit vector
?
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.
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
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.
@justgo97 hm, ok, makes sense to me now.
No description provided.