move "tp" and "home" priv grant to join again :P

This commit is contained in:
NatureFreshMilk 2020-01-21 07:25:36 +01:00
parent 43f8f41126
commit dad5317dbd
2 changed files with 20 additions and 5 deletions

View File

@ -1,12 +1,30 @@
minetest.register_on_joinplayer(function(player)
-- current privs
local privs = minetest.get_player_privs(player:get_player_name())
-- true if they were changed
local privs_changed = false
-- grant default privs on join
if not privs.tp then
privs.tp = true
privs_changed = true
end
if not privs.home then
privs.home = true
privs_changed = true
end
-- 2019-06-25
-- revoke settime from non-admins
if not privs.privs and privs.settime then
privs["settime"] = nil
privs_changed = true
end
-- apply privs if changed
if privs_changed then
minetest.set_player_privs(player:get_player_name(), privs)
end

View File

@ -1,8 +1,5 @@
local privs = {
{ xp = 100, name = "home" },
{ xp = 10, name = "tp" },
{ xp = 500, name = "news_bypass" },
{ xp = 10000, name = "areas_protect" },