mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Fix eat sound not playing if eating last of stack
This commit is contained in:
parent
378175497a
commit
1c5ece8334
@ -499,11 +499,12 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- read definition before potentially emptying the stack
|
||||||
|
local def = itemstack:get_definition()
|
||||||
if itemstack:take_item():is_empty() then
|
if itemstack:take_item():is_empty() then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
local def = itemstack:get_definition()
|
|
||||||
if def and def.sound and def.sound.eat then
|
if def and def.sound and def.sound.eat then
|
||||||
core.sound_play(def.sound.eat, {
|
core.sound_play(def.sound.eat, {
|
||||||
pos = user:get_pos(),
|
pos = user:get_pos(),
|
||||||
|
Loading…
Reference in New Issue
Block a user