From 5126bfb5952c1299de67779fa454642ea04b6de9 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Tue, 15 Dec 2020 09:26:09 +0100 Subject: [PATCH] Fix bug in get_node_lvm() --- basis/lib.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/basis/lib.lua b/basis/lib.lua index ffec3a4..e5b1b08 100644 --- a/basis/lib.lua +++ b/basis/lib.lua @@ -99,12 +99,14 @@ function techage.get_node_lvm(pos) local data = vm:get_data() local param2_data = vm:get_param2_data() local area = VoxelArea:new({MinEdge = MinEdge, MaxEdge = MaxEdge}) - local idx = area:index(pos.x, pos.y, pos.z) - node = { - name = minetest.get_name_from_content_id(data[idx]), - param2 = param2_data[idx] - } - return node + local idx = area:indexp(pos) + 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 --