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.
This commit is contained in:
parent
4a2a907bd1
commit
769b278494
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user