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

Fix on_(grant|revoke) not being run by mods #14137

Merged
merged 1 commit into from Dec 21, 2023

Conversation

appgurueu
Copy link
Contributor

Trivial, untested fix for mods setting privs not running on_grant / on_revoke anymore.

(Issue originally reported by FatalError on Discord)

@rubenwardy
Copy link
Member

Make sure to test for mutation (get_auth_entry does return a new table so pretty sure this will work)

local privs = minetest.get_player_privileges(name)

privs.fly = true
minetest.set_player_privileges(name, privs)

privs.fast = true
minetest.set_player_privileges(name, privs)

@appgurueu
Copy link
Contributor Author

appgurueu commented Dec 20, 2023

Ok, tested (first defined a test priv which prints granted / revoked, then set the privs to just test, then to the empty set), works.

@wsor4035 wsor4035 added @ Script API Bugfix 🐛 PRs that fix a bug labels Dec 20, 2023
@sfan5 sfan5 added the Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines label Dec 21, 2023
@sfan5 sfan5 merged commit d58cc7f into minetest:master Dec 21, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix 🐛 PRs that fix a bug @ Script API Trivial The change is a trivial bug fix, documentation or maintenance change, as per the Git Guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants