From 7dc567d2a87a074157d6d0a01e8f46c3fb9dc1ae Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Mon, 26 Jun 2017 21:03:55 +0100 Subject: [PATCH] fix mount walkable --- mount.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mount.lua b/mount.lua index 6892ab7..a549073 100644 --- a/mount.lua +++ b/mount.lua @@ -10,9 +10,23 @@ local crash_threshold = 6.5 -- ignored if enable_crash=false -- Helper functions -- +local node_ok = function(pos, fallback) + + fallback = fallback or "default:dirt" + + local node = minetest.get_node_or_nil(pos) + + if node and minetest.registered_nodes[node.name] then + return node + end + + return {name = fallback} +end + + local function node_is(pos) - local node = minetest.get_node(pos) + local node = node_ok(pos) if node.name == "air" then return "air" @@ -26,7 +40,7 @@ local function node_is(pos) return "liquid" end - if minetest.get_item_group(node.name, "walkable") ~= 0 then + if minetest.registered_nodes[node.name].walkable == true then return "walkable" end