Add is_valid_pos in item_eat

This commit is contained in:
MoNTE48 2019-09-23 18:08:45 +02:00
parent 87586ae912
commit f3ae8906db

View File

@ -562,6 +562,9 @@ function core.item_eat(hp_change, replace_with_item, poison)
if user then
local pos = user:get_pos()
pos.y = pos.y + 1.3
if not minetest.is_valid_pos(pos) then
return
end
local itemname = itemstack:get_name()
local texture = core.registered_items[itemname].inventory_image
local dir = user:get_look_dir()