From e66f262888e68876d26dd26261b08843b4313a02 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 7 Feb 2021 14:35:06 +0100 Subject: [PATCH] Add get_node_lvm() improvement --- init.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 375aaae..6cc0ae6 100644 --- a/init.lua +++ b/init.lua @@ -67,11 +67,13 @@ local function get_node_lvm(pos) local param2_data = vm:get_param2_data() local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge}) local idx = area:indexp(pos) - node = { - name = minetest.get_name_from_content_id(data[idx]), - param2 = param2_data[idx] - } - return node + if data[idx] and param2_data[idx] then + return { + name = minetest.get_name_from_content_id(data[idx]), + param2 = param2_data[idx] + } + end + return {name="ignore", param2=0} end local function turnright(dir)