fix on_receive_fieldss: check for protection and do not set meta if that field is nil, eg.g because of pressing escape

This commit is contained in:
HybridDog
2016-04-27 18:42:20 +02:00
parent e4ed8a50ee
commit 3c99c37f44
7 changed files with 40 additions and 33 deletions

View File

@ -14,9 +14,10 @@ local function object_detector_make_formspec(pos)
make_formspec(minetest.get_meta(pos))
end
local function object_detector_on_receive_fields(pos, formname, fields)
local function object_detector_on_receive_fields(pos, _, fields, player)
if not fields.scanname
or not fields.digiline_channel then
or not fields.digiline_channel
or minetest.is_protected(pos, player:get_player_name()) then
return
end