Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base weapon recoil generation change+ small bugfix + hybrid trace changes #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lua/weapons/weapon_acf_base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ function SWEP:Reload()
end

function SWEP:GetPunch()
return Angle(math.Rand(-1.5, -3.5), math.Rand(-0.8, 0.8), 0) * self.RecoilMod * (self:GetNWBool("iron", false) and 0.4 or 1)
return Angle(-3, 0, 0) * self.RecoilMod * (self:GetNWBool("iron", false) and 0.4 or 1)
end

function SWEP:GetNPCBulletSpread()
Expand Down Expand Up @@ -553,8 +553,16 @@ function SWEP:CalcDropTable()
end

function SWEP:Recoil(PunchAmt)
local Ply = self:GetOwner()
Ply:ViewPunch(PunchAmt)
IFTP = IsFirstTimePredicted()
if self.Owner:IsPlayer() and (self.Owner:IsSprinting() and (self.Owner:GetAbsVelocity():LengthSqr() > 10000)) then return false end
if (SP and SERVER) or (not SP and CLIENT and IFTP) then
ang = self.Owner:EyeAngles()
ang.p = ang.p - self.RecoilMod * 0.5
ang.y = ang.y + math.Rand(-1, 1) * self.RecoilMod * 0.5

self.Owner:SetEyeAngles(ang)
end
self.Owner:ViewPunch(PunchAmt)
end

if CLIENT then
Expand Down