diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-06-26 21:03:55 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-06-26 21:03:55 +0100 |
commit | 7dc567d2a87a074157d6d0a01e8f46c3fb9dc1ae (patch) | |
tree | 76c3eceaaf662b774878b84226e247c3c08036bd /mount.lua | |
parent | 8924b056233e76169e7a4e235ce95c7666bf417c (diff) |
fix mount walkable
Diffstat (limited to 'mount.lua')
-rw-r--r-- | mount.lua | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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 |