From 86c1317f06f5e99d5e8eeebc087e80599158e75e Mon Sep 17 00:00:00 2001 From: rnd Date: Fri, 6 Jul 2018 17:30:49 +0200 Subject: [PATCH] non admin players can not modify other player robot ( if auth level more than 1) --- init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 3809553..549110c 100644 --- a/init.lua +++ b/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 fields.OK then - local meta = minetest.get_meta(pos); 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 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 if not privs.privs then return