Fix medkits not allocating deaths/score after death (#749)
* Fix medkits preventing kills or score from being given on death * Remove HUD
This commit is contained in:
parent
2e3ffe8be0
commit
62cedd9267
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue