From 62cedd926738bea7c5fc4ee9d3e2a475c02ddb8b Mon Sep 17 00:00:00 2001 From: Apelta <54854228+TSafa-23@users.noreply.github.com> Date: Sun, 17 Jan 2021 22:25:08 -0600 Subject: [PATCH] Fix medkits not allocating deaths/score after death (#749) * Fix medkits preventing kills or score from being given on death * Remove HUD --- mods/pvp/medkits/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/pvp/medkits/init.lua b/mods/pvp/medkits/init.lua index 92ee651..a9f6c11 100644 --- a/mods/pvp/medkits/init.lua +++ b/mods/pvp/medkits/init.lua @@ -130,9 +130,11 @@ end) -- If player takes damage while healing, -- stop regen and revert back to original state minetest.register_on_player_hpchange(function(player, hp, reason) + local name = player:get_player_name() if hp < 0 then - if players[player:get_player_name()] then - stop_healing(player, "damage") + if players[name] then + player:hud_remove(players[name].hud) + players[name] = nil -- Don't use stop_healing(), it uses set_hp() and won't allocate deaths or score properly end if reason and reason.type == "punch" then local hitter = reason.object