Handle kill weapon type in ctf_events instead of ctf_pvp_engine
This commit is contained in:
parent
12c1a2501b
commit
86cb53e185
1 changed files with 14 additions and 1 deletions
|
@ -151,7 +151,20 @@ function ctf_events.update_all()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ctf.register_on_killedplayer(function(victim, killer, type)
|
ctf.register_on_killedplayer(function(victim, killer, stack)
|
||||||
|
local sname = stack:get_name()
|
||||||
|
local tool_caps = stack:get_tool_capabilities()
|
||||||
|
local type = "sword"
|
||||||
|
if sname:sub(1, 8) == "shooter:" then
|
||||||
|
if sname == "shooter:grenade" then
|
||||||
|
type = "grenade"
|
||||||
|
else
|
||||||
|
type = "bullet"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if tool_caps.damage_groups.grenade then
|
||||||
|
type = "grenade"
|
||||||
|
end
|
||||||
ctf_events.post("kill_" .. type, killer, victim)
|
ctf_events.post("kill_" .. type, killer, victim)
|
||||||
ctf_events.update_all()
|
ctf_events.update_all()
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in a new issue