From 90d73f0587c76fdfebe42b24be852258aa9c5767 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Tue, 13 Oct 2020 08:51:53 -0700 Subject: [PATCH] Change fall damage to use combat system --- mods/ctf/ctf_events/init.lua | 2 +- mods/pvp/anticoward/init.lua | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/mods/ctf/ctf_events/init.lua b/mods/ctf/ctf_events/init.lua index c99acc9..762dd28 100644 --- a/mods/ctf/ctf_events/init.lua +++ b/mods/ctf/ctf_events/init.lua @@ -136,7 +136,7 @@ ctf.register_on_killedplayer(function(victim, killer, stack, tool_caps) if tool_caps.damage_groups.combat_log then victim = victim .. " (Combat Log)" elseif tool_caps.damage_groups.suicide then - victim = victim .. " (Suicide)" + victim = victim .. " (Suicide?)" end ctf_events.post("kill_" .. type, killer, victim) diff --git a/mods/pvp/anticoward/init.lua b/mods/pvp/anticoward/init.lua index 3e86925..0dfb97b 100644 --- a/mods/pvp/anticoward/init.lua +++ b/mods/pvp/anticoward/init.lua @@ -4,15 +4,6 @@ local potential_cowards = {} local TIMER_UPDATE_INTERVAL = 2 local COMBAT_TIMEOUT_TIME = 20 --- Prevent fall damage from killing players -minetest.register_on_player_hpchange(function(player, hp_change, reason) - if reason.type == "fall" and player:get_hp() + hp_change <= 0 then - return (-player:get_hp()) + 1 - end - - return hp_change -end, true) - -- --- Make suicides and combat logs award last puncher with kill -- @@ -76,7 +67,7 @@ end) minetest.register_on_dieplayer(function(player, reason) local pname = player:get_player_name() - if reason.type == "node_damage" or reason.type == "drown" then + if reason.type == "node_damage" or reason.type == "drown" or reason.type == "fall" then if potential_cowards[pname] then local hname = potential_cowards[pname].puncher local last_attacker = minetest.get_player_by_name(hname)