Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change field receipt handling to work properly with Minetest 0.4.8.
  • Loading branch information
Uberi committed Dec 18, 2013
1 parent 85f2f3f commit e8d31c3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mesecons_commandblock/init.lua
Expand Up @@ -92,6 +92,9 @@ local after_place = function(pos, placer)
end

local receive_fields = function(pos, formname, fields, sender)
if fields.quit then
return
end
local meta = minetest.get_meta(pos)
if fields.nearest then
initialize_data(meta, "@nearest", fields.command, fields.param)
Expand Down
5 changes: 4 additions & 1 deletion mesecons_detector/init.lua
Expand Up @@ -9,7 +9,10 @@ local object_detector_make_formspec = function (pos)
"field[0.3,1.5;4,2;digiline_channel;Digiline Channel (optional):;${digiline_channel}]")
end

local object_detector_on_receive_fields = function (pos, formname, fields)
local object_detector_on_receive_fields = function(pos, formname, fields)
if fields.quit then
return
end
local meta = minetest.get_meta(pos)
meta:set_string("scanname", fields.scanname)
meta:set_string("digiline_channel", fields.digiline_channel)
Expand Down
6 changes: 6 additions & 0 deletions mesecons_luacontroller/init.lua
Expand Up @@ -488,6 +488,9 @@ minetest.register_node(nodename, {
node_box = nodebox,
on_construct = reset_meta,
on_receive_fields = function(pos, formname, fields)
if fields.quit then
return
end
reset(pos)
reset_meta(pos, fields.code)
local err = lc_update(pos, {type="program"})
Expand Down Expand Up @@ -531,6 +534,9 @@ minetest.register_node(BASENAME .. "_burnt", {
node_box = nodebox,
on_construct = reset_meta,
on_receive_fields = function(pos, formname, fields)
if fields.quit then
return
end
reset(pos)
reset_meta(pos, fields.code)
local err = lc_update(pos, {type="program"})
Expand Down
3 changes: 3 additions & 0 deletions mesecons_microcontroller/init.lua
Expand Up @@ -98,6 +98,9 @@ minetest.register_node(nodename, {
meta:set_string("eeprom", r)
end,
on_receive_fields = function(pos, formanme, fields, sender)
if fields.quit then
return
end
local meta = minetest.get_meta(pos)
if fields.band then
fields.code = "sbi(C, A&B) :A and B are inputs, C is output"
Expand Down

1 comment on commit e8d31c3

@Jeija
Copy link
Collaborator

@Jeija Jeija commented on e8d31c3 Jan 11, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes #140, why is this needed? Shouldn't it be:

if not fields.quit then

?

Please sign in to comment.