Skip to content

Commit

Permalink
Fix revoke callbacks being run for false values passed to `set_priv…
Browse files Browse the repository at this point in the history
…ileges`
  • Loading branch information
appgurueu committed Jan 22, 2024
1 parent afc48cf commit f0180ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin/game/auth.lua
Expand Up @@ -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
Expand Down

0 comments on commit f0180ad

Please sign in to comment.