summaryrefslogtreecommitdiff
path: root/mount.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-06-26 21:03:55 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2017-06-26 21:03:55 +0100
commit7dc567d2a87a074157d6d0a01e8f46c3fb9dc1ae (patch)
tree76c3eceaaf662b774878b84226e247c3c08036bd /mount.lua
parent8924b056233e76169e7a4e235ce95c7666bf417c (diff)
fix mount walkable
Diffstat (limited to 'mount.lua')
-rw-r--r--mount.lua18
1 files 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