fix crash due nil itemstack (#13)

* fix crashes due nil itemstacks
This commit is contained in:
Niklp 2023-03-10 21:30:49 +01:00 committed by GitHub
parent 40b911e184
commit 1fd279435c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,7 @@ local function reg_simple(name, def)
end
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not itemstack then return end
local pname = clicker:get_player_name()
local iname = itemstack:get_name()
local dpos = vector.add((vector.multiply(minetest.facedir_to_dir(node.param2), -1)), pos)

View File

@ -44,6 +44,7 @@ minetest.register_node("home_workshop_misc:beer_tap", {
},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local inv = clicker:get_inventory()
if not itemstack then return end
local wieldname = itemstack:get_name()
if wieldname == "vessels:drinking_glass" then