mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 22:52:25 +01:00
Fix revoke callbacks being run for false
values passed to set_privileges
This commit is contained in:
parent
afc48cf224
commit
f0180ad488
@ -102,14 +102,14 @@ core.builtin_auth_handler = {
|
||||
core.log('deprecated', "non-`true` value given to `minetest.set_player_privs`")
|
||||
end
|
||||
-- Run grant callbacks
|
||||
if not prev_privs[priv] then
|
||||
if prev_privs[priv] == nil then
|
||||
core.run_priv_callbacks(name, priv, nil, "grant")
|
||||
end
|
||||
end
|
||||
|
||||
-- Run revoke callbacks
|
||||
for priv, _ in pairs(prev_privs) do
|
||||
if not privileges[priv] then
|
||||
if privileges[priv] == nil then
|
||||
core.run_priv_callbacks(name, priv, nil, "revoke")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user