mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-26 14:23:45 +01:00
Don't damage armor when drowning, eating or starving.
This commit is contained in:
parent
a6b89e7929
commit
acd8b2647d
@ -392,8 +392,9 @@ if armor.config.punch_damage == true then
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_player_hpchange(function(player, hp_change)
|
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
||||||
if player and hp_change < 0 then
|
if player and reason.type ~= "drown" and reason.hunger == nil
|
||||||
|
and hp_change < 0 then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
if name then
|
if name then
|
||||||
local heal = armor.def[name].heal
|
local heal = armor.def[name].heal
|
||||||
|
Loading…
Reference in New Issue
Block a user