Protection support on digicontrol and controlrail

This commit is contained in:
Ciaran Gultnieks 2014-10-30 18:21:58 +00:00
parent ebdbf22191
commit cc49249155
2 changed files with 3 additions and 0 deletions

View File

@ -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)

View File

@ -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,