Skip to content

Commit

Permalink
Don't damage armor when drowning, eating or starving.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbea authored and BuckarooBanzay committed Apr 30, 2020
1 parent a6b89e7 commit acd8b26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 3d_armor/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,9 @@ if armor.config.punch_damage == true then
end)
end

minetest.register_on_player_hpchange(function(player, hp_change)
if player and hp_change < 0 then
minetest.register_on_player_hpchange(function(player, hp_change, reason)
if player and reason.type ~= "drown" and reason.hunger == nil
and hp_change < 0 then
local name = player:get_player_name()
if name then
local heal = armor.def[name].heal
Expand Down

1 comment on commit acd8b26

@mckaygerhard
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this forced a depends on hunger.. that is not necesary! i open a issue #64

Please sign in to comment.