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.
master
ANAND 2019-07-06 21:27:15 +05:30 committed by GitHub
parent 4a2a907bd1
commit 769b278494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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