mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-24 20:03:45 +01:00
Merge pull request 'Fix crash stripping unregistered block' (#3585) from fix_crash_noddef into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3585
This commit is contained in:
commit
9887958e4e
@ -366,7 +366,14 @@ local function make_stripped_trunk(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type ~= "node" then return end
|
||||
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local noddef = minetest.registered_nodes[minetest.get_node(pointed_thing.under).name]
|
||||
local node_name = minetest.get_node(pointed_thing.under).name
|
||||
|
||||
local noddef = minetest.registered_nodes[node_name]
|
||||
|
||||
if not noddef then
|
||||
minetest.log("warning", "Trying to right click with an axe the unregistered node: " .. tostring(node_name))
|
||||
return
|
||||
end
|
||||
|
||||
if not placer:get_player_control().sneak and noddef.on_rightclick then
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
|
Loading…
Reference in New Issue
Block a user