From 87ba6d09c87af44de145ac9d71ac3aa9c9d7f7ce Mon Sep 17 00:00:00 2001 From: "A. Demant" Date: Thu, 6 Sep 2018 20:28:08 +0200 Subject: [PATCH] failure due sunburn integration --- init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index abc3d24..9d3e80d 100644 --- a/init.lua +++ b/init.lua @@ -36,6 +36,8 @@ local mthirsty = minetest.get_modpath("thirsty") local lthirsty = 100 local msunburn = minetest.get_modpath("sunburn") local lsunburn = 0 +local mhbhunger = minetest.get_modpath("hbhunger") +local lhbhunger = 100 -- A table of quips for death messages. The first item in each sub table is the -- default message used when RANDOM_MESSAGES is disabled. @@ -275,11 +277,14 @@ minetest.register_on_dieplayer(function(player,reason) if mstamina ~= nil then lstamina = get_int_attribute(player, "stamina:level") end + if mhbhunger ~= nil then + lstamina = tonumber(hbhunger.hunger[player_name]) + end if mthirsty ~= nil then lthirsty = thirsty.get_thirst_factor(player) end if msunburn ~= nil then - lsunburn = PPA.get_value(player, "sunburn_sunburn") + lsunburn = sunburn.get_sunburn(player) end -- Death by lava