non admin players can not modify other player robot ( if auth level more than 1)
This commit is contained in:
parent
5250d6f216
commit
86c1317f06
3
init.lua
3
init.lua
@ -1295,7 +1295,6 @@ local on_receive_robot_form = function(pos, formname, fields, sender)
|
|||||||
if minetest.is_protected(pos,name) then return end
|
if minetest.is_protected(pos,name) then return end
|
||||||
|
|
||||||
if fields.OK then
|
if fields.OK then
|
||||||
|
|
||||||
local meta = minetest.get_meta(pos);
|
local meta = minetest.get_meta(pos);
|
||||||
|
|
||||||
if fields.code then
|
if fields.code then
|
||||||
@ -1304,7 +1303,7 @@ local on_receive_robot_form = function(pos, formname, fields, sender)
|
|||||||
minetest.chat_send_all("#ROBOT: " .. name .. " is spamming with long text.") return
|
minetest.chat_send_all("#ROBOT: " .. name .. " is spamming with long text.") return
|
||||||
end
|
end
|
||||||
|
|
||||||
if meta:get_int("admin") == 1 then
|
if meta:get_int("authlevel") > 1 and name ~= meta:get_string("owner")then
|
||||||
local privs = minetest.get_player_privs(name); -- only admin can edit admin robot code
|
local privs = minetest.get_player_privs(name); -- only admin can edit admin robot code
|
||||||
if not privs.privs then
|
if not privs.privs then
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user