From 02557dacd1b94f351211b7428fa4f0c6463c5ea5 Mon Sep 17 00:00:00 2001 From: toasterpanic Date: Thu, 4 Jun 2026 22:04:52 -0400 Subject: [PATCH] Attempt to fix HasWeapon errors -- I don't know the cause so I can't test :Sob: --- lua/zcnpci.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lua/zcnpci.lua b/lua/zcnpci.lua index 5883731..cc251d2 100644 --- a/lua/zcnpci.lua +++ b/lua/zcnpci.lua @@ -212,17 +212,13 @@ hook.Add("HomigradDamage", "zcnpci", function(ent, dmginfo) if dmginfo:IsDamageType(DMG_BULLET + DMG_BUCKSHOT + DMG_BLAST) then if dmginfo:GetDamage() > 3 then table.insert(npcs_to_fake, ent) - - --local attacker_angle = dmginfo:GetAttacker():EyeAngles() - - --local normal = attacker_angle:Forward(normal) - - --ent.npcfakeknockback = normal * 7 * 3 end elseif dmginfo:IsDamageType(DMG_CLUB + DMG_SLASH) then local attacker = dmginfo:GetAttacker() if !IsValid(attacker) then return end + if attacker.HasWeapon == nil then return end + local fists = attacker:HasWeapon("weapon_hands_sh") if !fists then fists = attacker:HasWeapon("weapon_hg_coolhands") end