Fix bug with reset button
This commit is contained in:
parent
c3a492cb89
commit
1fcadc9ff7
@ -67,6 +67,7 @@ local function get_new_nodename(item)
|
||||
end
|
||||
|
||||
local function get_node_name(nvm, slot)
|
||||
nvm.pos_list = nvm.pos_list or {}
|
||||
local pos = nvm.pos_list[slot]
|
||||
if pos then
|
||||
return techage.get_node_lvm(pos).name
|
||||
@ -228,6 +229,7 @@ end
|
||||
-- Generate a table of currently available inventory and placed nodes
|
||||
local function available_nodes(pos, nvm, item_list)
|
||||
local nodes = {}
|
||||
nvm.pos_list = nvm.pos_list or {}
|
||||
|
||||
for idx = 1, NUMSLOTS do
|
||||
local item = item_list[idx]
|
||||
@ -252,6 +254,7 @@ local function restore_config(pos, nvm)
|
||||
local item_list = inv:get_list("main")
|
||||
local stock = available_nodes(pos, nvm, item_list)
|
||||
local nodes = minetest.deserialize(meta:get_string("stored_config")) or {}
|
||||
nvm.pos_list = nvm.pos_list or {}
|
||||
|
||||
inv:set_list("main", {})
|
||||
item_list = inv:get_list("main")
|
||||
@ -421,7 +424,7 @@ minetest.register_node("techage:ta3_doorcontroller2", {
|
||||
return
|
||||
elseif fields.record then
|
||||
local inv = meta:get_inventory()
|
||||
nvm.pos_list = nil
|
||||
nvm.pos_list = {}
|
||||
meta:set_string("status", S("Recording..."))
|
||||
local name = player:get_player_name()
|
||||
minetest.chat_send_player(name, S("Click on all the blocks that are part of the door/gate"))
|
||||
|
Loading…
Reference in New Issue
Block a user