Sight Mag. Experiment

- Made it so that the sight magnification is more-or-less on-par with the sight amount, ensuring that the magnification FOV finishes 'zooming in' exactly when the sight amount reaches 100%.

This is still experimental - If I am retarded and did an oopsie, just revert and/or tell me I'm dumb.
This commit is contained in:
MokaAkashiya85 2024-10-20 17:55:44 +02:00
parent 59c970a1e6
commit 7394861bf9

View File

@ -63,7 +63,7 @@ local mathapproach = math.Approach
function SWEP:GetSmoothedFOVMag()
local mag = 1
local speed = 20
local speed = 1
if self:GetInSights() then
local target = self:GetMagnification()
@ -92,6 +92,8 @@ function SWEP:GetSmoothedFOVMag()
-- mag = target
speed = Lerp(self:GetSightAmount(), speed, 10)
else
speed = Lerp(self:GetSightAmount(), 15, 10)
end
local diff = math.abs(self.SmoothedMagnification - mag)