From 769b2784947438db0fadafefbbfaa9a80bd59ec9 Mon Sep 17 00:00:00 2001 From: ANAND Date: Sat, 6 Jul 2019 21:27:15 +0530 Subject: [PATCH] Pass tool_capabilities to on_killedplayer callbacks (#38) Provides a solution to the regression introduced by 1c373b66, which removed passing of hard-coded kill types to on_killedplayer callbacks, and passed the wielditem instead. The problem with passing wielditem is that throwables can't be detected, as the wielditem would be nil. Grenades used to be detected before the aforementioned commit due to the special `grenade` damage group in the grenade's toolcaps. --- ctf/teams.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ctf/teams.lua b/ctf/teams.lua index f629c35..362fd6f 100644 --- a/ctf/teams.lua +++ b/ctf/teams.lua @@ -507,7 +507,8 @@ minetest.register_on_punchplayer(function(player, hitter, dead_players[pname] = true local wielded = hitter:get_wielded_item() for i = 1, #ctf.registered_on_killedplayer do - ctf.registered_on_killedplayer[i](pname, hname, wielded) + ctf.registered_on_killedplayer[i](pname, hname, + wielded, tool_capabilities) end return false end