mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-11-16 23:30:34 +01:00
Add protection support to Luacontrollers
This commit is contained in:
parent
85bc62a65d
commit
95c552ad83
|
@ -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"})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user