This reverts commit 84dc7da461
.
This commit is contained in:
parent
84dc7da461
commit
ea9d9ad2d8
9 changed files with 66 additions and 45 deletions
|
@ -38,11 +38,12 @@ ctf.register_on_attack(function(player, hitter,
|
|||
|
||||
potential_cowards[pname].timer = 0
|
||||
potential_cowards[pname].puncher = hname
|
||||
potential_cowards[pname].wielded_item = hitter:get_wielded_item()
|
||||
potential_cowards[pname].toolcaps = tool_capabilities
|
||||
end
|
||||
end)
|
||||
|
||||
ctf.register_on_killedplayer(function(victim, killer, toolcaps)
|
||||
ctf.register_on_killedplayer(function(victim, killer, _, toolcaps)
|
||||
if toolcaps.damage_groups.combat_log or toolcaps.damage_groups.suicide then
|
||||
return
|
||||
end
|
||||
|
@ -71,6 +72,7 @@ function handle_leave_or_die(pname, leave)
|
|||
ctf.registered_on_killedplayer[i](
|
||||
pname,
|
||||
hname,
|
||||
potential_cowards[pname].wielded_item,
|
||||
potential_cowards[pname].toolcaps
|
||||
)
|
||||
end
|
||||
|
|
|
@ -69,7 +69,7 @@ function kill_assist.reward_assists(victim, killer, reward)
|
|||
kill_assist.clear_assists(victim)
|
||||
end
|
||||
|
||||
ctf.register_on_killedplayer(function(victim, killer, toolcaps)
|
||||
ctf.register_on_killedplayer(function(victim, killer, _, toolcaps)
|
||||
local reward = ctf_stats.calculateKillReward(victim, killer, toolcaps)
|
||||
reward = math.floor(reward * 100) / 100
|
||||
kill_assist.reward_assists(victim, killer, reward)
|
||||
|
|
|
@ -133,21 +133,22 @@ end)
|
|||
|
||||
-- If player takes damage while healing,
|
||||
-- stop regen and revert back to original state
|
||||
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
||||
minetest.register_on_player_hpchange(function(player, hp, reason)
|
||||
local name = player:get_player_name()
|
||||
if hp_change < 0 then
|
||||
if hp < 0 then
|
||||
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.type == "punch" then
|
||||
if reason and reason.type == "punch" then
|
||||
local hitter = reason.object
|
||||
if hitter and players[hitter:get_player_name()] then
|
||||
stop_healing(hitter, "attack")
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
return hp
|
||||
end, true)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
players[player:get_player_name()] = nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue