From cc492491554779087e472793f432753fa8079d70 Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Thu, 30 Oct 2014 18:21:58 +0000 Subject: [PATCH] Protection support on digicontrol and controlrail --- controlrail.lua | 1 + digicontrol.lua | 2 ++ 2 files changed, 3 insertions(+) diff --git a/controlrail.lua b/controlrail.lua index ba3d784..eba6a0e 100644 --- a/controlrail.lua +++ b/controlrail.lua @@ -44,6 +44,7 @@ minetest.register_node("railcarts:controlrail", { meta:set_string("infotext", "speedup") end, on_receive_fields = function(pos, formname, fields, sender) + if minetest.is_protected(pos, sender:get_player_name()) then return end if fields and fields.fn then dbg.v2("Control rail at "..minetest.pos_to_string(pos).." set to "..fields.fn.." by "..(sender:get_player_name() or "")) local meta = minetest.get_meta(pos) diff --git a/digicontrol.lua b/digicontrol.lua index b551cf3..fe1fbe1 100644 --- a/digicontrol.lua +++ b/digicontrol.lua @@ -31,6 +31,8 @@ minetest.register_node("railcarts:digicontrol", { meta:set_string("infotext", "none") end, on_receive_fields = function(pos, formname, fields, sender) + if minetest.is_protected(pos, sender:get_player_name()) then return end + if not fields.channel then return end local meta = minetest.get_meta(pos) meta:set_string("channel", fields.channel) end,