1
0
Fork 0

Revert hunger code to pre-combat update PR

This commit is contained in:
Eliy21 2023-12-02 13:17:03 +00:00
parent 4cf865a36c
commit a24997cb34
1 changed files with 2 additions and 3 deletions

View File

@ -146,9 +146,8 @@ minetest.register_globalstep(function(dtime)
local food_level = mcl_hunger.get_hunger(player) local food_level = mcl_hunger.get_hunger(player)
local food_saturation_level = mcl_hunger.get_saturation(player) local food_saturation_level = mcl_hunger.get_saturation(player)
local player_health = player:get_hp() local player_health = player:get_hp()
local max_tick_timer = tonumber(minetest.settings:get("mcl_health_regen_delay")) or 4
if food_tick_timer > max_tick_timer then if food_tick_timer > 4.0 then
food_tick_timer = 0 food_tick_timer = 0
-- let hunger work always -- let hunger work always
@ -174,7 +173,7 @@ minetest.register_globalstep(function(dtime)
end end
end end
elseif food_tick_timer > max_tick_timer and food_level == 20 and food_saturation_level > 0 then -- fast regeneration elseif food_tick_timer > 0.5 and food_level == 20 and food_saturation_level > 0 then -- fast regeneration
if player_health > 0 and player_health < 20 then if player_health > 0 and player_health < 20 then
food_tick_timer = 0 food_tick_timer = 0
player:set_hp(player_health+1) player:set_hp(player_health+1)