mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-08-20 14:04:10 +02:00
Merge pull request 'Fix crash when leaves don't have a registered orphan but try to rot' (#3346) from rubber_crash_fix into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3346 Reviewed-by: PrairieWind <prairie.astronomer1@gmail.com>
This commit is contained in:
commit
5c32d1c106
@ -35,7 +35,14 @@ function mcl_core.update_leaves(pos, oldnode)
|
||||
-- manually placed leaf nodes have param2
|
||||
-- set and will never decay automatically
|
||||
if lnode.param2 == 0 then
|
||||
minetest.swap_node(lpos, {name = lnode.name .. "_orphan"})
|
||||
local orphan_name = lnode.name .. "_orphan"
|
||||
local def = minetest.registered_nodes[orphan_name]
|
||||
if def then
|
||||
--minetest.log("Registered: ".. orphan_name)
|
||||
minetest.swap_node(lpos, {name = orphan_name})
|
||||
else
|
||||
--minetest.log("Not registered: ".. orphan_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user