Add protection support to Luacontrollers

This commit is contained in:
Carter Kolwey 2016-05-16 12:55:58 -05:00
parent 85bc62a65d
commit 95c552ad83

View File

@ -508,10 +508,15 @@ local digiline = {
end end
} }
} }
local function on_receive_fields(pos, form_name, fields) local function on_receive_fields(pos, form_name, fields, sender)
if not fields.program then if not fields.program then
return return
end end
local name = sender:get_player_name()
if minetest.is_protected(pos, name) then
minetest.record_protection_violation(pos, name)
return
end
reset(pos) reset(pos)
reset_meta(pos, fields.code) reset_meta(pos, fields.code)
local err = run(pos, {type="program"}) local err = run(pos, {type="program"})