Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add protection support to Luacontrollers,
protection is ignored with protection_bypass_priv
  • Loading branch information
cheapie authored and Jeija committed May 17, 2016
1 parent 75308f7 commit 40487a6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mesecons_luacontroller/init.lua
Expand Up @@ -508,10 +508,15 @@ local digiline = {
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
return
end
local name = sender:get_player_name()
if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then
minetest.record_protection_violation(pos, name)
return
end
reset(pos)
reset_meta(pos, fields.code)
local err = run(pos, {type="program"})
Expand Down

0 comments on commit 40487a6

Please sign in to comment.