-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add basic_priv property to privileges #3976
Conversation
👍 |
I would love to see this in 0.4.14 release |
👍 |
local def = core.registered_privileges[priv] | ||
if def then | ||
if not def.basic_priv | ||
and not core.check_player_privs(name, {privs=true}) then |
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.
It must be broken to newline after and not
.
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.
Not after and not
, but after and
.
Fixed some code style |
local def = core.registered_privileges[priv] | ||
if def then | ||
if not def.basic_priv and | ||
not core.check_player_privs(name, {privs=true}) then |
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.
The guidelines say you should break after the operator, not
is an operator.
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.
No it doesn't. Also, this is consistent with the rest of the file, and is more readable.
Even if it were so:
Note that these are only guidelines for more readable code. In some (rare) cases they may result in less readable code. Use your best judgement.
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.
Not is not a binary operator, it's a unary operator.
Good to have the cleared up, I guess :D
Wouldn't it be best if this was a |
Privileges players could grant with
basic_privs
was previously hard coded. This change makes it no longer hard coded.