summaryrefslogtreecommitdiff
path: root/digilines_lightsensor
diff options
context:
space:
mode:
Diffstat (limited to 'digilines_lightsensor')
-rw-r--r--digilines_lightsensor/init.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/digilines_lightsensor/init.lua b/digilines_lightsensor/init.lua
index 7dda1ce..914899b 100644
--- a/digilines_lightsensor/init.lua
+++ b/digilines_lightsensor/init.lua
@@ -50,6 +50,11 @@ minetest.register_node("digilines_lightsensor:lightsensor", {
meta:set_string("formspec", "field[channel;Channel;${channel}]")
end,
on_receive_fields = function(pos, formname, fields, sender)
+ 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
if (fields.channel) then
minetest.get_meta(pos):set_string("channel", fields.channel)
end