forked from mtcontrib/pipeworks
fix undefined node crash
This commit is contained in:
parent
42a364b818
commit
bbc530a067
@ -253,8 +253,10 @@ local function go_next(pos, velocity, stack)
|
|||||||
for _, vect in ipairs(can_go) do
|
for _, vect in ipairs(can_go) do
|
||||||
local npos = vector.add(pos, vect)
|
local npos = vector.add(pos, vect)
|
||||||
local node = minetest.get_node(npos)
|
local node = minetest.get_node(npos)
|
||||||
|
local reg_node = minetest.registered_nodes[node.name]
|
||||||
|
if reg_node then
|
||||||
|
local tube_def = reg_node.tube
|
||||||
local tubedevice = minetest.get_item_group(node.name, "tubedevice")
|
local tubedevice = minetest.get_item_group(node.name, "tubedevice")
|
||||||
local tube_def = minetest.registered_nodes[node.name].tube
|
|
||||||
local tube_priority = (tube_def and tube_def.priority) or 100
|
local tube_priority = (tube_def and tube_def.priority) or 100
|
||||||
if tubedevice > 0 and tube_priority >= max_priority then
|
if tubedevice > 0 and tube_priority >= max_priority then
|
||||||
if not tube_def or not tube_def.can_insert or
|
if not tube_def or not tube_def.can_insert or
|
||||||
@ -267,6 +269,7 @@ local function go_next(pos, velocity, stack)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not next_positions[1] then
|
if not next_positions[1] then
|
||||||
return false, nil
|
return false, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user