From 020ab700ff8e0dcdefe12d82d519823ea938a7f3 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Wed, 15 Aug 2018 16:52:04 +0200 Subject: [PATCH] Fix get_node vs get_node_or_nil usage --- nether/portal.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nether/portal.lua b/nether/portal.lua index 9650342..78ccbaf 100644 --- a/nether/portal.lua +++ b/nether/portal.lua @@ -58,17 +58,17 @@ end -- returns nodename if area is generated, else calls generation function local function generated_or_generate(pos) - local name = minetest.get_node(pos).name - if name ~= "ignore" then - return name + local node = minetest.get_node_or_nil(pos) + if node then + return node.name end minetest.get_voxel_manip():read_from_map(pos, pos) - name = minetest.get_node_or_nil(pos) - if not name then + node = minetest.get_node_or_nil(pos) + if not node then minetest.emerge_area(vector.subtract(pos, 80), vector.add(pos, 80)) return false end - return name.name + return node.name end -- where the player appears after dying