From 7ac8506dda96403e7b23e17dab35e96892c9f98c Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Fri, 29 Jul 2022 18:52:28 +0100 Subject: [PATCH] add fallback node for is_node_dangerous --- api.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/api.lua b/api.lua index 15001fb..216693c 100644 --- a/api.lua +++ b/api.lua @@ -28,7 +28,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20220722", + version = "20220729", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -998,15 +998,13 @@ end -- get node but use fallback for nil or unknown local node_ok = function(pos, fallback) - fallback = fallback or mobs.fallback_node - local node = minetest.get_node_or_nil(pos) if node and minetest.registered_nodes[node.name] then return node end - return minetest.registered_nodes[fallback] + return minetest.registered_nodes[(fallback or mobs.fallback_node)] end @@ -1066,7 +1064,7 @@ function mob_class:is_at_cliff() return true end - local bnode = node_ok(blocker) + local bnode = node_ok(blocker, "air") -- will we drop onto dangerous node? if is_node_dangerous(self, bnode.name) then