1
0
mirror of git://repo.or.cz/minetest_hbhunger.git synced 2024-11-15 23:00:34 +01:00

Fixed bug with node breakers

This bug fix fixes a crash that happened whenever someone was
operating a node breaker with something edible inside the tool slot,
and the operator player is absent.
This commit is contained in:
Gabriel Pérez-Cerezo 2018-06-01 11:58:52 +02:00 committed by Wuzzy
parent dd2f4c9c6d
commit 4e8621632a

View File

@ -76,6 +76,9 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
local name = user:get_player_name()
local h = tonumber(hbhunger.hunger[name])
local hp = user:get_hp()
if h == nil or hp == nil then
return
end
minetest.sound_play({name = sound or "hbhunger_eat_generic", gain = 1}, {pos=user:getpos(), max_hear_distance = 16})
-- Saturation