mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-26 10:20:19 +01:00
Add protection support to Luacontrollers,
protection is ignored with protection_bypass_priv
This commit is contained in:
parent
75308f73e4
commit
40487a65f4
@ -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) and not minetest.check_player_privs(name, {protection_bypass=true}) 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"})
|
||||||
|
Loading…
Reference in New Issue
Block a user