Make HP regeneration take away from satiation

This commit is contained in:
oilboi 2020-05-05 01:15:51 -04:00
parent bfc8c7c28d
commit d2561b44e5

View File

@ -68,9 +68,13 @@ local function hunger_update()
end
end
if hunger >= 20 then
player:set_hp(player:get_hp()+1)
local hp = player:get_hp()
if hunger >= 20 and hp < 20 then
player:set_hp(hp+1)
satiation = satiation - 1
if satiation < 0 then
satiation = 0
end
end
meta:set_int("satiation", satiation)