Delegate doing tool damage to player to tool

This commit is contained in:
rakiru 2015-02-14 05:34:45 +00:00
parent 97ca7cbd0f
commit b4d1073eae

View File

@ -676,11 +676,15 @@ network.sys_handle_c2s(PKT_PLR_GUN_HIT, "BB", nwdec_plrset(function (neth, cli,
if tplr then if tplr then
if styp >= 1 and styp <= 3 then if styp >= 1 and styp <= 3 then
local tool = plr.tools[plr.tool+1] local tool = plr.tools[plr.tool+1]
if tool.get_damage then if tool.hit_player ~= nil then
local dmg, dtype tool.hit_player(tplr, styp)
dmg, dtype = tool.get_damage(styp, tplr) else
if dmg then if tool.get_damage then
tplr.wpn_damage(styp, dmg, plr, dtype) local dmg, dtype
dmg, dtype = tool.get_damage(styp, tplr)
if dmg then
tplr.wpn_damage(styp, dmg, plr, dtype)
end
end end
end end
end end