forked from your-land-mirror/minetest-flow
Remove unused code, add missing check
This commit is contained in:
parent
314174f395
commit
e27b34700a
12
init.lua
12
init.lua
@ -785,17 +785,11 @@ local function parse_callbacks(tree, ctx_form, auto_name_id,
|
|||||||
if node_name and node_name ~= "" then
|
if node_name and node_name ~= "" then
|
||||||
local value_field = default_value_fields[node.type]
|
local value_field = default_value_fields[node.type]
|
||||||
if value_field then
|
if value_field then
|
||||||
-- Add the corresponding value transformer transformer to
|
|
||||||
-- saved_fields
|
|
||||||
saved_fields[node_name] = (
|
|
||||||
field_value_transformers[node.type] or
|
|
||||||
default_field_value_transformer
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Update ctx.form if there is no current value, otherwise
|
-- Update ctx.form if there is no current value, otherwise
|
||||||
-- change the node's value to the saved one.
|
-- change the node's value to the saved one.
|
||||||
local value = ctx_form[node_name]
|
local value = ctx_form[node_name]
|
||||||
if node.type == "dropdown" and not node.index_event then
|
if node.type == "dropdown" and not node.index_event and
|
||||||
|
not node._index_event_hack then
|
||||||
-- Special case for dropdowns without index_event
|
-- Special case for dropdowns without index_event
|
||||||
local items = node.items or {}
|
local items = node.items or {}
|
||||||
if value == nil then
|
if value == nil then
|
||||||
@ -828,6 +822,8 @@ local function parse_callbacks(tree, ctx_form, auto_name_id,
|
|||||||
node[value_field] = value
|
node[value_field] = value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Add the corresponding value transformer transformer to
|
||||||
|
-- saved_fields
|
||||||
local get_transformer = field_value_transformers[node.type]
|
local get_transformer = field_value_transformers[node.type]
|
||||||
saved_fields[node_name] = get_transformer and
|
saved_fields[node_name] = get_transformer and
|
||||||
get_transformer(node, tablecolumn_count,
|
get_transformer(node, tablecolumn_count,
|
||||||
|
Loading…
Reference in New Issue
Block a user