Skip to content
Permalink
Browse files

Fix item eat sound not played if last item (#9239)

  • Loading branch information
Wuzzy2 authored and SmallJoker committed Dec 24, 2019
1 parent 7199dc7 commit 876a15bd7570f4cccf815a1d5e5588525e445cb1
Showing with 1 addition and 1 deletion.
  1. +1 −1 builtin/game/item.lua
@@ -462,10 +462,10 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
return result
end
end
local def = itemstack:get_definition()
if itemstack:take_item() ~= nil then
user:set_hp(user:get_hp() + hp_change)

local def = itemstack:get_definition()
if def and def.sound and def.sound.eat then
minetest.sound_play(def.sound.eat, { pos = user:get_pos(), max_hear_distance = 16 })
end

0 comments on commit 876a15b

Please sign in to comment.
You can’t perform that action at this time.