mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
basic_privs to allow granting/revoking interact_extra too
This commit is contained in:
parent
93cdc9b9dc
commit
8742b3dab2
@ -130,7 +130,7 @@ minetest.register_chatcommand("grant", {
|
|||||||
local privs = minetest.get_player_privs(grantname)
|
local privs = minetest.get_player_privs(grantname)
|
||||||
local privs_known = true
|
local privs_known = true
|
||||||
for priv, _ in pairs(grantprivs) do
|
for priv, _ in pairs(grantprivs) do
|
||||||
if priv ~= "interact" and priv ~= "shout" and not minetest.check_player_privs(name, {privs=true}) then
|
if priv ~= "interact" and priv ~= "shout" and priv ~= "interact_extra" and not minetest.check_player_privs(name, {privs=true}) then
|
||||||
minetest.chat_send_player(name, "Your privileges are insufficient.")
|
minetest.chat_send_player(name, "Your privileges are insufficient.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -168,7 +168,7 @@ minetest.register_chatcommand("revoke", {
|
|||||||
local revokeprivs = minetest.string_to_privs(revokeprivstr)
|
local revokeprivs = minetest.string_to_privs(revokeprivstr)
|
||||||
local privs = minetest.get_player_privs(revokename)
|
local privs = minetest.get_player_privs(revokename)
|
||||||
for priv, _ in pairs(revokeprivs) do
|
for priv, _ in pairs(revokeprivs) do
|
||||||
if priv ~= "interact" and priv ~= "shout" and not minetest.check_player_privs(name, {privs=true}) then
|
if priv ~= "interact" and priv ~= "shout" and priv ~= "interact_extra" and not minetest.check_player_privs(name, {privs=true}) then
|
||||||
minetest.chat_send_player(name, "Your privileges are insufficient.")
|
minetest.chat_send_player(name, "Your privileges are insufficient.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user