Fix crash when using stairs near unknown nodes
This commit is contained in:
parent
fa3ca02906
commit
ddaeac8273
|
@ -220,6 +220,9 @@ function mcstair.add(name, stairtiles)
|
||||||
if not v.connect then
|
if not v.connect then
|
||||||
local node = minetest.get_node(v.pos)
|
local node = minetest.get_node(v.pos)
|
||||||
local node_def = minetest.registered_nodes[node.name]
|
local node_def = minetest.registered_nodes[node.name]
|
||||||
|
if not node_def then
|
||||||
|
return
|
||||||
|
end
|
||||||
if node_def.stairs then
|
if node_def.stairs then
|
||||||
t[i].stairs = node_def.stairs
|
t[i].stairs = node_def.stairs
|
||||||
t[i].connect = stair_param_to_connect(get_stair_param(node), ceiling)
|
t[i].connect = stair_param_to_connect(get_stair_param(node), ceiling)
|
||||||
|
@ -369,6 +372,9 @@ function mcstair.add(name, stairtiles)
|
||||||
if not v.connect then
|
if not v.connect then
|
||||||
local node = minetest.get_node(v.pos)
|
local node = minetest.get_node(v.pos)
|
||||||
local node_def = minetest.registered_nodes[node.name]
|
local node_def = minetest.registered_nodes[node.name]
|
||||||
|
if not node_def then
|
||||||
|
return
|
||||||
|
end
|
||||||
if node_def.stairs then
|
if node_def.stairs then
|
||||||
t[i].stairs = node_def.stairs
|
t[i].stairs = node_def.stairs
|
||||||
t[i].connect = stair_param_to_connect(get_stair_param(node), ceiling)
|
t[i].connect = stair_param_to_connect(get_stair_param(node), ceiling)
|
||||||
|
|
Loading…
Reference in New Issue