Fix that all of new players' default_privs are removed

This commit is contained in:
NO11 2021-09-30 20:14:13 +00:00
parent 8697b38d60
commit a410d17306

@ -6,7 +6,6 @@ minetest.register_privilege("maphack", {
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
local meta = player:get_meta()
if meta:get_int("fly_changed") == 1 then return end
@ -14,9 +13,9 @@ minetest.register_on_joinplayer(function(player)
if minetest.is_creative_enabled(name) then
fly = true
end
minetest.set_player_privs(name, {
fly = fly,
})
local player_privs = minetest.get_player_privs(name)
player_privs.fly = fly
minetest.set_player_privs(name, player_privs)
end)
for _, action in pairs({"grant", "revoke"}) do