forked from mtcontrib/minetest_hbhunger
		
	Compare commits
	
		
			5 Commits
		
	
	
		
			ad2dbf5647
			...
			3732bd9920
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 3732bd9920 | |||
| 
						 | 
					0777594e78 | ||
| 2d4d44a612 | |||
| 
						 | 
					470b0f693d | ||
| 
						 | 
					2b385540eb | 
							
								
								
									
										2
									
								
								.mailmap
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.mailmap
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
Wuzzy <Wuzzy@disroot.org> <Wuzzy2@mail.ru>
 | 
			
		||||
Wuzzy <Wuzzy@disroot.org> <almikes@aol.com>
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
# Hunger with HUD bar [`hbhunger`]
 | 
			
		||||
 | 
			
		||||
* Version: 1.1.1
 | 
			
		||||
* Version: 1.1.2
 | 
			
		||||
 | 
			
		||||
## Using the mod
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										26
									
								
								hunger.lua
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								hunger.lua
									
									
									
									
									
								
							@@ -79,14 +79,24 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
 | 
			
		||||
			if h == nil or hp == nil then
 | 
			
		||||
				return
 | 
			
		||||
			end
 | 
			
		||||
			minetest.sound_play(
 | 
			
		||||
				{name = sound or "hbhunger_eat_generic",
 | 
			
		||||
				gain = 1},
 | 
			
		||||
				{object=user,
 | 
			
		||||
				max_hear_distance = 16,
 | 
			
		||||
				pitch = 1 + math.random(-10, 10)*0.005,},
 | 
			
		||||
				true
 | 
			
		||||
			)
 | 
			
		||||
			if user:is_player() then
 | 
			
		||||
				local object, object_pos
 | 
			
		||||
				-- Check if user is a "fake player" (unofficial imitation of a the player data structure)
 | 
			
		||||
				if type(user) == "userdata" then
 | 
			
		||||
					object = user
 | 
			
		||||
				else
 | 
			
		||||
					object_pos = user:get_pos()
 | 
			
		||||
				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
 | 
			
		||||
			if h < hbhunger.SAT_MAX and hunger_change then
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user