Attempt to fix HasWeapon errors -- I don't know the cause so I can't test :Sob:
This commit is contained in:
parent
3b45d259b9
commit
02557dacd1
1 changed files with 2 additions and 6 deletions
|
|
@ -212,17 +212,13 @@ hook.Add("HomigradDamage", "zcnpci", function(ent, dmginfo)
|
||||||
if dmginfo:IsDamageType(DMG_BULLET + DMG_BUCKSHOT + DMG_BLAST) then
|
if dmginfo:IsDamageType(DMG_BULLET + DMG_BUCKSHOT + DMG_BLAST) then
|
||||||
if dmginfo:GetDamage() > 3 then
|
if dmginfo:GetDamage() > 3 then
|
||||||
table.insert(npcs_to_fake, ent)
|
table.insert(npcs_to_fake, ent)
|
||||||
|
|
||||||
--local attacker_angle = dmginfo:GetAttacker():EyeAngles()
|
|
||||||
|
|
||||||
--local normal = attacker_angle:Forward(normal)
|
|
||||||
|
|
||||||
--ent.npcfakeknockback = normal * 7 * 3
|
|
||||||
end
|
end
|
||||||
elseif dmginfo:IsDamageType(DMG_CLUB + DMG_SLASH) then
|
elseif dmginfo:IsDamageType(DMG_CLUB + DMG_SLASH) then
|
||||||
local attacker = dmginfo:GetAttacker()
|
local attacker = dmginfo:GetAttacker()
|
||||||
if !IsValid(attacker) then return end
|
if !IsValid(attacker) then return end
|
||||||
|
|
||||||
|
if attacker.HasWeapon == nil then return end
|
||||||
|
|
||||||
local fists = attacker:HasWeapon("weapon_hands_sh")
|
local fists = attacker:HasWeapon("weapon_hands_sh")
|
||||||
if !fists then fists = attacker:HasWeapon("weapon_hg_coolhands") end
|
if !fists then fists = attacker:HasWeapon("weapon_hg_coolhands") end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue