1
0
mirror of git://repo.or.cz/minetest_hbhunger.git synced 2025-07-04 07:30:24 +02:00

6 Commits

5 changed files with 11 additions and 21 deletions

View File

@ -1,2 +0,0 @@
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>
Wuzzy <Wuzzy@disroot.org> <almikes@aol.com>

View File

@ -1,6 +1,6 @@
# Hunger with HUD bar [`hbhunger`] # Hunger with HUD bar [`hbhunger`]
* Version: 1.1.2 * Version: 1.1.1
## Using the mod ## Using the mod

View File

@ -79,24 +79,14 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
if h == nil or hp == nil then if h == nil or hp == nil then
return return
end end
if user:is_player() then minetest.sound_play(
local object, object_pos {name = sound or "hbhunger_eat_generic",
-- Check if user is a "fake player" (unofficial imitation of a the player data structure) gain = 1},
if type(user) == "userdata" then {object=user,
object = user max_hear_distance = 16,
else pitch = 1 + math.random(-10, 10)*0.005,},
object_pos = user:get_pos() true
end )
minetest.sound_play(
{name = sound or "hbhunger_eat_generic",
gain = 1},
{object=object,
pos=object_pos,
max_hear_distance = 16,
pitch = 1 + math.random(-10, 10)*0.005,},
true
)
end
-- Saturation -- Saturation
if h < hbhunger.SAT_MAX and hunger_change then if h < hbhunger.SAT_MAX and hunger_change then

View File

@ -186,3 +186,5 @@ minetest.register_chatcommand("satiation", {
}) })
end end
minetest.log("action", "[hbhunger] loaded.")

Binary file not shown.