mirror of
https://git.0x7be.net/dirk/uniham.git
synced 2024-11-22 07:13:49 +01:00
don’t crash when using hammer on non-nodes
This commit is contained in:
parent
033cf1b331
commit
f74c71b448
@ -14,7 +14,7 @@ local replacements = uniham.replacements
|
||||
-- @see <https://dev.minetest.net/on_use#on_use>
|
||||
-- @return itemstack|void
|
||||
uniham.use_hammer = function (itemstack, player, pointed_thing)
|
||||
if pointed_thing.type == 'nothing' then return end
|
||||
if pointed_thing.type ~= 'node' then return end
|
||||
local node_pos = minetest.get_pointed_thing_position(pointed_thing)
|
||||
local node_name = minetest.get_node(node_pos).name
|
||||
local node_sounds = minetest.registered_nodes[node_name].sounds
|
||||
|
Loading…
Reference in New Issue
Block a user