forked from VoxeLibre/VoxeLibre
Fix Campifires API to not crash the server.
Fixed the error in Campfires' On_RightClick() to not error out when called with a non-existent pointed_thing.
This commit is contained in:
parent
eafe6627d8
commit
e9d994b74d
|
@ -332,6 +332,9 @@ function mcl_campfires.register_campfire(name, def)
|
||||||
elseif minetest.get_item_group(itemstack:get_name(), "campfire_cookable") ~= 0 then
|
elseif minetest.get_item_group(itemstack:get_name(), "campfire_cookable") ~= 0 then
|
||||||
mcl_campfires.take_item(pos, node, player, itemstack)
|
mcl_campfires.take_item(pos, node, player, itemstack)
|
||||||
else
|
else
|
||||||
|
if not pointed_thing then
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
minetest.item_place_node(itemstack, player, pointed_thing)
|
minetest.item_place_node(itemstack, player, pointed_thing)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue