1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2024-11-17 15:58:29 +01:00

Merge branch 'fix-protection-check' into 'master'

Skip protection check on formspec close (where not already done)

See merge request VanessaE/pipeworks!42
This commit is contained in:
Vanessa Dannenberg 2021-05-06 18:21:42 +00:00
commit 3536004667
2 changed files with 18 additions and 2 deletions

View File

@ -276,7 +276,10 @@ minetest.register_node("pipeworks:autocrafter", {
update_meta(meta, false)
end,
on_receive_fields = function(pos, formname, fields, sender)
if not pipeworks.may_configure(pos, sender) then return end
if (fields.quit and not fields.key_enter_field)
or not pipeworks.may_configure(pos, sender) then
return
end
local meta = minetest.get_meta(pos)
if fields.on then
update_meta(meta, false)

View File

@ -110,9 +110,22 @@ if pipeworks.enable_mese_tube then
update_formspec(pos)
meta:set_string("infotext", S("Sorting pneumatic tube"))
end,
after_place_node = function(pos, placer, itemstack, pointed_thing)
if placer and placer:is_player() and placer:get_player_control().aux1 then
local meta = minetest.get_meta(pos)
for i = 1, 6 do
meta:set_int("l"..tostring(i).."s", 0)
end
update_formspec(pos)
end
return pipeworks.after_place(pos, placer, itemstack, pointed_thing)
end,
on_punch = update_formspec,
on_receive_fields = function(pos, formname, fields, sender)
if not pipeworks.may_configure(pos, sender) then return end
if (fields.quit and not fields.key_enter_field)
or not pipeworks.may_configure(pos, sender) then
return
end
fs_helpers.on_receive_fields(pos, fields)
update_formspec(pos)
end,