From 4c743f9c4d1d263c5c36edb6a5dbaab7e2bdc6e4 Mon Sep 17 00:00:00 2001 From: cheapie Date: Mon, 23 May 2016 13:13:24 -0500 Subject: Add protection support to channel fields (#33) --- digilines_lcd/init.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'digilines_lcd') diff --git a/digilines_lcd/init.lua b/digilines_lcd/init.lua index ade3fca..fafa477 100644 --- a/digilines_lcd/init.lua +++ b/digilines_lcd/init.lua @@ -107,6 +107,11 @@ minetest.register_node("digilines_lcd:lcd", { 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 -- cgit v1.2.3