Fix bug: Tubes do not recognize when TA2 nodes are added/removed
This commit is contained in:
parent
976dd379ca
commit
b5bc1751b5
@ -180,10 +180,7 @@ function techage.register_consumer(base_name, inv_name, tiles, tNode, validState
|
||||
if (meta:contains("node_number")) then
|
||||
meta:set_string("node_number", "")
|
||||
end
|
||||
local number = "-"
|
||||
if stage > 2 then
|
||||
number = techage.add_node(pos, name_pas)
|
||||
end
|
||||
local number = techage.add_node(pos, name_pas, stage == 2)
|
||||
if crd.power_netw then
|
||||
crd.power_netw:after_place_node(pos)
|
||||
end
|
||||
|
@ -207,10 +207,15 @@ end
|
||||
-- Add node to the techage lists.
|
||||
-- Function determines and returns the node position number,
|
||||
-- needed for message communication.
|
||||
function techage.add_node(pos, name)
|
||||
-- If TA2 node, return '-' instead of a real number, because
|
||||
-- TA2 nodes should not support number based commands.
|
||||
function techage.add_node(pos, name, is_ta2)
|
||||
if item_handling_node(name) then
|
||||
Tube:after_place_node(pos)
|
||||
end
|
||||
if is_ta2 then
|
||||
return "-"
|
||||
end
|
||||
local key = minetest.hash_node_position(pos)
|
||||
return NumbersToBeRecycled[key] or get_number(pos, true)
|
||||
end
|
||||
@ -222,13 +227,10 @@ function techage.remove_node(pos, oldnode, oldmetadata)
|
||||
if number and tonumber(number) then
|
||||
local key = minetest.hash_node_position(pos)
|
||||
NumbersToBeRecycled[key] = number
|
||||
local ninfo = NodeInfoCache[number] or update_nodeinfo(number)
|
||||
if ninfo then
|
||||
NodeInfoCache[number] = nil
|
||||
if item_handling_node(ninfo.name) then
|
||||
Tube:after_dig_node(pos)
|
||||
end
|
||||
end
|
||||
NodeInfoCache[number] = nil
|
||||
end
|
||||
if oldnode and item_handling_node(oldnode.name) then
|
||||
Tube:after_dig_node(pos)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user