node def nil check
This commit is contained in:
parent
327544ba47
commit
5425e54ab2
@ -1251,7 +1251,7 @@ minetest.register_node("basic_machines:mover", {
|
|||||||
minetest.set_node(pos2, {name = node1.name})
|
minetest.set_node(pos2, {name = node1.name})
|
||||||
|
|
||||||
-- add particles only when not too far
|
-- add particles only when not too far
|
||||||
if vector.distance(pos1, pos2) <= 16 then
|
if def and vector.distance(pos1, pos2) <= 16 then
|
||||||
local texture = "default_dirt.png"
|
local texture = "default_dirt.png"
|
||||||
|
|
||||||
if type(def.tiles[1]) == "string" then
|
if type(def.tiles[1]) == "string" then
|
||||||
@ -1289,11 +1289,12 @@ minetest.register_node("basic_machines:mover", {
|
|||||||
if dig then
|
if dig then
|
||||||
minetest.check_for_falling(pos1)
|
minetest.check_for_falling(pos1)
|
||||||
end
|
end
|
||||||
|
local def = minetest.registered_nodes[node1.name]
|
||||||
|
|
||||||
minetest.set_node(pos1, {name = "air"})
|
minetest.set_node(pos1, {name = "air"})
|
||||||
|
|
||||||
-- add particles only when not too far
|
-- add particles only when not too far
|
||||||
if vector.distance(pos1, pos2) <= 16 then
|
if def and vector.distance(pos1, pos2) <= 16 then
|
||||||
local def = minetest.registered_nodes[node1.name]
|
|
||||||
local texture = "default_dirt.png"
|
local texture = "default_dirt.png"
|
||||||
|
|
||||||
if type(def.tiles[1]) == "string" then
|
if type(def.tiles[1]) == "string" then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user