Fix rare crash and anticoward bug?

This commit is contained in:
LoneWolfHT 2020-10-18 19:52:20 -07:00
parent abb463fbd3
commit 21ff6f58c1
2 changed files with 5 additions and 2 deletions

View file

@ -95,8 +95,10 @@ minetest.register_on_dieplayer(function(player, reason)
potential_cowards[hname] = nil
end
player:hud_remove(potential_cowards[pname].hud or 0)
potential_cowards[pname] = nil
if potential_cowards[pname] then
player:hud_remove(potential_cowards[pname].hud or 0)
potential_cowards[pname] = nil
end
else
for victim in pairs(potential_cowards) do
if potential_cowards[victim].puncher == pname then

View file

@ -1 +1,2 @@
name = anticoward
depends = ctf, ctf_classes