From 8ea9af6e2367d2200452849f30bc34b4f58291a9 Mon Sep 17 00:00:00 2001 From: tbowan Date: Mon, 13 Feb 2017 23:37:33 +0100 Subject: [PATCH 1/2] Fix error on unknown node --- actions/pathfinder.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/pathfinder.lua b/actions/pathfinder.lua index 6be41d8..524779b 100644 --- a/actions/pathfinder.lua +++ b/actions/pathfinder.lua @@ -103,7 +103,7 @@ local function is_good_node(node, exceptions) break end end - if not minetest.registered_nodes[node.name].walkable then + if node.name ~= nil and not minetest.registered_nodes[node.name].walkable then return pathfinder.node_types.walkable elseif is_openable then return pathfinder.node_types.openable @@ -250,4 +250,4 @@ function pathfinder.get_path(map, path_nodes) --print(('Step: %d - x: %d - y: %d'):format(count, node:getX(), node:getY())) end return result -end \ No newline at end of file +end From f5968b952db93ab5e810660fd5cc176c3d058a64 Mon Sep 17 00:00:00 2001 From: tbowan Date: Tue, 14 Feb 2017 10:32:52 +0100 Subject: [PATCH 2/2] Better fix --- actions/pathfinder.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/pathfinder.lua b/actions/pathfinder.lua index 524779b..874481b 100644 --- a/actions/pathfinder.lua +++ b/actions/pathfinder.lua @@ -103,7 +103,7 @@ local function is_good_node(node, exceptions) break end end - if node.name ~= nil and not minetest.registered_nodes[node.name].walkable then + if node ~= nil and node.name ~= nil and not minetest.registered_nodes[node.name].walkable then return pathfinder.node_types.walkable elseif is_openable then return pathfinder.node_types.openable