From f0180ad488ec547758f56105b05e043db518086b Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Mon, 22 Jan 2024 21:57:30 +0100 Subject: [PATCH] Fix revoke callbacks being run for `false` values passed to `set_privileges` --- builtin/game/auth.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/game/auth.lua b/builtin/game/auth.lua index 35046cec7..e45520e27 100644 --- a/builtin/game/auth.lua +++ b/builtin/game/auth.lua @@ -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