Fix combat not ending on death

This commit is contained in:
LoneWolfHT 2021-02-14 11:16:39 -08:00
parent abf1fa2ad5
commit 87bd607856

View file

@ -83,11 +83,6 @@ minetest.register_on_dieplayer(function(player, reason)
last_attacker:hud_remove(potential_cowards[hname].hud or 0) last_attacker:hud_remove(potential_cowards[hname].hud or 0)
potential_cowards[hname] = nil potential_cowards[hname] = nil
end end
if potential_cowards[pname] then
player:hud_remove(potential_cowards[pname].hud or 0)
potential_cowards[pname] = nil
end
else else
for victim in pairs(potential_cowards) do for victim in pairs(potential_cowards) do
if potential_cowards[victim].puncher == pname then if potential_cowards[victim].puncher == pname then
@ -103,6 +98,11 @@ minetest.register_on_dieplayer(function(player, reason)
end end
end end
end end
if potential_cowards[pname] then
player:hud_remove(potential_cowards[pname].hud or 0)
potential_cowards[pname] = nil
end
end) end)
minetest.register_on_leaveplayer(function(player, timeout) minetest.register_on_leaveplayer(function(player, timeout)