Don't kill players that are already dead.
This commit is contained in:
parent
661e7ebe5c
commit
27448a62ea
@ -107,13 +107,13 @@ end
|
||||
-- heal players slowly, or kill them if they fell in the abyss
|
||||
local function player_health_adjust()
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
if player:getpos().y < -50 then
|
||||
player:set_hp(player:get_hp() - 100)
|
||||
local hp = player:get_hp()
|
||||
if player:getpos().y < -50 and hp > 0 then
|
||||
player:set_hp(hp - 100)
|
||||
else
|
||||
local hp = player:get_hp()
|
||||
local breath = player:get_breath()
|
||||
if hp > 0 and hp < 20 and breath > 0 then
|
||||
player:set_hp(player:get_hp() + 1)
|
||||
player:set_hp(hp + 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user