projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7199dc7
)
Fix item eat sound not played if last item (#9239)
author
Wuzzy
<wuzzy2@mail.ru>
Tue, 24 Dec 2019 18:12:46 +0000
(18:12 +0000)
committer
SmallJoker
<SmallJoker@users.noreply.github.com>
Tue, 24 Dec 2019 18:12:46 +0000
(19:12 +0100)
builtin/game/item.lua
patch
|
blob
|
history
diff --git
a/builtin/game/item.lua
b/builtin/game/item.lua
index ef47cd66d5afccdc7fcdf026b682e35277dfb6ca..d6c6469b34eb6a9c03dc8d71232795abd3c8f2e2 100644
(file)
--- a/
builtin/game/item.lua
+++ b/
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