mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-11-13 05:50:17 +01:00
add fallback node for is_node_dangerous
This commit is contained in:
parent
90df44aeaf
commit
7ac8506dda
8
api.lua
8
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user