From c642f49d1a8e45e6257919fa372892bb47395a4e Mon Sep 17 00:00:00 2001 From: savilli <78875209+savilli@users.noreply.github.com> Date: Sun, 9 May 2021 01:40:17 +0200 Subject: [PATCH] Fix ctf_respawn_delay bug (#880) --- mods/ctf/ctf_respawn_delay/init.lua | 3 +-- mods/ctf/ctf_traps/init.lua | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mods/ctf/ctf_respawn_delay/init.lua b/mods/ctf/ctf_respawn_delay/init.lua index 8c73974..ab3b481 100644 --- a/mods/ctf/ctf_respawn_delay/init.lua +++ b/mods/ctf/ctf_respawn_delay/init.lua @@ -8,8 +8,7 @@ local RESPAWN_MESSAGE = "Respawning in " minetest.register_on_dieplayer(function(player, reason) local pname = player:get_player_name() - if ctf_match.is_in_build_time() or (reason.type == "punch" and reason.object and - reason.object:is_player() and reason.object:get_player_name() == pname) then + if ctf_match.is_in_build_time() or ctf_respawn_delay.players[pname] then -- what is dead may never die return end diff --git a/mods/ctf/ctf_traps/init.lua b/mods/ctf/ctf_traps/init.lua index db2f2a2..c65897e 100644 --- a/mods/ctf/ctf_traps/init.lua +++ b/mods/ctf/ctf_traps/init.lua @@ -63,7 +63,10 @@ minetest.register_node("ctf_traps:damage_cobble", { if placerobj then digger:punch(placerobj, 10, {damage_groups = {fleshy = 7}}, vector.new(0, 1, 0)) else - digger:set_hp(digger:get_hp() - 7) + local hp = digger:get_hp() + if hp > 0 then + digger:set_hp(hp - 7) + end end minetest.remove_node(pos)