capturetheflag/mods/pvp/anticoward/init.lua
LoneWolfHT 179ff104bf
Make fall damage leave at least 1 hp (#678)
* Make fall damage leave at least 1 hp
2020-09-16 08:30:58 -07:00

8 lines
244 B
Lua

-- Capture The Flag mod: anticoward
minetest.register_on_player_hpchange(function(player, hp_change, reason)
if reason.type == "fall" and player:get_hp() + hp_change <= 0 then
return (-player:get_hp()) + 1
end
return hp_change
end, true)